Skip to content

[rlgl] Remove forced normalization of normal vectors in rlNormal3f#5703

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
JeffM2501:rlgl_non_normal_normals
Mar 28, 2026
Merged

[rlgl] Remove forced normalization of normal vectors in rlNormal3f#5703
raysan5 merged 1 commit into
raysan5:masterfrom
JeffM2501:rlgl_non_normal_normals

Conversation

@JeffM2501
Copy link
Copy Markdown
Contributor

Remove forced normalization of normal vectors in rlNormal3f, assume the user has set the correct input for the shader. This allows users to use the batch system normals for special effects and custom lighting that may need to use a non unit magnitude.

…he user has set the correct input for the shader.
Comment thread src/rlgl.h
Comment on lines +1617 to +1626
/* Normalize the vector if required. Default behavior assumes the normal vector is in the correct space for what the shader expects.
float length = sqrtf(normalx * normalx + normaly * normaly + normalz * normalz);
if (length != 0.0f)
{
float ilength = 1.0f/length;
normalx *= ilength;
normaly *= ilength;
normalz *= ilength;
}
*/

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
@raysan5 raysan5 merged commit bb78e98 into raysan5:master Mar 28, 2026
16 checks passed
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Mar 28, 2026

@JeffM2501 thanks for the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants