Archive 17/01/2023.

How to get light radius from within a shader?

urho3d_game_dev

Hi all,

I am writing my own shader, I would have in a scene hundreds of lights, which can be contained in a bounding boxes ( such as point lights ).

When the object is going to be rendered, I would like to know the radius of the light.

I could not see anything about it, and I check the file of “Uniforms.glsl”, nothing is mentioned about light radius.

Could you please give me some feedback about this.

Sinoid

cLightPosPS contains the inverse of the range in the W component, you’ll have to un-invert it yourself (1.0 / cLightPosPS.w).