Skip to content

Commit 29ded51

Browse files
committed
Update rlgl.h
1 parent bb78e98 commit 29ded51

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/rlgl.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,16 +1614,19 @@ void rlNormal3f(float x, float y, float z)
16141614
normalz = RLGL.State.transform.m2*x + RLGL.State.transform.m6*y + RLGL.State.transform.m10*z;
16151615
}
16161616

1617-
/* Normalize the vector if required. Default behavior assumes the normal vector is in the correct space for what the shader expects.
1618-
float length = sqrtf(normalx * normalx + normaly * normaly + normalz * normalz);
1617+
// NOTE: Default behavior assumes the normal vector is in the correct space for what the shader expects,
1618+
// it could be not normalized to 0.0f..1.0f, magnitud can be useed for some effects
1619+
/*
1620+
// WARNING: Vector normalization if required
1621+
float length = sqrtf(normalx*normalx + normaly*normaly + normalz*normalz);
16191622
if (length != 0.0f)
16201623
{
16211624
float ilength = 1.0f/length;
16221625
normalx *= ilength;
16231626
normaly *= ilength;
16241627
normalz *= ilength;
16251628
}
1626-
*/
1629+
*/
16271630
RLGL.State.normalx = normalx;
16281631
RLGL.State.normaly = normaly;
16291632
RLGL.State.normalz = normalz;

0 commit comments

Comments
 (0)