History

Some tricks to avoid shadow artifacts: render back faces to shadow buffer, use polygon offset.

Andrzej Kapolka committed 12 years ago

Commit 70ab33b1 parent d63374f2 files · +12 −0Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+5−0
@@ -2325,10 +2325,15 @@ void Application::updateShadowMap() { · 2324 unmodified lines
23252325 // store view matrix without translation, which we'll use for precision-sensitive objects
23262326 updateUntranslatedViewMatrix();
23272327
2328+ glEnable(GL_POLYGON_OFFSET_FILL);
2329+ glPolygonOffset(1.1f, 4.0f);
2330+
23282331 _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE);
23292332 _particles.render(OctreeRenderer::SHADOW_RENDER_MODE);
23302333 _models.render(OctreeRenderer::SHADOW_RENDER_MODE);
23312334
2335+ glDisable(GL_POLYGON_OFFSET_FILL);
2336+
23322337 glPopMatrix();
23332338
23342339 glMatrixMode(GL_PROJECTION);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t