Skip to content

Commit

Permalink
cleanup, info
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed Nov 22, 2024
1 parent e2aee5e commit f3fec09
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 40 deletions.
52 changes: 24 additions & 28 deletions src/common/AppGui_Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ void AppGui::AddHudGui(CompositorTargetDef* td) // + 2 pass
ps->setAllStoreActions( StoreAction::Store );
ps->mProfilingId = "HUD"; ps->mIdentifier = 10007;

ps->mFirstRQ = RQG_RoadMarkers; // 220
ps->mLastRQ = RQG_Hud3+1; // 223
ps->mFirstRQ = RQG_RoadMarkers;
ps->mLastRQ = RQG_Hud3+1;
ps->setVisibilityMask(RV_Hud + RV_Particles);

// 🎛️ Gui, add MyGUI pass --------
Expand Down Expand Up @@ -222,7 +222,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
if (split)
rtt = AddSplitRTT(si, width, height);

/* 0 s0_ssao Pre render -------------------- */
// 0 s0_ssao Pre render ------------------------------------------------------------
// own node, for more control of render RQG, no pipe glass, etc
// could be less Fps, renders more tris, but has no artifacts
// splitting render of pipe glass messed up depth of fluids
Expand Down Expand Up @@ -268,19 +268,15 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
// ps->lod_update_list off

ps->mProfilingId = "Pre Ssao-"+si; // Opaque only, no pipe glass
// ps->mIdentifier = 10001;
ps->mIdentifier = 10001; //?
ps->mFirstRQ = RQG_Sky+1; // no sky
ps->mLastRQ = RQG_Grass+1; // todo: add car glass, particles
// ps->mLastRQ = RQG_Weather+1;
// RQG_PipeGlass - RV_NoSSAO ..
// RQG_AlphaVegObj -
ps->mLastRQ = RQG_Grass+1;
ps->setVisibilityMask(
RV_Terrain | RV_Road |
RV_Vegetation | RV_VegetGrass |
RV_Objects | (refract ? 0 : RV_Fluid) |
RV_Car | RV_CarGlass // | RV_Particles
);
// RV_view); // -..
); // RV_view); //- hud?

ps->mGenNormalsGBuf = true;
// no shadows
Expand All @@ -292,7 +288,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
nd->mapOutputChannel(2, "gFog" );
}

/* 1 s1_First Render -------------------- */
// 1 s1_First Render ------------------------------------------------------------
{ nd = AddNode(s1_first+si); //++ node

if (ssao)
Expand Down Expand Up @@ -347,20 +343,18 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
ps->mStoreActionStencil = StoreAction::DontCare;
// ps->lod_update_list off //?

ps->mProfilingId = "Render First-"+si; // ⛰️ "Opaque + Regular Transparents"
ps->mProfilingId = "Render First-"+si; // ⛰️ Opaque only
ps->mIdentifier = 10001;
// ps->mFirstRQ = 1; //RQG_Terrain;
ps->mLastRQ = RQG_CarParticles; // before
// ps->mLastRQ = RQG_Weather+1;
// ps->mLastRQ = RQG_RoadBlend+1; //RQG_Fluid-1; //199
ps->setVisibilityMask(RV_view);

// ps->mExposedTextures.push_back("") mCubeReflTex // todo.. add

AddShadows(ps); // shadows
}

if (ssao) // SSAO + 4
if (ssao) // SSAO + 4 ----------------
{
const String depthCopy = "depthHalf";

Expand Down Expand Up @@ -419,7 +413,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
nd->mapOutputChannel(1, "depthBuffer");
}

