mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 20:20:54 +00:00
- fixed the biggest issues with flat rendering
This commit is contained in:
parent
7dd5b508c8
commit
9406e6d2ad
2 changed files with 4 additions and 17 deletions
|
@ -194,7 +194,7 @@ void HWFlat::MakeVertices()
|
||||||
auto vp = ret.first;
|
auto vp = ret.first;
|
||||||
for (auto i : indices)
|
for (auto i : indices)
|
||||||
{
|
{
|
||||||
auto& pt = points[indices[i]];
|
auto& pt = points[i];
|
||||||
vp->SetVertex(pt.X, pt.Z, pt.Y);
|
vp->SetVertex(pt.X, pt.Z, pt.Y);
|
||||||
vp->SetTexCoord(pt.X / 64.f, pt.Y / 64.f); // todo: align
|
vp->SetTexCoord(pt.X / 64.f, pt.Y / 64.f); // todo: align
|
||||||
vp++;
|
vp++;
|
||||||
|
@ -253,15 +253,13 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
||||||
if (!texture->GetTranslucency()) state.AlphaFunc(Alpha_GEqual, gl_mask_threshold);
|
if (!texture->GetTranslucency()) state.AlphaFunc(Alpha_GEqual, gl_mask_threshold);
|
||||||
else state.AlphaFunc(Alpha_GEqual, 0.f);
|
else state.AlphaFunc(Alpha_GEqual, 0.f);
|
||||||
}
|
}
|
||||||
state.SetMaterial(texture, UF_Texture, 0, CLAMP_NONE, 0, -1);
|
state.SetMaterial(texture, UF_Texture, 0, 0/*flags & 3*/, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
|
||||||
|
|
||||||
state.SetLightIndex(dynlightindex);
|
state.SetLightIndex(dynlightindex);
|
||||||
state.Draw(DT_Triangles, vertindex, vertcount);
|
state.Draw(DT_Triangles, vertindex, vertcount);
|
||||||
vertexcount += vertcount;
|
vertexcount += vertcount;
|
||||||
|
|
||||||
state.EnableTextureMatrix(false);
|
if (translucent) state.SetRenderStyle(DefaultRenderStyle());
|
||||||
|
|
||||||
state.SetRenderStyle(DefaultRenderStyle());
|
|
||||||
//state.SetObjectColor(0xffffffff);
|
//state.SetObjectColor(0xffffffff);
|
||||||
//state.SetAddColor(0);
|
//state.SetAddColor(0);
|
||||||
//state.ApplyTextureManipulation(nullptr);
|
//state.ApplyTextureManipulation(nullptr);
|
||||||
|
@ -314,7 +312,7 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sectortype * frontsector, int which)
|
||||||
const auto &vp = di->Viewpoint;
|
const auto &vp = di->Viewpoint;
|
||||||
|
|
||||||
float florz, ceilz;
|
float florz, ceilz;
|
||||||
PlanesAtPoint(frontsector, vp.Pos.X, vp.Pos.Y, &ceilz, &florz);
|
PlanesAtPoint(frontsector, vp.Pos.X * 16.f, vp.Pos.Y * -16.f, &ceilz, &florz);
|
||||||
|
|
||||||
fade = lookups.getFade(frontsector->floorpal); // fog is per sector.
|
fade = lookups.getFade(frontsector->floorpal); // fog is per sector.
|
||||||
visibility = sectorVisibility(frontsector);
|
visibility = sectorVisibility(frontsector);
|
||||||
|
|
|
@ -176,17 +176,6 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
||||||
|
|
||||||
state.SetMaterial(texture, UF_Texture, 0, 0/*flags & 3*/, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
|
state.SetMaterial(texture, UF_Texture, 0, 0/*flags & 3*/, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
|
||||||
|
|
||||||
int32_t size = xs_CRoundToInt(texture->GetDisplayHeight());
|
|
||||||
int32_t size2;
|
|
||||||
for (size2 = 1; size2 < size; size2 += size2) {}
|
|
||||||
if (size == size2)
|
|
||||||
state.SetNpotEmulation(0.f, 0.f);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float xOffset = 1.f / texture->GetDisplayWidth();
|
|
||||||
state.SetNpotEmulation((1.f * size2) / size, xOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
float absalpha = fabsf(alpha);
|
float absalpha = fabsf(alpha);
|
||||||
|
|
||||||
// Fog must be done before the texture so that the texture selector can override it.
|
// Fog must be done before the texture so that the texture selector can override it.
|
||||||
|
|
Loading…
Reference in a new issue