mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 12:24:01 +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();
|
||||
|
||||
// store the color directly
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_FrontColor = vec4(gl_Color.rgb, 0.0);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ void DeferredLightingEffect::render() {
|
|||
const int VIEWPORT_WIDTH_INDEX = 2;
|
||||
float sMin = viewport[VIEWPORT_X_INDEX] / (float)primaryFBO->width();
|
||||
float sWidth = viewport[VIEWPORT_WIDTH_INDEX] / (float)primaryFBO->width();
|
||||
|
||||
|
||||
if (Menu::getInstance()->getShadowsEnabled()) {
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_2D, Application::getInstance()->getTextureCache()->getPrimaryDepthTextureID());
|
||||
|
|
|
@ -1392,8 +1392,11 @@ void VoxelSystem::render() {
|
|||
|
||||
applyScaleAndBindProgram(texture);
|
||||
|
||||
// for performance, enable backface culling
|
||||
// for performance, enable backface culling and disable blending
|
||||
glEnable(GL_CULL_FACE);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
// draw voxels in 6 passes
|
||||
|
@ -1435,6 +1438,7 @@ void VoxelSystem::render() {
|
|||
PerformanceWarning warn(showWarnings, "render().. cleanup after glDrawRangeElementsEXT()...");
|
||||
|
||||
glDisable(GL_CULL_FACE);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
removeScaleAndReleaseProgram(texture);
|
||||
|
||||
|
|
Loading…
Reference in a new issue