- sky positioning tweaks.

It does not use the panning info of the wall and needs a texture height relative adjustment.
This commit is contained in:
Christoph Oelckers 2021-03-29 22:34:46 +02:00
parent 92bb9c5319
commit 6fcb6fa1d5
2 changed files with 3 additions and 8 deletions

View file

@ -42,8 +42,6 @@ FGameTexture* GetSkyTexture(int basetile, int lognumtiles, const int16_t* tilema
void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane, PalEntry FadeColor)
{
int picnum = plane == plane_ceiling ? sector->ceilingpicnum : sector->floorpicnum;
float xpanning = plane == plane_ceiling ? sector->ceilingxpan_ : sector->floorxpan_;
float ypanning = plane == plane_ceiling ? sector->ceilingypan_ : sector->floorypan_;
int32_t dapyscale = 0, dapskybits = 0, dapyoffs = 0, daptileyscale = 0;
FGameTexture* skytex = nullptr;
@ -58,13 +56,10 @@ void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane,
else skytex = tileGetTexture(picnum);
}
float t = (float)((1 << (sizeToBits(tileWidth(picnum)))) << dapskybits);
int ti = (1 << (sizeToBits(tileHeight(picnum)))); if (ti != tileHeight(picnum)) ti += ti;
// dapyscale is not relvant for a sky dome.
sky->y_scale = FixedToFloat(daptileyscale);
sky->y_offset = dapyoffs*2 + (ypanning * ti / 64.f);
sky->x_offset = xpanning / (1 << (realskybits - dapskybits));
sky->y_offset = dapyoffs*2;
sky->x_offset = 0;// xpanning / (1 << (realskybits - dapskybits));
sky->fadecolor = FadeColor;
sky->shade = 0;// clamp(plane == plane_ceiling ? sector->ceilingshade : sector->floorshade, 0, numshades - 1);
sky->texture = skytex;

View file

@ -69,7 +69,7 @@ void HWSkyPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
modelMatrix.loadIdentity();
modelMatrix.rotate(-180.0f + origin->x_offset, 0.f, 1.f, 0.f);
modelMatrix.translate(0.f, (-40 + texskyoffset) * skyoffsetfactor, 0.f);
modelMatrix.translate(0.f, -40 + texskyoffset + (tex->GetTexelHeight() - 300) / 2 * skyoffsetfactor, 0.f);
//modelMatrix.scale(1.f, 0.8f * 1.17f, 1.f);
textureMatrix.loadIdentity();
textureMatrix.scale(-1.f, 0.5, 1.f);