eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz;\r
tsEyeVec = eyeVec * tbnMatrix;\r
\r
- vec4 color;\r
- float day = gl_Color.r;\r
- float night = gl_Color.g;\r
- float light_source = gl_Color.b;\r
-\r
- float rg = mix(night, day, dayNightRatio);\r
- rg += light_source * 2.5; // Make light sources brighter\r
- float b = rg;\r
-\r
- // Moonlight is blue\r
- b += (day - night) / 13.0;\r
- rg -= (day - night) / 23.0;\r
-\r
- // Emphase blue a bit in darker places\r
- // See C++ implementation in mapblock_mesh.cpp finalColorBlend()\r
- b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025);\r
-\r
- // Artificial light is yellow-ish\r
- // See C++ implementation in mapblock_mesh.cpp finalColorBlend()\r
- rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065);\r
-\r
- color.r = rg;\r
- color.g = rg;\r
- color.b = b;\r
-\r
- color.a = gl_Color.a;\r
- gl_FrontColor = gl_BackColor = clamp(color,0.0,1.0);\r
+ gl_FrontColor = gl_BackColor = gl_Color;\r
}\r
eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz;\r
tsEyeVec = eyeVec * tbnMatrix;\r
\r
- vec4 color;\r
- float day = gl_Color.r;\r
- float night = gl_Color.g;\r
- float light_source = gl_Color.b;\r
-\r
- float rg = mix(night, day, dayNightRatio);\r
- rg += light_source * 2.5; // Make light sources brighter\r
- float b = rg;\r
-\r
- // Moonlight is blue\r
- b += (day - night) / 13.0;\r
- rg -= (day - night) / 13.0;\r
-\r
- // Emphase blue a bit in darker places\r
- // See C++ implementation in mapblock_mesh.cpp finalColorBlend()\r
- b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025);\r
-\r
- // Artificial light is yellow-ish\r
- // See C++ implementation in mapblock_mesh.cpp finalColorBlend()\r
- rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065);\r
-\r
- color.r = rg;\r
- color.g = rg;\r
- color.b = b;\r
-\r
- color.a = gl_Color.a;\r
- gl_FrontColor = gl_BackColor = clamp(color,0.0,1.0);\r
+ gl_FrontColor = gl_BackColor = gl_Color;\r
}\r
applyFacesShading (vc, 0.836660);
}
}
- if(!enable_shaders)
- {
- // - Classic lighting (shaders handle this by themselves)
- // Set initial real color and store for later updates
- u8 day = vc.getRed();
- u8 night = vc.getGreen();
- finalColorBlend(vc, day, night, 1000);
- if(day != night)
- m_daynight_diffs[i][j] = std::make_pair(day, night);
- }
+ // - Classic lighting
+ // Set initial real color and store for later updates
+ u8 day = vc.getRed();
+ u8 night = vc.getGreen();
+ finalColorBlend(vc, day, night, 1000);
+ if(day != night)
+ m_daynight_diffs[i][j] = std::make_pair(day, night);
}
// Create material