Skip to content

Commit 1dd6b40

Browse files
I-AmDeadxrSimpAI
authored andcommitted
Hud mode for light
1 parent 2491112 commit 1dd6b40

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

ogsr_engine/Layers/xrRenderPC_R4/r4_rendertarget_accum_point.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ void CRenderTarget::accum_point(light* L)
1313
shader_msaa = s_accum_point_msaa;
1414
}
1515

16+
Fmatrix Pold = Fidentity;
17+
Fmatrix FTold = Fidentity;
18+
19+
if (L->flags.bHudMode)
20+
{
21+
extern ENGINE_API float psHUD_FOV;
22+
Pold = Device.mProject;
23+
FTold = Device.mFullTransform;
24+
Device.mProject.build_projection(deg2rad(psHUD_FOV <= 1.f ? psHUD_FOV * Device.fFOV : psHUD_FOV), Device.fASPECT, HUD_VIEWPORT_NEAR,
25+
g_pGamePersistent->Environment().CurrentEnv->far_plane);
26+
Device.mFullTransform.mul(Device.mProject, Device.mView);
27+
RCache.set_xform_project(Device.mProject);
28+
RImplementation.rmNear();
29+
}
30+
1631
// Common
1732
Fvector L_pos;
1833
float L_spec;
@@ -202,4 +217,13 @@ void CRenderTarget::accum_point(light* L)
202217
increment_light_marker();
203218

204219
u_DBT_disable();
220+
221+
if (L->flags.bHudMode)
222+
{
223+
RImplementation.rmNormal();
224+
// Restore projection
225+
Device.mProject = Pold;
226+
Device.mFullTransform = FTold;
227+
RCache.set_xform_project(Device.mProject);
228+
}
205229
}

0 commit comments

Comments
 (0)