temporal AA accounts for motion vector
This commit is contained in:
@@ -26,6 +26,7 @@ void ForwardRenderableComponent::ResizeBuffers()
|
||||
Renderable3DComponent::ResizeBuffers();
|
||||
|
||||
rtMain.Initialize(wiRenderer::GetDevice()->GetScreenWidth(), wiRenderer::GetDevice()->GetScreenHeight(), true, FORMAT_R16G16B16A16_FLOAT, 1, getMSAASampleCount(), false);
|
||||
rtMain.Add(FORMAT_R16G16B16A16_FLOAT); // thin gbuffer
|
||||
}
|
||||
|
||||
void ForwardRenderableComponent::Initialize()
|
||||
|
||||
@@ -334,6 +334,8 @@ void Renderable3DComponent::RenderSecondaryScene(wiRenderTarget& mainRT, wiRende
|
||||
wiImage::Draw(shadedSceneRT.GetTextureResolvedMSAA(threadID), fx, threadID);
|
||||
fx.process.clear();
|
||||
}
|
||||
wiRenderer::GetDevice()->UnBindResources(TEXSLOT_GBUFFER0, 2, threadID);
|
||||
wiRenderer::GetDevice()->UnBindResources(TEXSLOT_ONDEMAND0, 1, threadID);
|
||||
shadedSceneRT.Set(threadID, nullptr); {
|
||||
fx.presentFullScreen = true;
|
||||
fx.blendFlag = BLENDMODE_OPAQUE;
|
||||
|
||||
@@ -20,7 +20,6 @@ TiledForwardRenderableComponent::~TiledForwardRenderableComponent()
|
||||
|
||||
void TiledForwardRenderableComponent::RenderScene(GRAPHICSTHREAD threadID)
|
||||
{
|
||||
wiProfiler::GetInstance().BeginRange("Opaque Scene", wiProfiler::DOMAIN_GPU, threadID);
|
||||
|
||||
wiRenderer::UpdateCameraCB(wiRenderer::getCamera(), threadID);
|
||||
|
||||
@@ -53,12 +52,14 @@ void TiledForwardRenderableComponent::RenderScene(GRAPHICSTHREAD threadID)
|
||||
|
||||
wiRenderer::GetDevice()->UnBindResources(TEXSLOT_ONDEMAND0, 1, threadID);
|
||||
|
||||
wiProfiler::GetInstance().BeginRange("Opaque Scene", wiProfiler::DOMAIN_GPU, threadID);
|
||||
rtMain.Set(threadID);
|
||||
{
|
||||
wiRenderer::DrawWorld(wiRenderer::getCamera(), getTessellationEnabled(), threadID, SHADERTYPE_TILEDFORWARD, rtReflection.GetTexture(), true, true);
|
||||
wiRenderer::DrawSky(threadID);
|
||||
}
|
||||
|
||||
rtMain.Deactivate(threadID);
|
||||
wiRenderer::UpdateGBuffer(rtMain.GetTexture(0), rtMain.GetTexture(1), nullptr, nullptr, nullptr, threadID);
|
||||
wiProfiler::GetInstance().EndRange(); // Opaque Scene
|
||||
}
|
||||
void TiledForwardRenderableComponent::RenderTransparentScene(wiRenderTarget& refractionRT, GRAPHICSTHREAD threadID)
|
||||
|
||||
@@ -11,7 +11,7 @@ struct ImpostorOut
|
||||
|
||||
ImpostorOut main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
OBJECT_PS_MAKE_COMMON
|
||||
|
||||
OBJECT_PS_SAMPLETEXTURES
|
||||
|
||||
|
||||
@@ -26,5 +26,5 @@ float4 main(PSIn input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_GAMMA
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -69,11 +69,13 @@ CBUFFER(FrameCB, CBSLOT_RENDERER_FRAME)
|
||||
float g_xFrame_WindRandomness;
|
||||
uint g_xFrame_FrameCount;
|
||||
int g_xFrame_SunLightArrayIndex;
|
||||
float2 g_xFrame_TemporalAAJitter;
|
||||
float2 g_xFrame_TemporalAAJitterPrev;
|
||||
// The following are per frame properties for the main camera:
|
||||
float4x4 g_xFrame_MainCamera_VP; // View*Projection
|
||||
float4x4 g_xFrame_MainCamera_View;
|
||||
float4x4 g_xFrame_MainCamera_Proj;
|
||||
float3 g_xFrame_MainCamera_CamPos; float xPadding2_FrameCB;
|
||||
float3 g_xFrame_MainCamera_CamPos; float xPadding3_FrameCB;
|
||||
float4x4 g_xFrame_MainCamera_PrevV;
|
||||
float4x4 g_xFrame_MainCamera_PrevP;
|
||||
float4x4 g_xFrame_MainCamera_PrevVP; // PrevView*PrevProjection
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "grassHF_PS.hlsli"
|
||||
#include "ditherHF.hlsli"
|
||||
|
||||
float4 main(GS_OUT PSIn) : SV_Target
|
||||
GBUFFEROutputType_Thin main(GS_OUT PSIn)
|
||||
{
|
||||
#ifdef GRASS_FADE_DITHER
|
||||
clip(dither(PSIn.pos.xy) - PSIn.fade);
|
||||
@@ -24,6 +24,7 @@ float4 main(GS_OUT PSIn) : SV_Target
|
||||
float2 pixel = PSIn.pos.xy;
|
||||
float3 diffuse = 0;
|
||||
float3 specular = 0;
|
||||
float2 velocity = 0;
|
||||
|
||||
OBJECT_PS_LIGHT_BEGIN
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "ditherHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(GS_OUT PSIn) : SV_Target
|
||||
GBUFFEROutputType_Thin main(GS_OUT PSIn)
|
||||
{
|
||||
float4 baseColor = float4(PSIn.col,1);
|
||||
float opacity = baseColor.a;
|
||||
@@ -22,6 +22,7 @@ float4 main(GS_OUT PSIn) : SV_Target
|
||||
float2 pixel = PSIn.pos.xy;
|
||||
float3 diffuse = 0;
|
||||
float3 specular = 0;
|
||||
float2 velocity = 0;
|
||||
|
||||
OBJECT_PS_LIGHT_BEGIN
|
||||
|
||||
|
||||
@@ -60,6 +60,11 @@ struct GBUFFEROutputType
|
||||
float4 g2 : SV_TARGET2; // texture_gbuffer2
|
||||
float4 g3 : SV_TARGET3; // texture_gbuffer3
|
||||
};
|
||||
struct GBUFFEROutputType_Thin
|
||||
{
|
||||
float4 g0 : SV_TARGET0; // texture_gbuffer0
|
||||
float4 g1 : SV_TARGET1; // texture_gbuffer1
|
||||
};
|
||||
|
||||
|
||||
// METHODS
|
||||
@@ -258,6 +263,7 @@ inline void TiledLighting(in float2 pixel, in float3 N, in float3 V, in float3 P
|
||||
float lineardepth = input.pos2D.z; \
|
||||
float2 refUV = float2(1, -1)*input.ReflectionMapSamplingPos.xy / input.ReflectionMapSamplingPos.w / 2.0f + 0.5f;\
|
||||
float2 ScreenCoord = float2(1, -1) * input.pos2D.xy / input.pos2D.w / 2.0f + 0.5f; \
|
||||
float2 velocity = ((input.pos2DPrev.xy/input.pos2DPrev.w - g_xFrame_TemporalAAJitterPrev) - (input.pos2D.xy/input.pos2D.w - g_xFrame_TemporalAAJitter)) * float2(0.5f, -0.5f);
|
||||
|
||||
#define OBJECT_PS_COMPUTETANGENTSPACE \
|
||||
float3 T, B; \
|
||||
@@ -332,6 +338,12 @@ inline void TiledLighting(in float2 pixel, in float3 N, in float3 V, in float3 P
|
||||
return Out;
|
||||
|
||||
#define OBJECT_PS_OUT_FORWARD \
|
||||
GBUFFEROutputType_Thin Out = (GBUFFEROutputType_Thin)0; \
|
||||
Out.g0 = color; /*FORMAT_R16G16B16_FLOAT*/ \
|
||||
Out.g1 = float4(encode(N), velocity); /*FORMAT_R16G16B16_FLOAT*/ \
|
||||
return Out;
|
||||
|
||||
#define OBJECT_PS_OUT_FORWARD_SIMPLE \
|
||||
return color;
|
||||
|
||||
#endif // _OBJECTSHADER_HF_
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_DITHER
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_DITHER
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_DITHER
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_DITHER
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_DITHER
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_DITHER
|
||||
|
||||
|
||||
@@ -26,5 +26,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ float4 main( PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -30,5 +30,5 @@ float4 main( PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -32,5 +32,5 @@ float4 main( PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -26,5 +26,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -30,5 +30,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -60,5 +60,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
@@ -14,6 +14,6 @@ float4 main(PixelInputType_Simple input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_EMISSIVE
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "objectHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(PixelInputType input) : SV_TARGET
|
||||
GBUFFEROutputType_Thin main(PixelInputType input)
|
||||
{
|
||||
OBJECT_PS_MAKE
|
||||
|
||||
|
||||
@@ -27,5 +27,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -33,5 +33,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -31,5 +31,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -62,5 +62,5 @@ float4 main(PixelInputType input) : SV_TARGET
|
||||
|
||||
OBJECT_PS_FOG
|
||||
|
||||
OBJECT_PS_OUT_FORWARD
|
||||
OBJECT_PS_OUT_FORWARD_SIMPLE
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ PixelInputType main(Input input)
|
||||
//}
|
||||
|
||||
Out.pos = Out.pos2D = mul( pos, g_xCamera_VP );
|
||||
Out.pos2DPrev = mul(posPrev, g_xCamera_VP);
|
||||
Out.pos2DPrev = mul(posPrev, g_xFrame_MainCamera_PrevVP);
|
||||
Out.pos3D = pos.xyz;
|
||||
Out.tex = input.tex.xy;
|
||||
Out.nor = normalize(normal);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "grassHF_PS.hlsli"
|
||||
#include "ditherHF.hlsli"
|
||||
|
||||
float4 main(QGS_OUT PSIn) : SV_Target
|
||||
GBUFFEROutputType_Thin main(QGS_OUT PSIn)
|
||||
{
|
||||
#ifdef GRASS_FADE_DITHER
|
||||
clip(dither(PSIn.pos.xy) - PSIn.fade);
|
||||
@@ -29,6 +29,7 @@ float4 main(QGS_OUT PSIn) : SV_Target
|
||||
float depth = PSIn.pos.z;
|
||||
float3 diffuse = 0;
|
||||
float3 specular = 0;
|
||||
float2 velocity = 0;
|
||||
|
||||
OBJECT_PS_LIGHT_BEGIN
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "ditherHF.hlsli"
|
||||
|
||||
[earlydepthstencil]
|
||||
float4 main(QGS_OUT PSIn) : SV_Target
|
||||
GBUFFEROutputType_Thin main(QGS_OUT PSIn)
|
||||
{
|
||||
float4 baseColor = texture_0.Sample(sampler_linear_clamp,PSIn.tex);
|
||||
baseColor.a *= 1.0 - PSIn.fade;
|
||||
@@ -27,6 +27,7 @@ float4 main(QGS_OUT PSIn) : SV_Target
|
||||
float depth = PSIn.pos.z;
|
||||
float3 diffuse = 0;
|
||||
float3 specular = 0;
|
||||
float2 velocity = 0;
|
||||
|
||||
OBJECT_PS_LIGHT_BEGIN
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
float4 main(VertexToPixelPostProcess PSIn) : SV_TARGET
|
||||
{
|
||||
float2 velocity = texture_gbuffer1.Load(uint3(PSIn.pos.xy,0)).zw;
|
||||
|
||||
//float4 neighborhood[9];
|
||||
//neighborhood[0] = xMaskTex.Load(uint3(PSIn.pos.xy + uint2(-1, -1), 0));
|
||||
//neighborhood[1] = xMaskTex.Load(uint3(PSIn.pos.xy + uint2(0, -1), 0));
|
||||
@@ -22,7 +24,8 @@ float4 main(VertexToPixelPostProcess PSIn) : SV_TARGET
|
||||
//}
|
||||
|
||||
//float4 history = clamp(neighborhood[4], neighborhoodMin, neighborhoodMax);
|
||||
float4 history = xMaskTex.Load(uint3(PSIn.pos.xy, 0));
|
||||
//float4 history = xMaskTex.Load(uint3(PSIn.pos.xy, 0));
|
||||
float4 history = xMaskTex.SampleLevel(sampler_linear_clamp, PSIn.tex + velocity, 0);
|
||||
|
||||
float4 current = xTexture.Load(uint3(PSIn.pos.xy,0));
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ bool wiRenderer::wireRender = false, wiRenderer::debugSpheres = false, wiRendere
|
||||
, wiRenderer::debugEnvProbes = false, wiRenderer::gridHelper = false, wiRenderer::voxelHelper = false, wiRenderer::requestReflectionRendering = false, wiRenderer::advancedLightCulling = true;
|
||||
float wiRenderer::SPECULARAA = 0.0f;
|
||||
float wiRenderer::renderTime = 0, wiRenderer::renderTime_Prev = 0, wiRenderer::deltaTime = 0;
|
||||
XMFLOAT2 wiRenderer::temporalAAJitter = XMFLOAT2(0, 0), wiRenderer::temporalAAJitterPrev = XMFLOAT2(0, 0);
|
||||
|
||||
Texture2D* wiRenderer::enviroMap,*wiRenderer::colorGrading;
|
||||
float wiRenderer::GameSpeed=1,wiRenderer::overrideGameSpeed=1;
|
||||
@@ -1705,10 +1706,18 @@ void wiRenderer::UpdatePerFrameData(float dt)
|
||||
{
|
||||
const XMFLOAT4& halton = wiMath::GetHaltonSequence(GetDevice()->GetFrameCount() % 64);
|
||||
static float jitter = 1.0f;
|
||||
cam->Projection.m[2][0] = jitter * (halton.x * 2 - 1) / (float)GetDevice()->GetScreenWidth();
|
||||
cam->Projection.m[2][1] = jitter * (halton.y * 2 - 1) / (float)GetDevice()->GetScreenHeight();
|
||||
temporalAAJitterPrev = temporalAAJitter;
|
||||
temporalAAJitter.x = jitter * (halton.x * 2 - 1) / (float)GetDevice()->GetScreenWidth();
|
||||
temporalAAJitter.y = jitter * (halton.y * 2 - 1) / (float)GetDevice()->GetScreenHeight();
|
||||
cam->Projection.m[2][0] = temporalAAJitter.x;
|
||||
cam->Projection.m[2][1] = temporalAAJitter.y;
|
||||
cam->BakeMatrices();
|
||||
}
|
||||
else
|
||||
{
|
||||
temporalAAJitter = XMFLOAT2(0, 0);
|
||||
temporalAAJitterPrev = XMFLOAT2(0, 0);
|
||||
}
|
||||
|
||||
refCam->Reflect(cam, waterPlane.getXMFLOAT4());
|
||||
|
||||
@@ -3776,7 +3785,7 @@ void wiRenderer::RenderMeshes(const XMFLOAT3& eye, const CulledCollection& culle
|
||||
(mesh->streamoutBuffers[VPROP_POS].IsValid() ? &mesh->streamoutBuffers[VPROP_POS] : &mesh->vertexBuffers[VPROP_POS]),
|
||||
(mesh->streamoutBuffers[VPROP_NOR].IsValid() ? &mesh->streamoutBuffers[VPROP_NOR] : &mesh->vertexBuffers[VPROP_NOR]),
|
||||
&mesh->vertexBuffers[VPROP_TEX],
|
||||
(mesh->streamoutBuffers[VPROP_PRE].IsValid() ? &mesh->streamoutBuffers[VPROP_PRE] : &mesh->vertexBuffers[VPROP_POS]),
|
||||
(mesh->streamoutBuffers[VPROP_PRE].IsValid() ? &mesh->streamoutBuffers[VPROP_PRE] : &mesh->vertexBuffers[VPROP_PRE]),
|
||||
&mesh->instanceBuffer
|
||||
};
|
||||
UINT strides[] = {
|
||||
@@ -4764,6 +4773,8 @@ void wiRenderer::UpdateFrameCB(GRAPHICSTHREAD threadID)
|
||||
cb.mWindDirection = wind.direction;
|
||||
cb.mFrameCount = (UINT)GetDevice()->GetFrameCount();
|
||||
cb.mSunLightArrayIndex = GetSunArrayIndex();
|
||||
cb.mTemporalAAJitter = temporalAAJitter;
|
||||
cb.mTemporalAAJitterPrev = temporalAAJitterPrev;
|
||||
|
||||
auto camera = getCamera();
|
||||
auto prevCam = prevFrameCam;
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
static bool HAIRPARTICLEENABLED, EMITTERSENABLED;
|
||||
static float SPECULARAA;
|
||||
static float renderTime, renderTime_Prev, deltaTime;
|
||||
static XMFLOAT2 temporalAAJitter, temporalAAJitterPrev;
|
||||
|
||||
static void SetShadowProps2D(int resolution, int count, int softShadowQuality);
|
||||
static void SetShadowPropsCube(int resolution, int count);
|
||||
@@ -116,10 +117,12 @@ public:
|
||||
float mWindRandomness;
|
||||
UINT mFrameCount;
|
||||
int mSunLightArrayIndex;
|
||||
XMFLOAT2 mTemporalAAJitter;
|
||||
XMFLOAT2 mTemporalAAJitterPrev;
|
||||
XMMATRIX mVP;
|
||||
XMMATRIX mView;
|
||||
XMMATRIX mProj;
|
||||
XMFLOAT3 mCamPos; float pad2;
|
||||
XMFLOAT3 mCamPos; float pad3;
|
||||
XMMATRIX mPrevV;
|
||||
XMMATRIX mPrevP;
|
||||
XMMATRIX mPrevVP;
|
||||
|
||||
Reference in New Issue
Block a user