argeze

Members
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

127 Neutral

About argeze

  • Rank
    Newbie
  1. [quote name='Medo3337' timestamp='1353233850' post='5002002'] The terrain will not be moving, so it's mass is set to zero and I'm using one single terrain and trying to setup a building over it. [/quote] You terrain having 0 mass is a static object. So an object which do not move and allow other dynamic bodies to interact with. If your building should also not move, then it should probably also be a static object, so a btRigidBody with also 0 mass. But you need to place that building yourself on a position in the world. So of course, depending where you place it, the terrain might intersect with it and this is perfectly fine. Static objects can intersect each other and won't affect the simulation. Just make sure you do not place dynamic objects at initial position that intersect with static ones. SO just build the shape of the building with simple shape for starting like the btBoxShape, then set the mass to 0 and create a btRigidBody with it. Add it to the world at the position you want the building to be in the world and you are set.
  2. Vertex shader fog question

    Helps a lot. Thank you for the input. I will use shader model 2 since i really dont need version 3 anyway
  3. Vertex shader fog question

    Thank you for your reply :) Oh, i didn't know about that. I use the D3DXGetVertexShaderProfile(g_pd3dDevice) in order to specify the highest vertex shader version possible and my video card do support shader 3.0. So vertex shader 3 do not take care of fog at all? Meaning i should remove the FOG semantic from my vertex output and just merge the result manually? If i want to do it manually, i think i can only do it in the pixel shader, is that right? Or i could change the Alpha value of the vertices in the vertex shader so they would appear gradually. Would that work right?
  4. Hello everyone, i am trying to add distance vertex fog to my terrain engine and this is my firs try. I am under the understanding that when using a shader, i still need to set the render state for FOGENABLE and FOGCOLOR and then add the semantic FOG to my vertex shader output and set the value for each vertex from 0 to 1. However i cant make it work. Here is the relevant code. If anyone see something wrong or missing please tell me, i checked every post concerning vertex fog and i don't see the problem. This is set just before the terrain draw call which is done with a vertex and pixel shader. g_pd3dDevice->SetRenderState(D3DRS_FOGENABLE, TRUE); g_pd3dDevice->SetRenderState(D3DRS_FOGCOLOR, D3DCOLOR_RGBA(255,0,255,128)); This is the relevant code from my vertex shader. extern float3 mCamPos; extern float mMinFogRange; extern float mMaxFogRange; struct VS_OUTPUT { float4 Position : POSITION; // vertex position float4 Diffuse : COLOR0; // vertex diffuse color float2 Tex0 : TEXCOORD0; // Main patch texture float2 Tex1 : TEXCOORD1; // Detail texture float FogFactor : FOG; // Vertex Fog }; VS_OUTPUT PatchRender( in float3 pos : POSITION, uniform int lod, uniform int2 patchPos) { VS_OUTPUT Output = (VS_OUTPUT)0; ... ... // Fog density float viewDist = length(Output.Position.rgb - mCamPos); float fogFactor = (mMaxFogRange - viewDist) / (mMaxFogRange - mMinFogRange); Output.FogFactor = fogFactor; return Output; } [/SOURCE][/source] And this is the pixel shader afterward. But i believe the pixel shader do not have anything to do with the vertex fog, right? sampler2D tex0; float4 PatchRenderPS(in VS_OUTPUT IN) : COLOR0 { float4 color = tex2D(tex0, IN.Tex0); return IN.Diffuse * color; } [/SOURCE][/source] Whatever i do, i never have any fog. I even tried setting the Output.FogFactor in my vertex shader to a fixed 0.5 to see and even there nothing at all. No fog whatsoever. I really do need help [Edited by - argeze on January 6, 2007 1:27:33 PM]