Jump to content

  • Log In with Google      Sign In   
  • Create Account


Medo3337

Member Since 24 Apr 2012
Offline Last Active Jul 13 2014 05:57 PM
*----

Posts I've Made

In Topic: Rotating Weapon Gradually To Look at Target Point

02 July 2014 - 11:11 PM

@L. Spiro: How do I get pitch, yaw, roll from vRight, vUp, vForward?

 

How do I calculate the current target based on the gun position and the final target so I can rotate gradually?


In Topic: Rotating Weapon Gradually To Look at Target Point

02 July 2014 - 07:38 PM

@Buckeye: If I have the target point that the weapon mesh should look at, how do I calculate finalQuat?


In Topic: Most Efficient Way for Lighting in Forward Rendering

16 June 2014 - 03:58 PM

I figured out that the Z-Fighting was due to the animation getting updated every time the mesh is rendered, so I changed the code to only update once every frame no matter how many times I do draw calls.

 

The problem now is that I the mesh is getting very bright when I render it multiple times as the following:

 

PS Pass 0: return Ambient;

PS Pass 1: return tex2D(ColorMap, IN.UV) + Light1();

PS Pass 1: return tex2D(ColorMap, IN.UV) + Light2();

PS Pass 1: return tex2D(ColorMap, IN.UV) + Light3();

 

I believe that it's getting very bright because tex2D(ColorMap, IN.UV) is added multiple times.

 

How do I fix it?


In Topic: Most Efficient Way for Lighting in Forward Rendering

15 June 2014 - 11:37 PM

@mhagain: I'm rendering all the meshes using LPD3DXMESH, so I only use pMesh->DrawSubset() and I still have the Z-Fighting problem when animation is playing

 

Another problem, when I draw the mesh multiple times I get very bright mesh (even if there is no lighting)

 

Here is what I have in the Shader:

 

pass0 = ambient pass (render once)

pass1 = tex2D(ColorMap, IN.UV) + light (repeat rendering according to the number of lights)

    pass pass0
    {
         AlphaBlendEnable = FALSE;
         DestBlend = ONE;
         SrcBlend = ZERO;
         BLENDOP = ADD;
         ZEnable = TRUE;
         VertexShader = compile vs_3_0 VS();
         PixelShader  = compile ps_3_0 PS_AMBIENT();
    }


    pass pass1
    {
         AlphaBlendEnable = TRUE;
         SRCBLEND = ONE;
         DESTBLEND = ONE;
         BLENDOP = ADD;
         ZWRITEENABLE = TRUE;
         ZEnable = TRUE;
         VertexShader = compile vs_3_0 VS();
         PixelShader  = compile ps_3_0 PS();
    }

In Topic: Most Efficient Way for Lighting in Forward Rendering

14 June 2014 - 08:43 PM

@mhagain: It's now working well, however I see Z-Fighting in the animated character (only when the animation is playing)

 

I'm using D3D9, C++


PARTNERS