/* 2 s2_depth resolve / copy depth ---------- */
// 2 s2_depth resolve / copy Depth ------------------------------
{ nd = AddNode(s2_depth+si); //++ node

nd->addTextureSourceName("gBufferDB", 0, inp); // >in
Expand Down Expand Up @@ -452,13 +446,14 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
{
auto* pq = AddQuad(td); // + quad
pq->setAllLoadActions( LoadAction::DontCare );
pq->setAllStoreActions( StoreAction::DontCare );
pq->mStoreActionColour[0] = StoreAction::StoreOrResolve;

pq->mMaterialName = "Ogre/Copy/1xFP32";
pq->mProfilingId = "depth copy";
pq->mMaterialName = "Ogre/Copy/1xFP32"; pq->mProfilingId = "Depth copy";
pq->addQuadTextureSource( 0, "gBufferDB" ); // input
}
/*else // need to copy, no fsaa, since we write and read from this copy
{
/*else
{ // bad_
auto* cp = static_cast<CompositorPassDepthCopyDef*>(
td->addPass(Ogre::PASS_DEPTHCOPY)); // + copy
cp->setDepthTextureCopy("gBufferDB", "resolvedDB");
Expand All @@ -469,7 +464,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
nd->mapOutputChannel(0, "resolvedDB");
}

/* 3 s3_Final 🪩 Final Refractive ------------------------------ */
// 3 s3_Final 🪩 Final Refractive ------------------------------------------------------------
{ nd = AddNode(s3_Final+si); //++ node

nd->addTextureSourceName("rtt_FullOut", 0, inp); // or rt_renderwindow
Expand Down Expand Up @@ -510,6 +505,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
ps->mFirstRQ = RQG_Fluid; ps->mLastRQ = RQG_Refract+1;
ps->setVisibilityMask(RV_Fluid); // 🌊

// ps->mEnableForwardPlus = 0; //?
AddShadows(ps); // shadows
ps->mShadowNodeRecalculation = SHADOW_NODE_REUSE; // `
ps->setUseRefractions("depthBufferNoMsaa", "rrt_firstIn"); // ~
Expand All @@ -523,15 +519,15 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he

ps->mProfilingId = "Particles"; ps->mIdentifier = 10001;
ps->mFirstRQ = RQG_CarParticles; ps->mLastRQ = RQG_Hud3+1; //RQG_Weather+1;
ps->setVisibilityMask(
// RV_view );
ps->setVisibilityMask( // RV_view );
RV_Hud3D[plr] | RV_Particles );

AddShadows(ps); // shadows
ps->mShadowNodeRecalculation = SHADOW_NODE_REUSE; // `
ps->mEnableForwardPlus = 0;
// AddShadows(ps); // no shadows
// ps->mShadowNodeRecalculation = SHADOW_NODE_REUSE; // `
}

// hdr ..
// hdr .. ----------------
if (hdr)
{
// todo: add
Expand All @@ -544,7 +540,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
auto* pq = AddQuad(td); // + quad
pq->setAllLoadActions( LoadAction::DontCare );

pq->mMaterialName = "Ogre/Copy/4xFP32";
pq->mMaterialName = "Ogre/Copy/4xFP32"; // needed? merge above
pq->mProfilingId = "Copy to Window";
pq->addQuadTextureSource( 0, "rtt_final" ); // input

Expand All @@ -554,7 +550,7 @@ TextureGpu* AppGui::CreateCompositor(int view, int splits, float width, float he
}
}

// workspace
// workspace ----------------
{
wd = AddWork( sWork+si );
wd->connectExternal( 0, s3_Final+si, 0 ); // rtt_FullOut or rt_renderwindow
Expand Down
29 changes: 18 additions & 11 deletions src/common/RenderConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#define rgDef ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME


// Render Queue Groups used in setRenderQueueGroup etc
//------------------------------------------------------------------------
/* Default, movables queue ID:
Decal 0
Light 0-5
Expand All @@ -20,24 +18,31 @@
200-224 FAST
225-255 V1_FAST
*/
// Render Queue Groups used in setRenderQueueGroup etc
//------------------------------------------------------------------------
const Ogre::uint8
RQ_7 = 70,
RQ_GlassV2 = 80,
RQ_GlassV1 = 105,
RQ_GlassV1 = 105, //105, 225
RQ_OVERLAY = 220, // 200

RQG_Sky = 5, // ⛅ sky
// ⛅ sky
RQG_Sky = 5, // ⛅ sky far, last?

// ⛰️🛣️ terrain, roads
RQG_Terrain = 11, // ⛰️ main terrain
RQG_Horizon1 = 12, // 🏔️ horiz after terrain, to skip most depth
RQG_Horizon2 = 13,

RQG_Road = RQ_7, // 🛣️ roads, rivers, walls
RQG_RoadBlend = RQ_7 +1, // road blend alpha segs
// end of opaques

RQG_Fluid = 210, // 🌊 water,mud etc, old no refract //RQ_7 +4
RQG_Refract = 211, // 🪩 refracted
// 🌊 fluids, refract
RQG_Fluid = RQ_7 +3, //210, // 🌊 water,mud etc, old no refract //RQ_7 +4
RQG_Refract = RQ_7 +4, //211, // 🪩 refracted

// 💎 glass, transparent
RQG_Grass = RQ_7 +5, // 🌿 veget grass
RQG_CarTrails = RQ_7 +6, // v1 trails after glass //RQ_GlassV1

Expand All @@ -47,16 +52,18 @@ const Ogre::uint8
RQG_CarGlass = RQ_GlassV2 +4, // 🚗
RQG_Ghost = RQ_GlassV2 +7, // markers, debug

RQG_CarParticles = RQ_GlassV1 +3, // v1 particles after trails
RQG_Weather = RQ_GlassV1 +5, // v1 particles rain etc
// 💭 particles, alpha
RQG_CarParticles = RQ_GlassV1 +3, // ⚫💭 v1 from wheels, after trails
RQG_Weather = RQ_GlassV1 +5, // 🌧️ v1 rain, clouds, smoke etc

RQG_RoadMarkers = RQ_OVERLAY, // ed -- ⏲️ Hud start
RQG_Hud1 = RQ_OVERLAY +1,
// ⏲️ Hud
RQG_RoadMarkers = RQ_OVERLAY, // ed
RQG_Hud1 = RQ_OVERLAY +1, // ⏲️ Hud start ----
RQG_Hud2 = RQ_OVERLAY +2,
RQG_Hud3 = RQ_OVERLAY +3;


// Visibility Flags used in setVisibility check same in SR3.compositor
// Visibility Flags used in setVisibility few same in SR3.compositor
//-----------------------------------------------------------------------------------
const Ogre::uint32
RV_Hud = 0x00002000, // ⏱️⏲️ hud in game has own pass
Expand Down
2 changes: 1 addition & 1 deletion src/road/Road_Rebuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,8 @@ void SplineRoad::createSeg_Meshes(

auto que =
refra ? RQG_Refract :
//IsTrail() ? RQG_RoadBlend /*: RQG_Hud1*/ : // ?
IsRiver() ? RQG_Fluid :
//IsTrail() ? RQG_RoadBlend /*: RQG_Hud1*/ : // ?
pipeGlass ? RQG_PipeGlass : RQG_Road;
it->setRenderQueueGroup(que);
if (it2) it2->setRenderQueueGroup(que);
Expand Down

0 comments on commit f3fec09

Please sign in to comment.