mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 23:15:27 +08:00
Added MSAA pass to deferred render
This commit is contained in:
@@ -504,6 +504,16 @@
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="PPMSAAPS.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="PPReduceTo0DCS.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
|
||||
|
||||
@@ -247,6 +247,9 @@
|
||||
<FxCompile Include="DistantLightsVS.hlsl">
|
||||
<Filter>Lights</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="PPMSAAPS.hlsl">
|
||||
<Filter>PostProcessor</Filter>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="BasicPS.hlsli">
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
struct VS_Output
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
float2 Tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
Texture2D<float4> SceneColour : register(t0);
|
||||
SamplerState PointSampler : register(s0);
|
||||
|
||||
|
||||
cbuffer cbPS : register(b0)
|
||||
{
|
||||
uint SampleCount;
|
||||
float SampleMult;
|
||||
float TexelSizeX;
|
||||
float TexelSizeY;
|
||||
};
|
||||
|
||||
float4 main(VS_Output input) : SV_TARGET
|
||||
{
|
||||
float4 vColor = 0;
|
||||
|
||||
float2 ts = float2(TexelSizeX, TexelSizeY);
|
||||
float2 tc = input.Tex * (1.0 - (ts * (float) (SampleCount - 1)));
|
||||
|
||||
for (uint x = 0; x < SampleCount; x++)
|
||||
{
|
||||
for (uint y = 0; y < SampleCount; y++)
|
||||
{
|
||||
float2 tcxy = tc + float2(x, y) * ts;
|
||||
vColor += SceneColour.Sample(PointSampler, tcxy);
|
||||
}
|
||||
}
|
||||
|
||||
vColor *= SampleMult;
|
||||
|
||||
return float4(vColor.rgb, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user