Skip to content

Commit

Permalink
Reduce some differences between RGL and R3-R4
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Feb 15, 2018
1 parent 9677d8a commit f37143d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
16 changes: 11 additions & 5 deletions src/Layers/xrRenderPC_GL/rgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class CRender : public D3DXRenderBase
u32 ssao_half_data : 1;
u32 ssao_hbao : 1;
u32 ssao_hdao : 1;
u32 ssao_ultra : 1;
u32 hbao_vectorized : 1;

u32 smapsize : 16;
Expand Down Expand Up @@ -98,6 +99,8 @@ class CRender : public D3DXRenderBase
u32 dx10_minmax_sm : 2;
u32 dx10_minmax_sm_screenarea_threshold;

u32 dx11_enable_tessellation : 1;

u32 forcegloss : 1;
u32 forceskinw : 1;
float forcegloss_v;
Expand Down Expand Up @@ -220,7 +223,6 @@ class CRender : public D3DXRenderBase
void init_cacades();
void render_sun_cascades();

public:
ShaderElement* rimp_select_sh_static(dxRender_Visual* pVisual, float cdist_sq);
ShaderElement* rimp_select_sh_dynamic(dxRender_Visual* pVisual, float cdist_sq);
D3DVERTEXELEMENT9* getVB_Format(int id, BOOL _alt = FALSE);
Expand All @@ -240,8 +242,10 @@ class CRender : public D3DXRenderBase

ICF void apply_object(IRenderable* O)
{
if (nullptr == O) return;
if (nullptr == O->renderable_ROS()) return;
if (nullptr == O)
return;
if (nullptr == O->renderable_ROS())
return;
CROS_impl& LT = *(CROS_impl*)O->renderable_ROS();
LT.update_smooth(O);
o_hemi = 0.75f * LT.get_hemi();
Expand All @@ -253,14 +257,16 @@ class CRender : public D3DXRenderBase
void apply_lmaterial()
{
R_constant* C = &*RCache.get_c(c_sbase); // get sampler
if (nullptr == C) return;
if (nullptr == C)
return;
VERIFY (RC_dest_sampler == C->destination);
VERIFY (RC_sampler == C->type);
CTexture* T = RCache.get_ActiveTexture(u32(C->samp.index));
VERIFY (T);
float mtl = T->m_material;
#ifdef DEBUG
if (ps_r2_ls_flags.test(R2FLAG_GLOBALMATERIAL)) mtl=ps_r2_gmaterial;
if (ps_r2_ls_flags.test(R2FLAG_GLOBALMATERIAL))
mtl=ps_r2_gmaterial;
#endif
RCache.hemi.set_material(o_hemi, o_sun, 0, (mtl + .5f) / 4.f);
RCache.hemi.set_pos_faces(o_hemi_cube[CROS_impl::CUBE_FACE_POS_X],
Expand Down
18 changes: 10 additions & 8 deletions src/Layers/xrRenderPC_R3/r3.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ class CRender : public D3DXRenderBase

ICF void apply_object(IRenderable* O)
{
if (0 == O)
if (nullptr == O)
return;
if (0 == O->renderable_ROS())
if (nullptr == O->renderable_ROS())
return;
CROS_impl& LT = *((CROS_impl*)O->renderable_ROS());
CROS_impl& LT = *(CROS_impl*)O->renderable_ROS();
LT.update_smooth(O);
o_hemi = 0.75f * LT.get_hemi();
// o_hemi = 0.5f*LT.get_hemi () ;
Expand All @@ -249,7 +249,7 @@ class CRender : public D3DXRenderBase
void apply_lmaterial()
{
R_constant* C = &*RCache.get_c(c_sbase); // get sampler
if (0 == C)
if (nullptr == C)
return;
VERIFY(RC_dest_sampler == C->destination);
VERIFY(RC_dx10texture == C->type);
Expand All @@ -261,10 +261,12 @@ class CRender : public D3DXRenderBase
mtl = ps_r2_gmaterial;
#endif
RCache.hemi.set_material(o_hemi, o_sun, 0, (mtl + .5f) / 4.f);
RCache.hemi.set_pos_faces(o_hemi_cube[CROS_impl::CUBE_FACE_POS_X], o_hemi_cube[CROS_impl::CUBE_FACE_POS_Y],
o_hemi_cube[CROS_impl::CUBE_FACE_POS_Z]);
RCache.hemi.set_neg_faces(o_hemi_cube[CROS_impl::CUBE_FACE_NEG_X], o_hemi_cube[CROS_impl::CUBE_FACE_NEG_Y],
o_hemi_cube[CROS_impl::CUBE_FACE_NEG_Z]);
RCache.hemi.set_pos_faces(o_hemi_cube[CROS_impl::CUBE_FACE_POS_X],
o_hemi_cube[CROS_impl::CUBE_FACE_POS_Y],
o_hemi_cube[CROS_impl::CUBE_FACE_POS_Z]);
RCache.hemi.set_neg_faces(o_hemi_cube[CROS_impl::CUBE_FACE_NEG_X],
o_hemi_cube[CROS_impl::CUBE_FACE_NEG_Y],
o_hemi_cube[CROS_impl::CUBE_FACE_NEG_Z]);
}

// feature level
Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRenderPC_R4/r4.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class CRender : public D3DXRenderBase
u32 forceskinw : 1;
float forcegloss_v;
} o;

struct RenderR4Statistics
{
u32 l_total;
Expand Down

0 comments on commit f37143d

Please sign in to comment.