Access to lights in HLSL

Started by
4 comments, last by Kapoef 14 years, 1 month ago
Hi I would like to know if it is possible to gain access to lights in HLSL code that were set using : d3dDevice->SetLight(0, &light ); d3dDevice->LightEnable(0, TRUE); Lets say this light was a point light and is one of many lights. How do I gain access to this light in HLSL code, I'm using a basic HLSL file to act just like the Fixed Function Pipeline. (I plan to change this later) If this is possible can someone please explain how? Thanks in advance.
Advertisement
It's not possible - you can't use fixed function lights with shaders.
DAMMIT

Now what do i do?

I guess i can use one *.fx file for all lighting and objects, or can't I?

Hi,

check the HLSL code by ATI which is simulating the fixed function pipeline :
link

They have implemented ffp style-lighting too.

Good luck!
You can also check out the HLSL lighting code I posted. It's a bit simpler to look at.

fourm post

I would like to thank all of you I'm sorta busy with other crap now but I will check out both links later today.

TY TY TY

I'll post again if I still can't figure it out. So I'll prolly rely on you guys again.

hehehe

This topic is closed to new replies.

Advertisement