We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5da3ed1 commit 8bc6a30Copy full SHA for 8bc6a30
src/mesh.cpp
@@ -42,8 +42,15 @@ inline static void applyShadeFactor(video::SColor& color, float factor)
42
43
void applyFacesShading(video::SColor &color, const v3f &normal)
44
{
45
- // Many special drawtypes have normals set to 0,0,0 and this
46
- // must result in maximum brightness (no face shadng).
+ /*
+ Some drawtypes have normals set to (0, 0, 0), this must result in
47
+ maximum brightness: shade factor 1.0.
48
+ Shade factors for aligned cube faces are:
49
+ +Y 1.000000 sqrt(1.0)
50
+ -Y 0.447213 sqrt(0.2)
51
+ +-X 0.670820 sqrt(0.45)
52
+ +-Z 0.836660 sqrt(0.7)
53
+ */
54
float x2 = normal.X * normal.X;
55
float y2 = normal.Y * normal.Y;
56
float z2 = normal.Z * normal.Z;
0 commit comments