Jump to content

L B

Members
  • Posts

    967
  • Joined

  • Last visited

Everything posted by L B

  1. I saw it, but I thought you used it for reflections, not for ambient shadowing.
  2. 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.
  3. As title suggests. Could bring great improvements.
  4. 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; } } } }
  5. I agree with you, although Josh has told me he might be interested by my headers, given that he can review them. Note that he also pinned my topic, which I guess is some sign of acceptance. Nevertheless, Josh is not a C# coder, so he might never actually support it. Saying the community support is too weak is just like saying the C++ community support is too weak because the headers are only maintained by Mika.
  6. Hasn't Josh already told us 20 times that both an increased terrain texture layer count and an eventual alternative way of doing GI (to use his words: "I think I know a way of doing this.")? If I were Josh, I would totally understand why not pushing these features: No one has made a single game yet.
  7. Got some progress: 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",""
  8. Having a lot of trouble with it. I used the FBX format and fbx2gmf.exe, made the good .mat files, but it stays black (IMHO, it's because there's no abstract:: in the surface names and there's also a dot in them). Also, there are bones, but the mesh isn't attached to it. Any idea?
  9. Incredible. Can't thank you enough. You save me bucks
  10. Have a look at http://forum.leadwerks.com/viewtopic.php?f=32&t=2771, although I doubt this is what you want.
  11. GetHwnd() Assuming you use C/C++.
  12. Fraps. http://www.fraps.com/
  13. I think Graphics() does much more than just a normal initialization. Contact Josh about this, I'm no help with C# in this case.
  14. Has anybody converted the wizard? If so, how? I need help on this one :/
  15. http://leadwerks.com/werkspace/index.php?/tracker/issue-12-editor-rescaling-not-saving/
  16. L B

    Why Apple Fails

    I take it as if they don't want or feel like they need any game or intense graphics application on a Mac, since their users wouldn't use them. It's just a vicious circle: don't provide us the means of making a game, we won't make one. Their won't be gamers on Mac, so you won't provide us the means of making a game. Etc, etc.
  17. Scaling doesn't even work at the moment, for this specific reason. Josh has no intent to support it. Look at the tracker.
  18. L B

    Framewerk

    Framewerk is basically the most global effect portal to Leadwerks. If you want to combine it with yours, I'd rather suggest you customize it, as the C++ and BMX headers are open-source.
  19. Here you go with a simple implementation of my OOP drawing system. It's a simple button class that can be used in any way you like. Call "Button.Update()" right before "Graphics.Flip()". Feel free to make a list that updates all of them, I'm simply sharing this class. Couldn't make it part of any other release, really. public enum ButtonState { Idle, Hover, Clicked, Down } public class Button { public Texture IdleTexture { get; set; } public Texture HoverTexture { get; set; } public Texture ClickedTexture { get; set; } public Texture DownTexture { get; set; } public ButtonState State { get; private set; } public Image Image { get; private set; } public Button(Image image) { this.State = ButtonState.Idle; this.Image = image; this.IdleTexture = this.Image.Texture; this.ClickedTexture = this.Image.Texture; this.HoverTexture = this.Image.Texture; this.DownTexture = this.Image.Texture; } public void Update() { this.State = ButtonState.Idle; if ( Mouse.X >= this.Image.X && Mouse.Y >= this.Image.Y && Mouse.X <= this.Image.X + this.Image.Width && Mouse.Y <= this.Image.Y + this.Image.Height ) { this.State = ButtonState.Hover; if (Mouse.ButtonDown(MouseButton.Left)) { this.State = ButtonState.Down; } if (Mouse.ButtonHit(MouseButton.Left)) { this.State = ButtonState.Clicked; } } switch (this.State) { case ButtonState.Clicked: this.Image.Texture = this.ClickedTexture; break; case ButtonState.Down: this.Image.Texture = this.DownTexture; break; case ButtonState.Hover: this.Image.Texture = this.HoverTexture; break; case ButtonState.Idle: this.Image.Texture = this.IdleTexture; break; } Drawing.SetBlend(BlendType.Alpha); this.Image.Draw(); Drawing.SetBlend(BlendType.None); } }
  20. Without any intent to be offensive, most of the things you said are obsolete or wrong. First of all, there are few third party libraries that you will need for C#, considering it's backed up by a completele framework. In other cases, I have always found what I needed as 3rdPL to make my application work. The easiness of a language is really subjective, so I won't comment on this. C# is not Windows only anymore, since Mono is out of Beta and DotGNU is coming along pretty nicely, as far as I know. I have run many applications on Linux, although I do not have a Mac to test.
  21. L B

    Custom Buffer

    Instead of Dim light As IntPtr = 0 light = CreateDirectionalLight(0) Use something as: Dim light As Light = Light.CreateDirectional()
  22. L B

    .NET Headers

    Oh boy, don't get me started on VS2010. I couldn't even write a hello world without my computer to display a blue screen of death.
×
×
  • Create New...