Open Indibulous opened 2 months ago
Just thought i should add, I initially only tested this in the GLSL/GLSLES shader language, which produces the behaviour described, but after testing in HLSL, found that the mentioned uniforms will just throw an error upon using shader_set()
with the shader containing them:
I have created a new issue for this: https://github.com/YoYoGames/GameMaker-Bugs/issues/6840
Description
as mentioned in https://github.com/YoYoGames/GameMaker-Bugs/issues/6425 a number of uniforms listed on the Shader Constants manual page currently don't appear to work when accessed inside a custom shader. The
gm_Lights_Direction
,gm_Lights_PosRange
,gm_Lights_Colour
, andgm_AmbientColour
uniforms, aside from having incorrect syntax highlighting as indicated in that issue, also seem to have some incorrect functionality:gm_Lights_Direction[] - Each vec4's w value seems to be always be 1, regardless of if the light has been enabled or disabled, despite the manual saying it should be 1 when the light is enabled, and 0 when disabled.
gm_Lights_PosRange[] - Each vec4's w value seems to always contain the light's range, regardless of if the light is enabled or disabled, despite the manual saying it should be 0 when disabled.
gm_Lights_Colour[] - Doesn't seem to work at all, with every vec4 in the array having a value of (0, 0, 0, 0) regardless of what colours the lights have been set to.
gm_AmbientColour - Works correctly, however, the alpha value will always be 0 unless
draw_light_define_ambient()
is provided with a colour in $AABBGGRR format, despite the built-in lighting system not using alpha values for ambient light. Unsure whether this is unintended or undocumented behaviour.Here's an in-development version of the xUnit test framework which includes tests for these uniforms in the BasicShaderTestSuite: xUnit Shader Tests.zip
Expected Change
gm_Lights_Direction[]
uniform should be 1 when the corresponding light is enabled, and 0 when disabled.gm_Lights_PosRange[]
uniform should be 0 when disabled.gm_Lights_Colour[]
uniform should contain the colours of all defined lights.gm_AmbientColour
, it would be more intuative for the alpha value to be 1 whendraw_light_define_ambient()
is provided with a colour in $BBGGRR format, or at least the manual should document the behaviour of the alpha being 0 unless with $BBGGRR values.Steps To Reproduce
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.6.0 (Monthly), 2024.600 (Betas)
Which platform(s) are you seeing the problem on?
Windows
Contact Us Package Attached?
Sample Project Added?