@@ -82,7 +82,7 @@ FboInfo shadowMapFB;
|
|
82
82
|
int shadowMapResolution = 1024;
|
83
83
|
int shadowMapClampMode = ClampMode::Edge;
|
84
84
|
bool shadowMapClampBorderShadowed = false;
|
85
|
-
bool usePolygonOffset =
|
85
|
+
bool usePolygonOffset = true;
|
86
86
|
bool useSoftFalloff = false;
|
87
87
|
bool useHardwarePCF = false;
|
88
88
|
float polygonOffset_factor = 2.0f;
|
@@ -375,9 +375,18 @@ void display(void)
|
|
375
375
|
glClearDepth(1.0);
|
376
376
|
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
377
377
|
|
378
|
+
if(usePolygonOffset)
|
379
|
+
{
|
380
|
+
glEnable(GL_POLYGON_OFFSET_FILL);
|
381
|
+
glPolygonOffset(polygonOffset_factor, polygonOffset_units);
|
382
|
+
}
|
378
383
|
|
379
384
|
drawScene(depthProgram, lightViewMatrix, lightProjMatrix, lightViewMatrix, lightProjMatrix);
|
380
385
|
|
386
|
+
if(usePolygonOffset)
|
387
|
+
{
|
388
|
+
glDisable(GL_POLYGON_OFFSET_FILL);
|
389
|
+
}
|
381
390
|
|
382
391
|
labhelper::Material& screen = landingpadModel->m_materials[8];
|
383
392
|
screen.m_emission_texture.gl_id = shadowMapFB.colorTextureTarget;
|