mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
- fixed brightmaps again - hopefully for real this time.
The lighting model being used here is not really good for implementing render effect.
This commit is contained in:
parent
3be9deb070
commit
022c074ece
4 changed files with 10 additions and 6 deletions
|
@ -1162,7 +1162,6 @@ static void destroy_window_resources()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int globalShadeDiv;
|
|
||||||
void sdlayer_setvideomode_opengl(int y)
|
void sdlayer_setvideomode_opengl(int y)
|
||||||
{
|
{
|
||||||
glsurface_destroy();
|
glsurface_destroy();
|
||||||
|
@ -1171,8 +1170,6 @@ void sdlayer_setvideomode_opengl(int y)
|
||||||
GLInterface.Deinit();
|
GLInterface.Deinit();
|
||||||
GLInterface.Init(y);
|
GLInterface.Init(y);
|
||||||
GLInterface.InitGLState(4, glmultisample);
|
GLInterface.InitGLState(4, glmultisample);
|
||||||
// I have no idea how to get this info from the lookup tables. Fortunately it is consistent per game.
|
|
||||||
GLInterface.SetShadeDiv(globalShadeDiv);
|
|
||||||
|
|
||||||
GLInterface.mSamplers->SetTextureFilterMode(hw_texfilter, hw_anisotropy);
|
GLInterface.mSamplers->SetTextureFilterMode(hw_texfilter, hw_anisotropy);
|
||||||
|
|
||||||
|
|
|
@ -1128,6 +1128,9 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
|
||||||
m->texid[globalpal] = gloadtex(m->mytex, m->mytexx, m->mytexy, m->is8bit, globalpal);
|
m->texid[globalpal] = gloadtex(m->mytex, m->mytexx, m->mytexy, m->is8bit, globalpal);
|
||||||
|
|
||||||
GLInterface.BindTexture(0, m->texid[globalpal], -1);
|
GLInterface.BindTexture(0, m->texid[globalpal], -1);
|
||||||
|
GLInterface.UseBrightmaps(false);
|
||||||
|
GLInterface.UseGlowMapping(false);
|
||||||
|
GLInterface.UseDetailMapping(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto data = GLInterface.AllocVertices(m->qcnt * 4);
|
auto data = GLInterface.AllocVertices(m->qcnt * 4);
|
||||||
|
|
|
@ -288,7 +288,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UseBrightmaps(true);
|
UseBrightmaps(true);
|
||||||
BindTexture(5, mtex, sampler);
|
BindTexture(5, htex, sampler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,13 +196,17 @@ void main()
|
||||||
color.rgb *= detailColor.rgb;
|
color.rgb *= detailColor.rgb;
|
||||||
|
|
||||||
vec3 lightcolor = v_color.rgb;
|
vec3 lightcolor = v_color.rgb;
|
||||||
|
bool shadeIt = ((u_flags & RF_FogDisabled) == 0);
|
||||||
// The lighting model here does not really allow more than a simple on/off brightmap because anything more complex inteferes with the shade ramp... :(
|
// The lighting model here does not really allow more than a simple on/off brightmap because anything more complex inteferes with the shade ramp... :(
|
||||||
if ((u_flags & RF_Brightmapping) != 0)
|
if ((u_flags & RF_Brightmapping) != 0)
|
||||||
{
|
{
|
||||||
vec4 brightcolor = texture2D(s_brightmap, v_texCoord.xy);
|
vec4 brightcolor = texture2D(s_brightmap, v_texCoord.xy);
|
||||||
color.rgb *= clamp(brightcolor.rgb + v_color.rgb, 0.0, 1.0);
|
if (grayscale(brightcolor) > 0.5)
|
||||||
|
{
|
||||||
|
shadeIt = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ((u_flags & RF_FogDisabled) == 0)
|
if (shadeIt)
|
||||||
{
|
{
|
||||||
color.rgb *= lightcolor;
|
color.rgb *= lightcolor;
|
||||||
shade = clamp(shade * u_shadeDiv, 0.0, 1.0); // u_shadeDiv is really 1/shadeDiv.
|
shade = clamp(shade * u_shadeDiv, 0.0, 1.0); // u_shadeDiv is really 1/shadeDiv.
|
||||||
|
|
Loading…
Reference in a new issue