Archived

This topic is now archived and is closed to further replies.

Vertex Shaders.......

This topic is 5583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Just built an extremely advanced shadow renderer. It uses vertex shaders and Pixel Shaders to make it as fast as possible. Gives me an awesome lot of frames per second. But the sad part is, once i set a vertex shader, i cannot revert to the previous one. I need the vertex shader only for calculating the shadows. Once its done, i want to revert to normal transformations without the vertex shader. It doesnt do that. I have to write another vertex shader separately to do the normal transformations. This is a big pain. I tried using dev->GetVertexShader(&normal); and then set the new vertex shader, compute shadows, and then use SetVertexShader( normal ); it doesnt work I loose my texturing info..... In case of Pixel shaders, i can say...... SetPixelShader( NULL ); and it reverts to the normal render pipeline. Isnt there something which i can use to enable and disable vertex shaders????? Raptor

Share this post


Link to post
Share on other sites
As far as I know to revert to the normal pipeline that Direct3D uses you just have to call SetVertexShader(D3DFVF_XYZ) with using whatever FVF that you would normally specify with whatever vertices you are using instead of D3DFVF_XYZ .

Share this post


Link to post
Share on other sites
I ASSUME you are using 2 vertex shaders (rather than 1 VS and the standard pipeline).

Compile your "normal" pipeline. This will return a DWORD. This is a "handle" to this vertex shader.

Compile your "shadow" pipeline. This will return a DWORD. This is a "handle" to this vertex shader.

When you want to render normally:

Device->SetVertexShader(Normal_Handle);

When you want to render shadows:

Device->SetVertexShader(Shadow_Handle);

Avoid the GetVertexShader if possible.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites