Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

191 Neutral

About GLForce

  • Rank
  1. However, further on, you mention objects in Mario which is a platformer and, like other platformers, doesn't use tiles at all.[/quote] Btw, Mario games do use tiles.
  2. GLForce

    Destructor crashing game?

    You do not have an array of them, just a pointer to them. Try to remove the brackets [ ].[/quote] I agree for the first one (D3DMATERIAL9). However LPDIRECT3DTEXTURE9 is a definition of a pointer to a DIRECT3DTEXTURE9 structure. However I'm a bit rusty with C++ and I'm not sure how the delete operator works with typedefs EDIT : Well, SiCrane must know better than me ;)
  3. GLForce

    Destructor crashing game?

    I'd need more information on the crash. Does it pop an error message ? But on the top of my head I would say try using the Release() method for both objects instead of deleting them yourself. Of course you have to be sure they contain valid data before using the Release method.
  4. GLForce

    2d mmo started

    I may be totally wrong, and I'm deeply sorry if I am, but I just want to help you here. Just by reading your post I get the idea that you don't necessarily have the knowledge and resources required to build even the most basic MMORPG. I don't say that because I do (because I clearly don't), I say that because I agree with the fact that creating a MMO, even just managing one, is gigantic job. You might read that, that could help :
  5. I'm pretty interested in the anwer myself, as I have some hard time figuring a good way.
  6. I think what he meant was to use one boundind box per rectangular shape in a mesh. For example, in a T or a L there would be two bounding boxes required (one for the vertical part and one for the horizontal one). On the other hand a Square would require only one bounding box.
  7. Personnaly, I prefer to organize my engine directories by taking each resource type as its own. Example : - Data --- Models (Meshes) --- Textures --- Shaders --- Sounds --- ect.. The way they act together and the hierarchy of the structure belongs to the code, not to the directories. In my case, shaders aren't "on top" of the meshes in the render hiearchy, but even if it was the case, my directories structure would stay the same. Way more simple to manage and navigate if you ask me. That's my two cents. EDIT : I forgot to mention that I then use a personal file structure to describe complex objects made from those resources. For example, here would be a file structure for a character model : [VISUAL] Model = filename (in Models) Texture1 = filename (in Textures) Texture2 (normal map for example) = filename Shader = filename (in Shaders) etc.. [STATS] stat1 = ... whatever So for the goblin that would look like : [VISUAL] Model = goblin.dae Texture1 = goblin.jpg Texture2 = Shader = RenderShader1.fx etc.. In your case, the shader surely could not be stated in this file, but I'm not sure what would be best.
  8. GLForce

    Z-fighting ?

    Quote: Have a read of Learning to Love your Z-Buffer. It's in the context of OpenGL but otherwise sound. Now I get it. I always thought (and I guess I'm not alone) that the z-buffer was linear. Of course it's more logical to do it non-linear, but well, I guess that's why I'm not the guy who thought those concepts :P It's always good to undertsand a bit more what I'm doing. Thanks.
  9. GLForce

    Z-fighting ?

    I just tried depth biasing and it doesn't seem to work. Like you said, resuolts may vary on different hardware and it seems it won't work on mine. Anyway, the problem was already solved by putting a near plane distance of about 5, which isin't much but still gives the wanted results. Thanks anyway !
  10. GLForce

    Z-fighting ?

    It worked, thanks alot. WHat I find odd is that I read somethign about the distance between clipping planes and so I tried to get the Far Plane closer to the camera. It didin't work. However, just pushing the near plane a few clicks forward made it. I don't understand quite well, as it seems the distance is not important, but it's more like the near plane position. Anyway, problem solved, and very quick, so thank you again.
  11. GLForce

    Z-fighting ?

    I am currently programming a simple 3D engine and currently I'm working on more "advanced" features such as terrain. Now here is the problem, I've just added a water plane and on the intersection between this plane and the hills from my terrain, bothering "jaggies" appear. I've put a screenshot. I thought it could be the pixel shaders (there are pixel shaders applied on both the terrain and the water), but after quick tests I came to the conclusion that it was not. I've tried also to replace the indexed primitive rendering used for the terrain by normal primitive rendering, and still got the same result. So, my conclusion is that it may be a z-fighting problem. Am I right ? It seems kind of logical because at the particular point where the water plane and the terrain slope meet, the pixels are at the exact same position. So if it is really z-fighting, is there any simple soluion in that case ? The only solution I found myself was to make a custom shape following (but not crossing) the shoreline for the water plane, but it adds alot of useless work and removes alot of freedom. Any thought ? Thanks !
  12. GLForce

    Simle HLSL cubemap reflection

    It was actually pretty clear. Wow, nice find. Such a small thing it was, but I would never have found it. Thank you alot. Sadly, I did my water a new way. You see, as the reflection is computed in the pixel shader, I use it to add nice waves by displacing the normal a bit. Of course I could do through the vertex shader using a normal map, but I don't really like it. Making it procedural permits infinite planes, but a normal texture would quickly look odd as the plane grows. Anyway, I'll see what I can do for this, but for now this pixel shader doesn't seem to eat too much on my GeForce 6600 GT. Take a look here : Thanks again ! EDIT : I just thought about it, I had hard time to find some water exemple (in fact, I didin't find any and had to figure this myslef, with your help), so I thought i'd give away to source code, in case some dude find this thread. So, here it is : float4x4 WorldViewProj : WORLDVIEWPROJ; float4x4 World : WORLD; float ElapsedTime; float3 Eye : CAMERAPOSITION; float WaveSpeed; float WaveHeight; float4 WaterColor; float LightIntensity; texture ReflectionTexture; samplerCUBE ReflectionSampler : TEXUNIT3 = sampler_state { Texture = (ReflectionTexture); MIPFILTER = LINEAR; MINFILTER = LINEAR; MAGFILTER = LINEAR; }; struct VS_IN { float4 Position : POSITION; float3 Normal : NORMAL; }; struct VS_OUT { float4 Position : POSITION; float3 WorldPos : TEXCOORD0; float3 Normal : TEXCOORD1; float Time : TEXCOORD2; float Height : TEXCOORD3; }; struct PS_OUT { float4 Color : COLOR0; }; VS_OUT vs_func(in VS_IN In) { VS_OUT Out; Out.Position = mul(In.Position, WorldViewProj); float3 WorldPos = mul(In.Position, World).xyz; float3 Normal = normalize(mul(In.Normal,World)); Out.WorldPos = WorldPos; Out.Normal = Normal; Out.Time = ElapsedTime*WaveSpeed; Out.Height = (1/WaveHeight)*500; return Out; } PS_OUT ps_func(in VS_OUT In) { PS_OUT Out; float Theta = sin(In.Time+In.WorldPos.x+In.WorldPos.z)/In.Height; float3x3 MX = float3x3(float3(1, 0, 0),float3(0, cos(Theta), -sin(Theta)), float3(0, sin(Theta),cos(Theta))); float3 Normal = mul(In.Normal,MX); float3 V = (In.WorldPos - Eye); float3 Reflect = reflect(V, Normal); float4 color = texCUBE(ReflectionSampler, Reflect); Out.Color = color * WaterColor; Out.Color.a = lerp(WaterColor.a,1.0f,length(In.WorldPos-Eye)/20.0f); return Out; } technique Technique0 { pass p0 { FogEnable = FALSE; Lighting = FALSE; Sampler[0]= (ReflectionSampler); VertexShader = compile vs_1_1 vs_func(); PixelShader = compile ps_2_0 ps_func(); } } [Edited by - GLForce on April 22, 2009 9:10:23 PM]
  13. GLForce

    Simle HLSL cubemap reflection

    I find it quite difficult to understand some things in HLSL. Like I said, interpolation seems to give different results depending on data sent or recieved. The best example is per-pixel lighting. The calclations are mostly made in the pixel shader to gain more "precision", but there is still data sent to this pixel shader that is interpolated (position, normal, etc..) Why is it that those interpolations work and others not ? Is it value precision (the smaller the values interpolated, the less precision there is) ? I really don't get it. Jason : In fact there is 6 vertices in output, and they are composed of the 4 in input. Look carefully, I used four vertices to describe two polygons, so 2 of them (in this case #1 and #2) are replicated in both triangles. I hope I undertsood what you meant. Here is a new link to the PIX file
  14. GLForce

    How to paste texture

    I thought the same thing at first, but the ambient color is set to maximum (which should kind of nulify the lighting effect).
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!