[Solved]issue with Directional Light

is anyone experienced this issue before?

float3 _frustumCorners[4];
DirVS_Out DirLight_VS(VS_In i)
DirVS_Out o = (DirVS_Out) 0;

o.position = i.position;
o.uv.xy = i.uv.xy;
o.frustumRay = GetFrustumRay(i.uv.xy);
return o;

i try to implement directional light in quad. in the pixel shader, i try to visualize it with “input.frustumRay.xyz” i found this. Is anyone experienced this before?

Really not sure what you are doing here.

What does GetFustrumRay method do?
Why are you using the uv coords of the quad with it?
How do you imagine this would work as a directional light??

Are you trying to write a deferred lighting system? If so, then I can probably help with that.

sorry for my bad explanation. yes, im trying to implement deferred lighting.Just trying out directional light with reconstruction depth in a quad.

OK, but your light direction should be in world, not screen space (uv) …

Again, if I get time, ill add a simple deferred lighting example to my samples repo :slight_smile:

here is the source that I referred to

OK, both those posts are quite in depth, the code snippet you show does not really relate to them, unless you want me to trawl through the posts until I find the bit you are trying to implement lol

Either way, ill try and find time to do a deferred lighting sample.

@Charles_Humphrey hi, i think i found the issue. is actually silly mistake my screenQuad is bit far away from my camera nearClip plane, we when i move the problem occurs. Just but my screenQuad Z position close to my nearClip and problem solved! Appreciate for your valuable time, thank you very much.

Cool, glad you sorted it. I am going to do a deferred lighting sample any way :slight_smile: thanks for the idea :slight_smile: