Jump to content

L B

Members
  • Posts

    967
  • Joined

  • Last visited

Posts posted by L B

  1. As used in this picture:

    http://origins.muboo.net/

     

    This was made with the GIMP "soft-glow" filter. Applies really fast, I don't see why it couldn't be real-time. Basically boosts whites and desaturates I think. Of course, in a gameplay environment, the white boost could be much lower, but I think the effect is nice.

     

    By the way, this is not necessarily a feature request for Josh, but for anyone who enjoys GLSL. :)

    • Upvote 1
    • Downvote 1
  2. I got all my performance back after using SetShadowMode(0, 1).

    Although, simply for Josh, note that putting the ShadowMapSize of all my point light maps to 2, 4, or 8 (a.k.a. really low values) does NOT give a boost in performance when the shadow is handled with a skinned mesh. I think the skin + shadow system needs to be reviewed, or else my material files are somehow wrong.

  3. I can't because the light is automatically created from the LUA script. This way I don't have to place a light for each lamp I place. Here's my script for the lamp post:

    dofile("Scripts/base.lua")
    
    function Spawn(model)
    local entity=base_Spawn(model)
    entity.model=model
    
    local light=CreatePointLight(30,model)
    light:Move(Vec3(0, 3.85, 0))
    local intensity = 1
    light:SetColor(Vec4(245/255*intensity, 170/255*intensity, 115/255*0.7, 255/255*intensity))
    light:SetShadowmapSize(64)
    light:SetKey("castshadows", 0) -- Didn't work.
    
    return entity
    end
    

     

     

    On a side note, any recommendation for a GPU? My budget's low but one can dream.

  4. Specs?

     

    There are still some additional shadow techniques I can use to optimize it further without losing quality. They'll probably be in place before you have a demo out.

     

    GeForce 9600 GT, 4GB RAM, 2.30 Ghz Dual Core, W7RC. (Although, I have no bump mapping, 4 lights in scene (1 dir+3 points), and no ground cover (i.e. few models)).

     

    I'm really not figuring what's wrong there, it MIGHT be my character logic, but I doubt it.

     

    And heck, GI and molecular precision will be in place before I have a demo out.

     

    I'll try removing the shadows on the lights and see how it works.

  5. Thats not what Mack meant.

     

    Even if the collision body is big, it doesn't have more vertices. Nonetheless, is there a way to disable shadowing on specific lights and mesh combination? Like turn "CastShadow" off but only for a specified light?

  6. just out of curiosity, have you turned on debugphysics? I am curious to see how large the collisionbody for the wizard is whenever it gets loaded since you are scaling it by 0.01? you should really get UU3D and scale all of your assets before converting them to gmf... if you know someone you can trust to do the scaling/conversion for you, you should do it.

     

    Haven't turned on DebugPhysics, so that isn't it. I'll make serious models when I get to my actual game characters, but the wizard is a test model.

    On a second note, it seems to only happen in the vicinity of many lights (a.k.a. directional + point + point). Are skinned meshes slow on lights?

  7. http://www.crytek.com/fileadmin/user_upload/inside/presentations/2009/A_bit_more_deferred_-_CryEngine3.ppt

    Nice features to look at, including improved SSAO with normals. I always wondered, why is our SSAO so strict? Appears to me it only covers the edges, not a wider area, like in CryEngine.

    Of course, there's a lot of talk about GI in there, but I think Josh might just as well pop the head of the next person who asks for it.

  8. I'm making a control code (move, change camera orientation, etc.), just like in any classic MMORPG. Losing 10 FPS with this, and it's just logic.

    I know it's in C#, but anyone here would understand I think.

     

    using Leadwerks;
    
    namespace Origins
    {
    public enum PlayerState
    {
    	Idle,
    	ForwardWalking,
    	Dying,
    	Hit,
    	Jumping,
    	Attacking,
    	MagicAttacking,
    	LeftWalking,
    	RightWalking,
    	BackwardWalking,
    	Flying
    }
    
    public class Player
    {
    	public Camera Camera { get; set; }
    	public Controller Controller { get; set; }
    	public Mesh Mesh { get; set; }
    
    	private Vector3 Rotation { get; set; }
    	private Vector2 MouseDelta { get; set; }
    	private Vector2 MouseOrigin { get; set; }
    	private Vector3 Movement { get; set; }
    	private float Zoom { get; set; }
    	private float Jump { get; set; }
    	private bool Reorient { get; set; }
    
    	public PlayerState State { get; set; }
    	private PlayerState OldState { get; set; }
    
    	private int DeathFrame = 0;
    	private int HitFrame = 80;
    	private int IdleFrame = 106;
    	private int JumpFrame = 176;
    	private int MagicFrame = 203;
    	private int MeleeFrame = 250;
    	private int RunFrame = 297;
    	private int SideFrame = 323;
    	private int WalkFrame = 357;
    	private int BackFrame = 393;
    
    	public Player()
    	{
    		this.Camera = new Camera();
    
    		this.Controller = new Controller(1.8f, 0.5f, 0.5f, 45.0f);
    		this.Controller.Mass = 1;
    		this.Controller.CollisionType = (int)CollisionType.Character;
    
    		this.Mesh = Mesh.Load("abstract::wizard.gmf");
    		this.Mesh.Parent = this.Controller;
    		this.Mesh.Scale = new Vector3(0.01f);
    		this.Mesh.Move(new Vector3(0, -90.0f, 0));
    
    		this.Rotation = new Vector3();
    		this.MouseDelta = new Vector2();
    		this.MouseOrigin = new Vector2();
    		this.Movement = new Vector3();
    		this.Zoom = 1.0f;
    		this.Jump = 0.0f;
    		this.Reorient = false;
    
    		//Light lantern = Light.CreatePoint(5);
    		//lantern.ShadowmapSize = 16;
    		//lantern.Color = new Vector4(1, 0, 0, 1);
    		//lantern.Parent = this.Mesh.GetChild("stuff2");
    	}
    
    	public void Update()
    	{
    		this.OldState = this.State;
    
    		this.State = PlayerState.Idle;
    
    		switch (Keyboard.KeyHit(Key.Space) && !this.Controller.IsAirborne())
    		{
    			case true:
    				this.Jump = 5.0f;
    				break;
    
    			case false:
    				this.Jump = 0.0f;
    				break;
    		}
    
    		switch (Keyboard.IntKeyDown(Key.W) - Keyboard.IntKeyDown(Key.S))
    		{
    			case 1:
    				this.State = PlayerState.ForwardWalking;
    				this.Movement.Z = 4.0f;
    				break;
    
    			case 0:
    				this.Movement.Z = 0.0f;
    				break;
    
    			case -1:
    				this.State = PlayerState.BackwardWalking;
    				this.Movement.Z = -2.0f;
    				break;
    		}
    
    		if (Mouse.ButtonDown(MouseButton.Left) || Mouse.ButtonDown(MouseButton.Right))
    		{
    			Mouse.Hide();
    
    			switch (Keyboard.IntKeyDown(Key.D) - Keyboard.IntKeyDown(Key.A))
    			{
    				case 1:
    					this.State = PlayerState.RightWalking;
    					this.Movement.X = 2.0f;
    					break;
    
    				case 0:
    					this.Movement.X = 0.0f;
    					break;
    
    				case -1:
    					this.State = PlayerState.LeftWalking;
    					this.Movement.X = -2.0f;
    					break;
    			}
    
    			this.MouseDelta.X = Utilities.Curve(Mouse.X - this.MouseOrigin.X, this.MouseDelta.X, 5.0f);
    			this.MouseDelta.Y = Utilities.Curve(Mouse.Y - this.MouseOrigin.Y, this.MouseDelta.Y, 5.0f);
    
    			this.Rotation.X += this.MouseDelta.Y / 5.0f;
    			this.Rotation.Y -= this.MouseDelta.X / 5.0f;
    
    			Mouse.Move((int)this.MouseOrigin.X, (int)this.MouseOrigin.Y);
    		}
    		else
    		{
    			this.Movement.X = 0.0f;
    
    			Mouse.Show();
    			this.Rotation.Y -= (float)(Keyboard.IntKeyDown(Key.D) * 3 - Keyboard.IntKeyDown(Key.A) * 3);
    		}
    
    		if (this.Controller.IsAirborne())
    		{
    			this.State = PlayerState.Jumping;
    		}
    
    		if (Mouse.ButtonDown(MouseButton.Right) || Keyboard.KeyDown(Key.D) || Keyboard.KeyDown(Key.A) || Keyboard.KeyDown(Key.W) || Keyboard.KeyDown(Key.S))
    		{
    			this.Reorient = true;
    		}
    		else
    		{
    			this.Reorient = false;
    		}
    
    		this.Camera.Rotation = this.Rotation;
    
    		this.Zoom = Utilities.Curve((float)-Mouse.Z, this.Zoom, 5.0f);
    
    		if (this.Reorient)
    		{
    			this.Controller.Update(this.Rotation.Y, this.Movement.Z, this.Movement.X, this.Jump, 500.0f, 1);
    		}
    		else
    		{
    			this.Controller.Update(this.Controller.Rotation.Y, this.Movement.Z, this.Movement.X, this.Jump, 500.0f, 1);
    		}
    
    		this.Camera.Position = this.Controller.Position;
    		this.Camera.Move(new Vector3(0.0f, 0.5f * this.Zoom, -2.5f * this.Zoom));
    
    		this.MouseOrigin.X = (float)Mouse.X;
    		this.MouseOrigin.Y = (float)Mouse.Y;
    
    		if (this.State != this.OldState)
    		{
    			/*
    				death     0   80
    				hit       80  106
    				idle      106 176
    				jump      176 203
    				magic     203 250
    				melee     250 297
    				run       297 323
    				side      323 357
    				walk      357 393
    				walk back 393 429
    			 */
    
    			this.DeathFrame = 0;
    			this.HitFrame = 80;
    			this.IdleFrame = 106;
    			this.JumpFrame = 176;
    			this.MagicFrame = 203;
    			this.MeleeFrame = 250;
    			this.RunFrame = 297;
    			this.SideFrame = 323;
    			this.WalkFrame = 357;
    			this.BackFrame = 393;
    		}
    
    		this.DeathFrame++;
    		this.HitFrame++;
    		this.IdleFrame++;
    		this.JumpFrame++;
    		this.MagicFrame++;
    		this.MeleeFrame++;
    		this.RunFrame++;
    		this.SideFrame++;
    		this.WalkFrame++;
    		this.BackFrame++;
    
    		if (DeathFrame == 80)
    			DeathFrame = 1;
    
    		if (HitFrame == 106)
    			HitFrame = 81;
    
    		if (IdleFrame == 176)
    			IdleFrame = 107;
    
    		if (MagicFrame == 250)
    			MagicFrame = 204;
    
    		if (MeleeFrame == 297)
    			MeleeFrame = 251;
    
    		if (RunFrame == 323)
    			RunFrame = 298;
    
    		if (SideFrame == 357)
    			SideFrame = 324;
    
    		if (WalkFrame == 393)
    			WalkFrame = 358;
    
    		if (BackFrame == 429)
    			BackFrame = 394;
    
    		switch (this.State)
    		{
    			case PlayerState.Idle:
    				this.Mesh.Animate(IdleFrame, 1, 0, 1);
    				break;
    
    			case PlayerState.ForwardWalking:
    				this.Mesh.Animate(RunFrame, 1, 0, 1);
    				break;
    
    			case PlayerState.BackwardWalking:
    				this.Mesh.Animate(BackFrame, 1, 0, 1);
    				break;
    
    			case PlayerState.LeftWalking:
    			case PlayerState.RightWalking:
    				this.Mesh.Animate(SideFrame, 1, 0, 1);
    				break;
    
    			case PlayerState.Jumping:
    				this.Mesh.Animate(JumpFrame, 1, 0, 1);
    				break;
    
    			case PlayerState.Flying:
    				this.Mesh.Animate(185, 1, 0, 1);
    				break;
    		}
    	}
    }
    }
    

  9. Got some progress:

    WizardFail.jpg

    Any advice? Here are my mat files:

     

    base.body_c.mat

    texture0 = "abstract::body.dds"
    texture1 = "abstract::body_normal.dds"
    shader = "abstract::mesh_diffuse_bumpmap_skin.vert" , "abstract::mesh_diffuse_bumpmap_specular.frag"
    shadowshader = "abstract::mesh_shadow_skin.vert",""

     

     

    base.posoh_c.mat

    texture0 = "abstract::staff.dds"
    texture1 = "abstract::staff_normal.dds"
    shader = "abstract::mesh_skin_diffuse.vert" , "abstract::mesh_diffuse_alphatest.frag"
    shadowshader = "abstract::mesh_shadow_skin.vert",""
×
×
  • Create New...