Skip to content

Commit

Permalink
xrRenderPC_GL: Update blenders to R3 generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 24, 2015
1 parent 37182d8 commit 8cbae00
Show file tree
Hide file tree
Showing 26 changed files with 1,843 additions and 206 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/uber_deffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void uber_deffer (CBlender_Compile& C, bool hq, LPCSTR _vspec, LPCSTR _pspec, BO
}

// Uber-construct
#if defined(USE_DX10) || defined(USE_DX11)
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
# ifdef USE_DX11
if (bump && hq && RImplementation.o.dx11_enable_tessellation && C.TessMethod!=0)
{
Expand Down
113 changes: 103 additions & 10 deletions src/Layers/xrRenderPC_GL/blender_bloom_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,122 @@ void CBlender_bloom_build::Compile (CBlender_Compile& C)
switch (C.iElement)
{
case 0: // transfer into bloom-target
C.r_Pass ("stub_notransform_build", "bloom_build", FALSE, FALSE, FALSE, FALSE, D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA);
C.r_Sampler_clf ("s_image", r2_RT_generic1);
C.r_Pass ("stub_notransform_build","bloom_build", FALSE, FALSE, FALSE, FALSE, D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA);
//C.r_Sampler_clf ("s_image", r2_RT_generic1);
C.r_dx10Texture ("s_image", r2_RT_generic1);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 1: // X-filter
C.r_Pass ("stub_notransform_filter", "bloom_filter", FALSE, FALSE, FALSE);
C.r_Sampler_clf ("s_bloom", r2_RT_bloom1);
C.r_Pass ("stub_notransform_filter","bloom_filter", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom1);
C.r_dx10Texture ("s_bloom", r2_RT_bloom1);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 2: // Y-filter
C.r_Pass ("stub_notransform_filter", "bloom_filter", FALSE, FALSE, FALSE);
C.r_Sampler_clf ("s_bloom", r2_RT_bloom2);
C.r_Pass ("stub_notransform_filter","bloom_filter", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom2);
C.r_dx10Texture ("s_bloom", r2_RT_bloom2);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 3: // FF-filter_P0
C.r_Pass ("stub_notransform_build", "bloom_filter_f", FALSE, FALSE, FALSE);
C.r_Sampler_clf ("s_bloom", r2_RT_bloom1);
C.r_Pass ("stub_notransform_build","bloom_filter_f", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom1);
C.r_dx10Texture ("s_bloom", r2_RT_bloom1);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 4: // FF-filter_P1
C.r_Pass ("stub_notransform_build", "bloom_filter_f", FALSE, FALSE, FALSE);
C.r_Sampler_clf ("s_bloom", r2_RT_bloom2);
C.r_Pass ("stub_notransform_build","bloom_filter_f", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom2);
C.r_dx10Texture ("s_bloom", r2_RT_bloom2);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
}
}

CBlender_bloom_build_msaa::CBlender_bloom_build_msaa () { description.CLS = 0; }
CBlender_bloom_build_msaa::~CBlender_bloom_build_msaa () { }

void CBlender_bloom_build_msaa::Compile (CBlender_Compile& C)
{
IBlender::Compile (C);

switch (C.iElement)
{
case 0: // transfer into bloom-target
C.r_Pass ("stub_notransform_build","bloom_build", FALSE, FALSE, FALSE, FALSE, D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA);
//C.r_Sampler_clf ("s_image", r2_RT_generic1);
C.r_dx10Texture ("s_image", r2_RT_generic1);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 1: // X-filter
C.r_Pass ("stub_notransform_filter","bloom_filter", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom1);
C.r_dx10Texture ("s_bloom", r2_RT_bloom1);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 2: // Y-filter
C.r_Pass ("stub_notransform_filter","bloom_filter", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom2);
C.r_dx10Texture ("s_bloom", r2_RT_bloom2);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 3: // FF-filter_P0
C.r_Pass ("stub_notransform_build","bloom_filter_f", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom1);
C.r_dx10Texture ("s_bloom", r2_RT_bloom1);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
case 4: // FF-filter_P1
C.r_Pass ("stub_notransform_build","bloom_filter_f", FALSE, FALSE, FALSE);
//C.r_Sampler_clf ("s_bloom", r2_RT_bloom2);
C.r_dx10Texture ("s_bloom", r2_RT_bloom2);
C.r_dx10Sampler ("smp_rtlinear");
C.r_End ();
break;
}
}

CBlender_postprocess_msaa::CBlender_postprocess_msaa () { description.CLS = 0; }
CBlender_postprocess_msaa::~CBlender_postprocess_msaa () { }

void CBlender_postprocess_msaa::Compile (CBlender_Compile& C)
{
IBlender::Compile (C);

switch (C.iElement)
{
case 0: // transfer into bloom-target
C.r_Pass ("stub_notransform_postpr","postprocess", FALSE, FALSE, FALSE, FALSE, D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA);
C.r_dx10Texture ("s_base0", r2_RT_generic);
C.r_dx10Texture ("s_base1", r2_RT_generic);
C.r_dx10Texture ("s_noise", "fx\\fx_noise2");

C.r_dx10Sampler ("smp_rtlinear");
C.r_dx10Sampler ("smp_linear");
C.r_End ();
break;

case 4: // use color map
C.r_Pass ("stub_notransform_postpr","postprocess_CM", FALSE, FALSE, FALSE, FALSE, D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA);
C.r_dx10Texture ("s_base0", r2_RT_generic);
C.r_dx10Texture ("s_base1", r2_RT_generic);
C.r_dx10Texture ("s_noise", "fx\\fx_noise2");
C.r_dx10Texture ("s_grad0", "$user$cmap0");
C.r_dx10Texture ("s_grad1", "$user$cmap1");

C.r_dx10Sampler ("smp_rtlinear");
C.r_dx10Sampler ("smp_linear");
C.r_End ();
break;
}
}

27 changes: 27 additions & 0 deletions src/Layers/xrRenderPC_GL/blender_bloom_build.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,30 @@ class CBlender_bloom_build : public IBlender
CBlender_bloom_build();
virtual ~CBlender_bloom_build();
};

class CBlender_bloom_build_msaa : public IBlender
{
public:
virtual LPCSTR getComment() { return "INTERNAL: combine to bloom target msaa"; }
virtual BOOL canBeDetailed() { return FALSE; }
virtual BOOL canBeLMAPped() { return FALSE; }

virtual void Compile (CBlender_Compile& C);

CBlender_bloom_build_msaa();
virtual ~CBlender_bloom_build_msaa();
};

class CBlender_postprocess_msaa : public IBlender
{
public:
virtual LPCSTR getComment() { return "INTERNAL: combine to bloom target msaa"; }
virtual BOOL canBeDetailed() { return FALSE; }
virtual BOOL canBeLMAPped() { return FALSE; }

virtual void Compile (CBlender_Compile& C);

CBlender_postprocess_msaa();
virtual ~CBlender_postprocess_msaa();
};

Loading

0 comments on commit 8cbae00

Please sign in to comment.