Sign in to follow this  
idloco

Shaders an lightning

Recommended Posts

idloco    156
i having problems using the standard ligthing of DirectX and HLSL, what i mean is when the terrain has the shaders on, the ligthing stop working. and all the othrer things of the engine turn to black.. Is this a standard issue? ( you can't mix HLSL and normal lightning ( D3DLIGHT9 ) ) or is code problem? ( which if it is the case i will post the necesary code ) Thanks in advance..

Share this post


Link to post
Share on other sites
hplus0603    11347
As documented in the D3D documentation, when you use vertex shaders, fixed-function vertex processing (where lighting is included) is disabled. For each call to DrawIndexedPrimitives() (or another draw call), you can choose between one and the other -- if you've called SetVertexShader(shader), or have applied a .fx file with a vertex shader, then fixed function is off. If you call SetVertexShader(NULL), then fixed-function is on again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this