-
-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* UPD: [xrRender] Various fixes, water SSR works again
- Loading branch information
Showing
15 changed files
with
200 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "stdafx.h" | ||
|
||
#include "blender_lut.h" | ||
|
||
CBlender_lut::CBlender_lut() { description.CLS = 0; } | ||
|
||
LPCSTR CBlender_lut::getComment() | ||
{ | ||
return "INTERNAL: LUT"; | ||
} | ||
|
||
void CBlender_lut::Compile(CBlender_Compile& C) | ||
{ | ||
IBlender::Compile(C); | ||
|
||
C.r_Pass("stub_screen_space", "pp_lut", FALSE, FALSE, FALSE); | ||
|
||
C.r_dx11Texture("s_image", r2_RT_generic0);// r2_RT_generic0 | ||
C.r_dx11Texture("debug_image", r2_RT_ssfx_hud);// r2_RT_generic0 | ||
C.r_dx11Texture("debug_noise", "fx\\blue_noise");// r2_RT_generic0 | ||
|
||
C.r_dx11Texture("s_lut_atlas", "shaders\\lut_atlas"); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_dx11Sampler("smp_linear"); | ||
C.r_End(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
class CBlender_lut : public IBlender | ||
{ | ||
public: | ||
CBlender_lut(); | ||
~CBlender_lut() override = default; | ||
|
||
LPCSTR getComment() override; | ||
void Compile(CBlender_Compile& C) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include "stdafx.h" | ||
|
||
void CRenderTarget::phase_lut() | ||
{ | ||
PIX_EVENT(phase_LUT); | ||
|
||
//Constants | ||
u32 Offset = 0; | ||
u32 C = color_rgba(0, 0, 0, 255); | ||
|
||
float d_Z = EPS_S; | ||
float d_W = 1.0f; | ||
float w = float(Device.dwWidth); | ||
float h = float(Device.dwHeight); | ||
|
||
Fvector2 p0, p1; | ||
#if defined(USE_DX10) || defined(USE_DX11) | ||
p0.set(0.0f, 0.0f); | ||
p1.set(1.0f, 1.0f); | ||
#else | ||
p0.set(0.5f / w, 0.5f / h); | ||
p1.set((w + 0.5f) / w, (h + 0.5f) / h); | ||
#endif | ||
|
||
////////////////////////////////////////////////////////////////////////// | ||
//Set MSAA/NonMSAA rendertarget | ||
#if defined(USE_DX10) || defined(USE_DX11) | ||
ref_rt& dest_rt = RImplementation.o.msaa ? rt_Generic : rt_Color; | ||
u_setrt(RCache, dest_rt, 0, 0, NULL); | ||
#else | ||
u_setrt(rt_Generic_0, nullptr, nullptr, nullptr); | ||
#endif | ||
|
||
RCache.set_CullMode(CULL_NONE); | ||
RCache.set_Stencil(FALSE); | ||
|
||
//Fill vertex buffer | ||
FVF::TL* pv = (FVF::TL*)RImplementation.Vertex.Lock(4, g_combine->vb_stride, Offset); | ||
pv->set(0, float(h), d_Z, d_W, C, p0.x, p1.y); pv++; | ||
pv->set(0, 0, d_Z, d_W, C, p0.x, p0.y); pv++; | ||
pv->set(float(w), float(h), d_Z, d_W, C, p1.x, p1.y); pv++; | ||
pv->set(float(w), 0, d_Z, d_W, C, p1.x, p0.y); pv++; | ||
RImplementation.Vertex.Unlock(4, g_combine->vb_stride); | ||
|
||
//Set pass | ||
RCache.set_Element(s_lut->E[0]); | ||
|
||
//Set geometry | ||
RCache.set_Geometry(g_combine); | ||
RCache.Render(D3DPT_TRIANGLELIST, Offset, 0, 4, 0, 2); | ||
|
||
#if defined(USE_DX10) || defined(USE_DX11) | ||
HW.get_context(CHW::IMM_CTX_ID)->CopyResource(rt_Generic_0->pTexture->surface_get(), dest_rt->pTexture->surface_get()); | ||
#endif | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.