- portal WIP

This commit is contained in:
Christoph Oelckers 2021-03-22 12:07:29 +01:00
parent cecfbb76e8
commit e884a418f8
9 changed files with 9 additions and 12 deletions

View file

@ -274,7 +274,7 @@ public:
mSpecialEffect = EFF_NONE;
mLightIndex = -1;
mStreamData.uInterpolationFactor = 0;
mRenderStyle = DefaultRenderStyle();
mRenderStyle = LegacyRenderStyles[STYLE_Translucent];
mMaterial.Reset();
mBias.Reset();
mPassType = NORMAL_PASS;

View file

@ -436,7 +436,7 @@ void FSkyVertexBuffer::RenderDome(FRenderState& state, FGameTexture* tex, float
//
//-----------------------------------------------------------------------------
void FSkyVertexBuffer::RenderBox(FRenderState& state, FTextureID texno, FSkyBox* tex, float x_offset, bool sky2, float stretch, const FVector3& skyrotatevector, const FVector3& skyrotatevector2)
void FSkyVertexBuffer::RenderBox(FRenderState& state, FSkyBox* tex, float x_offset, bool sky2, float stretch, const FVector3& skyrotatevector, const FVector3& skyrotatevector2)
{
int faces;

View file

@ -85,6 +85,6 @@ public:
void RenderRow(FRenderState& state, EDrawType prim, int row, bool apply = true);
void RenderDome(FRenderState& state, FGameTexture* tex, float x_offset, float y_offset, bool mirror, int mode, bool tiled);
void RenderBox(FRenderState& state, FTextureID texno, FSkyBox* tex, float x_offset, bool sky2, float stretch, const FVector3& skyrotatevector, const FVector3& skyrotatevector2);
void RenderBox(FRenderState& state, FSkyBox* tex, float x_offset, bool sky2, float stretch, const FVector3& skyrotatevector, const FVector3& skyrotatevector2);
};

View file

@ -421,7 +421,6 @@ void HWDrawInfo::RenderTranslucent(FRenderState &state)
void HWDrawInfo::RenderPortal(HWPortal *p, FRenderState &state, bool usestencil)
{
#if 0
auto gp = static_cast<HWPortal *>(p);
gp->SetupStencil(this, state, usestencil);
auto new_di = StartDrawInfo(this, Viewpoint, &VPUniforms);
@ -432,7 +431,6 @@ void HWDrawInfo::RenderPortal(HWPortal *p, FRenderState &state, bool usestencil)
state.SetVertexBuffer(screen->mVertexData);
screen->mViewpoints->Bind(state, vpIndex);
gp->RemoveStencil(this, state, usestencil);
#endif
}
//-----------------------------------------------------------------------------

View file

@ -170,7 +170,7 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
state.Draw(DT_Triangles, vertindex, vertcount);
vertexcount += vertcount;
if (translucent) state.SetRenderStyle(DefaultRenderStyle());
if (translucent) state.SetRenderStyle(LegacyRenderStyles[STYLE_Translucent]);
//state.SetObjectColor(0xffffffff);
//state.SetAddColor(0);
//state.ApplyTextureManipulation(nullptr);

View file

@ -20,11 +20,10 @@ enum
struct HWSkyInfo
{
float x_offset;
float y_offset; // doubleskies don't have a y-offset
float y_offset;
float y_scale;
int shade;
FGameTexture * texture;
FTextureID skytexno1;
PalEntry fadecolor;
bool operator==(const HWSkyInfo & inf)

View file

@ -66,7 +66,7 @@ void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane,
sky->y_offset = FixedToFloat(dapyoffs) + ypanning * (float)ti * (1.f / 256.f);
sky->x_offset = xpanning / (1 << (realskybits - dapskybits));
sky->fadecolor = FadeColor;
sky->shade = plane == plane_ceiling ? sector->ceilingshade : sector->floorshade;
sky->shade = 0;// clamp(plane == plane_ceiling ? sector->ceilingshade : sector->floorshade, 0, numshades - 1);
sky->texture = skytex;
}

View file

@ -54,7 +54,7 @@ void HWSkyPortal::DrawContents(HWDrawInfo *di, FRenderState &state)
auto skybox = origin->texture ? dynamic_cast<FSkyBox*>(origin->texture->GetTexture()) : nullptr;
if (skybox)
{
vertexBuffer->RenderBox(state, origin->skytexno1, skybox, origin->x_offset, false, /*di->Level->info->pixelstretch*/1, { 0, 0, 1 }, { 0, 0, 1 });
vertexBuffer->RenderBox(state, skybox, origin->x_offset, false, /*di->Level->info->pixelstretch*/1, { 0, 0, 1 }, { 0, 0, 1 });
}
else
{

View file

@ -870,7 +870,7 @@ void HWWall::DoMidTexture(HWDrawInfo* di, walltype* wal,
// todo: transparency.
DoTexture(di, wal, wal, refheight, topleft, topright, bottomleft, bottomright);
RenderStyle = STYLE_Normal;
RenderStyle = STYLE_Translucent;
alpha = 1.f;
}
@ -928,7 +928,7 @@ void HWWall::Process(HWDrawInfo *di, walltype *wal, sectortype* frontsector, sec
visibility = sectorVisibility(frontsector);
alpha = 1.0f;
RenderStyle = STYLE_Normal;
RenderStyle = STYLE_Translucent;
texture = NULL;
/*