Shaders Built-in lighting functions

Bart

WiseBart
Hi all.

The manual has a chapter on lighting.
It has a couple of functions like draw_light_define_ambient, draw_light_define_point, draw_light_define_direction, ...

I can access gm_LightingEnabled, MAX_VS_LIGHTS, gm_LightingEnabled and a couple of other variables in the shader. But there doesn't seem to be a way to get the actual lights' data.

Is there a way to access these lights that I define or is it better to just send in the light data using custom uniforms?
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
if you make a shader with some distinctively-named variable, compile the game, and then open your data.win with a hex editor, you can use search to locate your shader in the binary, and then scroll back to see the rest of the built-in shader "stub" with its various variables
 

Bart

WiseBart
Hm yes, I see it now.

I had a look at the content of data.win and found quite a few variable names there: gm_Lights_Colour, gm_Lights_Direction, gm_AmbientColour, ...
So the names are there, but there seems to be no way to actually use them in a shader.
And it doesn't seem to work with the default shader either.

Then I guess I'll have to define my own uniforms for the lighting.

Thanks for the hint!
 
Top