Jump to content
  • Advertisement
Sign in to follow this  
WOsborn

Access FF Lights in a Shader?

This topic is 4418 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!