Skip to content

Commit ce36942

Browse files
authored
Merge pull request #223 from RainbowZerg/xd_dev
Detail objects shadows.
2 parents c978c6b + e1e6db1 commit ce36942

File tree

17 files changed

+30
-19
lines changed

17 files changed

+30
-19
lines changed

src/Layers/xrRender/DetailManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ extern ECORE_API float r_ssaDISCARD;
239239

240240
void CDetailManager::UpdateVisibleM()
241241
{
242+
for (int i = 0; i != 3; ++i)
243+
for (auto& vis : m_visibles[i])
244+
vis.clear();
245+
242246
Fvector EYE = Device.vCameraPositionSaved;
243247

244248
CFrustum View;

src/Layers/xrRender/DetailManager_VS.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,6 @@ void CDetailManager::hw_Render_dump(ref_constant x_array, u32 var_id, u32 lod_id
334334
RCache.Render(D3DPT_TRIANGLELIST, vOffset, 0, dwCNT_verts, iOffset, dwCNT_prims);
335335
RCache.stat.r.s_details.add(dwCNT_verts);
336336
}
337-
// Clean up
338-
vis.clear();
339337
}
340338
vOffset += hw_BatchSize * Object.number_vertices;
341339
iOffset += hw_BatchSize * Object.number_indices;

src/Layers/xrRender/xrRender_console.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ void xrRender_initconsole()
710710

711711
//CMD4(CCC_Float, "r__detail_density", &ps_r__Detail_density, .05f, 0.99f);
712712
CMD4(CCC_Float, "r__detail_density", &ps_current_detail_density/*&ps_r__Detail_density*/, 0.04f, 0.6f); //AVO: extended from 0.2f to 0.04f and replaced variable
713+
CMD3(CCC_Mask, "r2_detail_shadow", &ps_r2_ls_flags, R2FLAG_DETAIL_SHADOW);
713714

714715
#ifdef DEBUG
715716
CMD4(CCC_Float, "r__detail_l_ambient", &ps_r__Detail_l_ambient, .5f, .95f);
@@ -786,7 +787,6 @@ void xrRender_initconsole()
786787
#endif // DEBUG
787788

788789
CMD3(CCC_Mask, "r2_sun", &ps_r2_ls_flags, R2FLAG_SUN);
789-
CMD3(CCC_Mask, "r2_sun_details", &ps_r2_ls_flags, R2FLAG_SUN_DETAILS);
790790
CMD3(CCC_Mask, "r2_sun_focus", &ps_r2_ls_flags, R2FLAG_SUN_FOCUS);
791791
//CMD3(CCC_Mask, "r2_sun_static", &ps_r2_ls_flags, R2FLAG_SUN_STATIC);
792792
//CMD3(CCC_Mask, "r2_exp_splitscene", &ps_r2_ls_flags, R2FLAG_EXP_SPLIT_SCENE);

src/Layers/xrRender/xrRender_console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ enum
143143
R2FLAG_SUN = (1 << 0),
144144
R2FLAG_SUN_FOCUS = (1 << 1),
145145
R2FLAG_SUN_TSM = (1 << 2),
146-
R2FLAG_SUN_DETAILS = (1 << 3),
146+
R2FLAG_DETAIL_SHADOW = (1 << 3),
147147
R2FLAG_TONEMAP = (1 << 4),
148148
R2FLAG_AA = (1 << 5),
149149
R2FLAG_GI = (1 << 6),

src/Layers/xrRenderDX10/dx10DetailManager_VS.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ void CDetailManager::hw_Render_dump(
229229
RCache.stat.r.s_details.add(dwCNT_verts);
230230
}
231231
}
232-
// Clean up
233-
vis.clear();
234232
}
235233
vOffset += hw_BatchSize * Object.number_vertices;
236234
iOffset += hw_BatchSize * Object.number_indices;

src/Layers/xrRenderGL/glDetailManager_VS.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ void CDetailManager::hw_Render_dump(const Fvector4& consts, const Fvector4& wave
219219
RCache.stat.r.s_details.add(dwCNT_verts);
220220
}
221221
}
222-
// Clean up
223-
vis.clear();
224222
}
225223
vOffset += hw_BatchSize * Object.number_vertices;
226224
iOffset += hw_BatchSize * Object.number_indices;

src/Layers/xrRenderPC_GL/r2_R_sun.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ void CRender::render_sun_near()
10251025
RCache.set_xform_view(Fidentity);
10261026
RCache.set_xform_project(fuckingsun->X.D.combine);
10271027
r_dsgraph_render_graph(0);
1028-
if (ps_r2_ls_flags.test(R2FLAG_SUN_DETAILS))
1028+
if (ps_r2_ls_flags.test(R2FLAG_DETAIL_SHADOW))
10291029
Details->Render();
10301030
fuckingsun->X.D.transluent = FALSE;
10311031
if (bSpecial)
@@ -1369,7 +1369,7 @@ void CRender::render_sun_cascade(u32 cascade_ind)
13691369
RCache.set_xform_view(Fidentity);
13701370
RCache.set_xform_project(fuckingsun->X.D.combine);
13711371
r_dsgraph_render_graph(0);
1372-
if (ps_r2_ls_flags.test(R2FLAG_SUN_DETAILS))
1372+
if (ps_r2_ls_flags.test(R2FLAG_DETAIL_SHADOW))
13731373
Details->Render();
13741374
fuckingsun->X.D.transluent = FALSE;
13751375
if (bSpecial)

src/Layers/xrRenderPC_GL/r3_R_rain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void CRender::render_rain()
254254
RCache.set_xform_view(Fidentity);
255255
RCache.set_xform_project(RainLight.X.D.combine);
256256
r_dsgraph_render_graph(0);
257-
//if (ps_r2_ls_flags.test(R2FLAG_SUN_DETAILS))
257+
//if (ps_r2_ls_flags.test(R2FLAG_DETAIL_SHADOW))
258258
// Details->Render () ;
259259
}
260260
}

src/Layers/xrRenderPC_R1/FStaticRender.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ void CRender::reset_end()
138138
if (L_Projector)
139139
L_Projector->invalidate();
140140

141+
// let's reload details while changed details options on vid_restart
142+
if (b_loaded && (dm_current_size != dm_size || ps_r__Detail_density != ps_current_detail_density))
143+
{
144+
Details = new CDetailManager();
145+
Details->Load();
146+
}
147+
141148
// Set this flag true to skip the first render frame,
142149
// that some data is not ready in the first frame (for example device camera position)
143150
m_bFirstFrameAfterReset = true;

src/Layers/xrRenderPC_R2/r2_R_lights.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ void CRender::render_lights(light_Package& LP)
118118
RCache.set_xform_view(L->X.S.view);
119119
RCache.set_xform_project(L->X.S.project);
120120
r_dsgraph_render_graph(0);
121+
if (ps_r2_ls_flags.test(R2FLAG_DETAIL_SHADOW))
122+
Details->Render();
121123
L->X.S.transluent = FALSE;
122124
if (bSpecial)
123125
{

0 commit comments

Comments
 (0)