Rendering related fixes:

- explicitly enable blending in the ProfileViewer (fixes display bug)
- adjust luminance map based shadows to look roughly the same as depth
texture
  shadows (minus self-shadows, obviously)
- default depth texture path will not touch TexParameters any longer

This was SVN commit r3511.
This commit is contained in:
prefect
2006-02-14 20:38:51 +00:00
parent e3c3ac920f
commit 1560a17dfb
4 changed files with 35 additions and 30 deletions
+8 -1
View File
@@ -232,6 +232,10 @@ void ShadowMapInternals::CreateTexture()
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, Width, Height, 0,
GL_DEPTH_COMPONENT, GL_FLOAT, buf);
delete[] buf;
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
}
else
{
@@ -438,7 +442,6 @@ void ShadowMap::RenderDebugDisplay()
g_Renderer.BindTexture(0, m->Texture);
if (m->UseDepthTexture)
{
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
}
glColor3f(1.0, 1.0, 1.0);
@@ -448,6 +451,10 @@ void ShadowMap::RenderDebugDisplay()
glTexCoord2f(1.0, 1.0); glVertex2f(0.2, 0.2);
glTexCoord2f(0.0, 1.0); glVertex2f(0.0, 0.2);
glEnd();
if (m->UseDepthTexture)
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
}
glEnable(GL_CULL_FACE);