mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-06 16:38:35 +02:00
Fix for deferred lighting on voxels.
This commit is contained in:
parent
76728e4fb1
commit
f954e4d7ea
3 changed files with 7 additions and 3 deletions
|
@ -22,5 +22,5 @@ void main(void) {
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
|
|
||||||
// store the color directly
|
// store the color directly
|
||||||
gl_FrontColor = gl_Color;
|
gl_FrontColor = vec4(gl_Color.rgb, 0.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1392,8 +1392,11 @@ void VoxelSystem::render() {
|
||||||
|
|
||||||
applyScaleAndBindProgram(texture);
|
applyScaleAndBindProgram(texture);
|
||||||
|
|
||||||
// for performance, enable backface culling
|
// for performance, enable backface culling and disable blending
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
|
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw voxels in 6 passes
|
// draw voxels in 6 passes
|
||||||
|
@ -1435,6 +1438,7 @@ void VoxelSystem::render() {
|
||||||
PerformanceWarning warn(showWarnings, "render().. cleanup after glDrawRangeElementsEXT()...");
|
PerformanceWarning warn(showWarnings, "render().. cleanup after glDrawRangeElementsEXT()...");
|
||||||
|
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
removeScaleAndReleaseProgram(texture);
|
removeScaleAndReleaseProgram(texture);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue