mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-16 04:30:38 +00:00
- always draw floors opaque
This commit is contained in:
parent
22aad4999c
commit
ba397f5ca1
4 changed files with 11 additions and 1 deletions
|
@ -433,6 +433,9 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
||||||
SetRenderStyleFromBlend((method & DAMETH_MASKPROPS) > DAMETH_MASK, drawpoly_blend, (method & DAMETH_MASKPROPS) == DAMETH_TRANS2);
|
SetRenderStyleFromBlend((method & DAMETH_MASKPROPS) > DAMETH_MASK, drawpoly_blend, (method & DAMETH_MASKPROPS) == DAMETH_TRANS2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(method & (DAMETH_WALL | DAMETH_CLAMPED | DAMETH_MASK)))
|
||||||
|
GLInterface.SetTextureMode(TM_OPAQUE);
|
||||||
|
|
||||||
float pc[4];
|
float pc[4];
|
||||||
|
|
||||||
// The shade rgb from the tint is ignored here.
|
// The shade rgb from the tint is ignored here.
|
||||||
|
@ -479,6 +482,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
||||||
|
|
||||||
GLInterface.SetTinting(-1, 0xffffff, 0xffffff);
|
GLInterface.SetTinting(-1, 0xffffff, 0xffffff);
|
||||||
GLInterface.SetNpotEmulation(0.f, 0.f);
|
GLInterface.SetNpotEmulation(0.f, 0.f);
|
||||||
|
GLInterface.SetTextureMode(TM_NORMAL);
|
||||||
|
|
||||||
if (skyzbufferhack && skyzbufferhack_pass == 0)
|
if (skyzbufferhack && skyzbufferhack_pass == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -575,7 +575,6 @@ void PolymostRenderState::Apply(FRenderState& state, GLState& oldState)
|
||||||
{
|
{
|
||||||
state.EnableDepthTest(StateFlags & STF_DEPTHTEST);
|
state.EnableDepthTest(StateFlags & STF_DEPTHTEST);
|
||||||
state.EnableMultisampling(StateFlags & STF_MULTISAMPLE);
|
state.EnableMultisampling(StateFlags & STF_MULTISAMPLE);
|
||||||
state.SetTextureMode((StateFlags & STF_BLEND) ? TM_OPAQUE : TM_NORMAL);
|
|
||||||
|
|
||||||
if ((StateFlags ^ oldState.Flags) & (STF_STENCILTEST | STF_STENCILWRITE))
|
if ((StateFlags ^ oldState.Flags) & (STF_STENCILTEST | STF_STENCILWRITE))
|
||||||
{
|
{
|
||||||
|
@ -641,6 +640,7 @@ void PolymostRenderState::Apply(FRenderState& state, GLState& oldState)
|
||||||
state.SetFog((Flags & RF_MapFog) ? PalEntry(0x999999) : FogColor, 21.f); // Fixme: The real density still needs to be implemented. 21 is a reasonable default only.
|
state.SetFog((Flags & RF_MapFog) ? PalEntry(0x999999) : FogColor, 21.f); // Fixme: The real density still needs to be implemented. 21 is a reasonable default only.
|
||||||
state.SetSoftLightLevel(ShadeDiv >= 1 / 1000.f ? 255 - Scale(Shade, 255, numshades) : 255);
|
state.SetSoftLightLevel(ShadeDiv >= 1 / 1000.f ? 255 - Scale(Shade, 255, numshades) : 255);
|
||||||
state.SetLightParms(VisFactor, ShadeDiv / (numshades - 2));
|
state.SetLightParms(VisFactor, ShadeDiv / (numshades - 2));
|
||||||
|
state.SetTextureMode(TextureMode);
|
||||||
|
|
||||||
state.SetNpotEmulation(NPOTEmulation.Y, NPOTEmulation.X);
|
state.SetNpotEmulation(NPOTEmulation.Y, NPOTEmulation.X);
|
||||||
state.AlphaFunc(Alpha_Greater, AlphaTest ? AlphaThreshold : -1.f);
|
state.AlphaFunc(Alpha_Greater, AlphaTest ? AlphaThreshold : -1.f);
|
||||||
|
|
|
@ -146,6 +146,11 @@ public:
|
||||||
|
|
||||||
void ReadPixels(int w, int h, uint8_t* buffer);
|
void ReadPixels(int w, int h, uint8_t* buffer);
|
||||||
|
|
||||||
|
void SetTextureMode(int m)
|
||||||
|
{
|
||||||
|
renderState.TextureMode = m;
|
||||||
|
}
|
||||||
|
|
||||||
void SetDepthBias(float a, float b)
|
void SetDepthBias(float a, float b)
|
||||||
{
|
{
|
||||||
renderState.mBias.mFactor = a;
|
renderState.mBias.mFactor = a;
|
||||||
|
|
|
@ -53,6 +53,7 @@ struct PolymostRenderState
|
||||||
float ShadeDiv = 62.f;
|
float ShadeDiv = 62.f;
|
||||||
float VisFactor = 128.f;
|
float VisFactor = 128.f;
|
||||||
int Flags = 0;
|
int Flags = 0;
|
||||||
|
int TextureMode = TM_NORMAL;
|
||||||
FVector2 NPOTEmulation = { 0.f, 0.f };
|
FVector2 NPOTEmulation = { 0.f, 0.f };
|
||||||
float AlphaThreshold = 0.5f;
|
float AlphaThreshold = 0.5f;
|
||||||
bool AlphaTest = true;
|
bool AlphaTest = true;
|
||||||
|
|
Loading…
Reference in a new issue