mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 16:07:45 +00:00
- initial work on textured dynamic light processing.
This commit is contained in:
parent
8817f89192
commit
ec7b4b1ba4
3 changed files with 20 additions and 10 deletions
|
@ -556,7 +556,6 @@ void GLWall::RenderFogBoundaryCompat()
|
||||||
|
|
||||||
void FGLRenderer::RenderMultipassStuff()
|
void FGLRenderer::RenderMultipassStuff()
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
// First pass: empty background with sector light only
|
// First pass: empty background with sector light only
|
||||||
|
|
||||||
// Part 1: solid geometry. This is set up so that there are no transparent parts
|
// Part 1: solid geometry. This is set up so that there are no transparent parts
|
||||||
|
@ -565,25 +564,28 @@ void FGLRenderer::RenderMultipassStuff()
|
||||||
gl_RenderState.EnableTexture(false);
|
gl_RenderState.EnableTexture(false);
|
||||||
gl_RenderState.EnableBrightmap(false);
|
gl_RenderState.EnableBrightmap(false);
|
||||||
gl_RenderState.Apply();
|
gl_RenderState.Apply();
|
||||||
gl_drawinfo->dldrawlists[GLLDL_WALLS_PLAIN].DrawWalls(GLPASS_BASE);
|
gl_drawinfo->dldrawlists[GLLDL_WALLS_PLAIN].DrawWalls(GLPASS_PLAIN);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_FLATS_PLAIN].DrawFlats(GLPASS_BASE);
|
gl_drawinfo->dldrawlists[GLLDL_FLATS_PLAIN].DrawFlats(GLPASS_PLAIN);
|
||||||
|
|
||||||
// Part 2: masked geometry. This is set up so that only pixels with alpha>0.5 will show
|
// Part 2: masked geometry. This is set up so that only pixels with alpha>0.5 will show
|
||||||
// This creates a blank surface that only fills the nontransparent parts of the texture
|
// This creates a blank surface that only fills the nontransparent parts of the texture
|
||||||
gl_RenderState.EnableTexture(true);
|
gl_RenderState.EnableTexture(true);
|
||||||
gl_RenderState.SetTextureMode(TM_MASK);
|
gl_RenderState.SetTextureMode(TM_MASK);
|
||||||
gl_RenderState.EnableBrightmap(true);
|
gl_RenderState.EnableBrightmap(true);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_WALLS_BRIGHT].DrawWalls(GLPASS_BASE_MASKED);
|
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_threshold);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_WALLS_MASKED].DrawWalls(GLPASS_BASE_MASKED);
|
gl_drawinfo->dldrawlists[GLLDL_WALLS_BRIGHT].DrawWalls(GLPASS_PLAIN);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_FLATS_BRIGHT].DrawFlats(GLPASS_BASE_MASKED);
|
gl_drawinfo->dldrawlists[GLLDL_WALLS_MASKED].DrawWalls(GLPASS_PLAIN);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_FLATS_MASKED].DrawFlats(GLPASS_BASE_MASKED);
|
gl_drawinfo->dldrawlists[GLLDL_FLATS_BRIGHT].DrawFlats(GLPASS_PLAIN);
|
||||||
|
gl_drawinfo->dldrawlists[GLLDL_FLATS_MASKED].DrawFlats(GLPASS_PLAIN);
|
||||||
|
|
||||||
// Part 3: The base of fogged surfaces, including the texture
|
// Part 3: The base of fogged surfaces, including the texture
|
||||||
gl_RenderState.EnableBrightmap(false);
|
gl_RenderState.EnableBrightmap(false);
|
||||||
gl_RenderState.SetTextureMode(TM_MODULATE);
|
gl_RenderState.SetTextureMode(TM_MODULATE);
|
||||||
|
gl_RenderState.AlphaFunc(GL_GEQUAL, 0);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_WALLS_FOG].DrawWalls(GLPASS_PLAIN);
|
gl_drawinfo->dldrawlists[GLLDL_WALLS_FOG].DrawWalls(GLPASS_PLAIN);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_WALLS_FOGMASKED].DrawWalls(GLPASS_PLAIN);
|
|
||||||
gl_drawinfo->dldrawlists[GLLDL_FLATS_FOG].DrawFlats(GLPASS_PLAIN);
|
gl_drawinfo->dldrawlists[GLLDL_FLATS_FOG].DrawFlats(GLPASS_PLAIN);
|
||||||
|
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_threshold);
|
||||||
|
gl_drawinfo->dldrawlists[GLLDL_WALLS_FOGMASKED].DrawWalls(GLPASS_PLAIN);
|
||||||
gl_drawinfo->dldrawlists[GLLDL_FLATS_FOGMASKED].DrawFlats(GLPASS_PLAIN);
|
gl_drawinfo->dldrawlists[GLLDL_FLATS_FOGMASKED].DrawFlats(GLPASS_PLAIN);
|
||||||
|
|
||||||
// second pass: draw lights
|
// second pass: draw lights
|
||||||
|
@ -638,5 +640,12 @@ void FGLRenderer::RenderMultipassStuff()
|
||||||
gl_drawinfo->dldrawlists[GLLDL_FLATS_FOGMASKED].DrawFlats(GLPASS_LIGHTTEX_ADDITIVE);
|
gl_drawinfo->dldrawlists[GLLDL_FLATS_FOGMASKED].DrawFlats(GLPASS_LIGHTTEX_ADDITIVE);
|
||||||
}
|
}
|
||||||
else gl_lights = false;
|
else gl_lights = false;
|
||||||
|
|
||||||
|
glDepthFunc(GL_LESS);
|
||||||
|
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
||||||
|
gl_RenderState.EnableFog(true);
|
||||||
|
gl_RenderState.BlendFunc(GL_ONE, GL_ZERO);
|
||||||
|
glDepthMask(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ FGLRenderer::FGLRenderer(OpenGLFrameBuffer *fb)
|
||||||
mSkyVBO = NULL;
|
mSkyVBO = NULL;
|
||||||
gl_spriteindex = 0;
|
gl_spriteindex = 0;
|
||||||
mShaderManager = NULL;
|
mShaderManager = NULL;
|
||||||
glpart2 = glpart = mirrortexture = NULL;
|
gllight = glpart2 = glpart = mirrortexture = NULL;
|
||||||
mLights = NULL;
|
mLights = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ void FGLRenderer::Initialize()
|
||||||
}
|
}
|
||||||
else mVAOID = 0;
|
else mVAOID = 0;
|
||||||
|
|
||||||
|
gllight = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/gllight.png"), FTexture::TEX_MiscPatch);
|
||||||
glpart2 = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart2.png"), FTexture::TEX_MiscPatch);
|
glpart2 = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart2.png"), FTexture::TEX_MiscPatch);
|
||||||
glpart = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart.png"), FTexture::TEX_MiscPatch);
|
glpart = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart.png"), FTexture::TEX_MiscPatch);
|
||||||
mirrortexture = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/mirror.png"), FTexture::TEX_MiscPatch);
|
mirrortexture = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/mirror.png"), FTexture::TEX_MiscPatch);
|
||||||
|
|
|
@ -142,7 +142,7 @@ void GLWall::PutWall(bool translucent)
|
||||||
if (gl.lightmethod == LM_SOFTWARE && !translucent)
|
if (gl.lightmethod == LM_SOFTWARE && !translucent)
|
||||||
{
|
{
|
||||||
// This is not yet ready.
|
// This is not yet ready.
|
||||||
//if (PutWallCompat(passflag[type])) return;
|
if (PutWallCompat(passflag[type])) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool masked;
|
bool masked;
|
||||||
|
|
Loading…
Reference in a new issue