Sign in to follow this  

Access FF Lights in a Shader?

This topic is 4199 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

Is there a way to access the FF Lights in a .fx file? In GLSL you can do something like gl_LightSource[0].diffuse Is there a similar call in HLSL? The reason im asking is ive done the pass in constant info to the shader.. float4(pos.x, pos.y, pos.z, range); float4(r, g, b, intensity); float4(dir.x, dir.y, dir.z, cone_I.cone_O); and then unpack it to form my light structure, but I was wondering if it is faster, if the card already has the ability to hold the (Diffuse,Theata.Phi) information, that I could just load those structures up before I hit the shader.

Share this post


Link to post
Share on other sites
No, not that I know of.

Modern hardware emulates the fixed function pipeline using shaders anyway, so the device driver will just be uploading those same constants anyway - there would be no savings in tapping into the FFP state. Besides, the fixed function pipeline is being phased out of Direct3D, so it's probably not worth wanting to rely on some detail of its implementation.

Share this post


Link to post
Share on other sites

This topic is 4199 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.

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