2014-01-08 07:01:59 +01:00
|
|
|
Texture2D Diffuse : register(t0);
|
|
|
|
Texture2D Specular : register(t1);
|
|
|
|
Texture2D Ambient : register(t2);
|
|
|
|
|
|
|
|
RWTexture2D<float4> Output;
|
|
|
|
|
2014-02-13 15:24:19 +01:00
|
|
|
SamplerState S1 : register(s0);
|
|
|
|
|
2014-02-07 16:51:35 +01:00
|
|
|
cbuffer Size : register(b0)
|
|
|
|
{
|
2014-02-18 10:19:59 +01:00
|
|
|
float AmbFactor;
|
2014-02-07 16:51:35 +01:00
|
|
|
}
|
|
|
|
|
2014-02-13 15:24:19 +01:00
|
|
|
float4 SuperSample(float4 Glow, uint3 DTid)
|
|
|
|
{
|
|
|
|
// Line X
|
|
|
|
float2 index = (float2)(DTid.xy/2);
|
|
|
|
index += float2(0,Output.Length.y/2);
|
|
|
|
index = index / Output.Length;
|
|
|
|
Glow = Ambient.SampleLevel(S1, index,1);
|
2014-02-18 12:02:48 +01:00
|
|
|
Glow = Glow;
|
2014-02-13 15:24:19 +01:00
|
|
|
|
|
|
|
return Glow;
|
|
|
|
}
|
2014-02-05 16:00:28 +01:00
|
|
|
|
2014-01-08 07:01:59 +01:00
|
|
|
[numthreads(16, 16, 1)]
|
|
|
|
void main( uint3 DTid : SV_DispatchThreadID )
|
|
|
|
{
|
2014-02-10 09:35:03 +01:00
|
|
|
float4 Light = Diffuse[DTid.xy] + saturate(Specular[DTid.xy]);
|
2014-02-14 14:27:38 +01:00
|
|
|
float4 Amb = float4(Ambient[DTid.xy/2].xyz /* * Ambient[DTid.xy/2].w*/, 0);
|
2014-02-13 15:24:19 +01:00
|
|
|
float4 Glow = Ambient[DTid.xy/2 + uint2(0,Output.Length.y/2)];
|
|
|
|
|
2014-02-10 01:03:10 +01:00
|
|
|
float4 GUI;
|
2014-02-18 10:19:59 +01:00
|
|
|
uint2 index = DTid.xy/2 + uint2((uint)Output.Length.x/(uint)2,0);
|
2014-02-10 09:35:03 +01:00
|
|
|
float3 PostLight = Amb.xyz * AmbFactor;
|
2014-02-13 15:24:19 +01:00
|
|
|
PostLight = PostLight + Light.xyz + Glow;
|
2014-02-10 01:03:10 +01:00
|
|
|
GUI = float4(Ambient[index]);
|
2014-02-10 09:35:03 +01:00
|
|
|
PostLight = PostLight * (1 - GUI.w);
|
2014-02-10 01:03:10 +01:00
|
|
|
Output[DTid.xy] = float4((GUI.xyz * GUI.w) + PostLight, 1);
|
2014-02-13 15:24:19 +01:00
|
|
|
|
2014-02-17 09:03:53 +01:00
|
|
|
//Output[DTid.xy] = float4(Ambient[DTid.xy/2 + uint2(0,Output.Length.y*0.5f)].xyz,1);
|
2014-02-18 12:02:48 +01:00
|
|
|
//Output[DTid.xy] = Ambient[DTid.xy];
|
2014-01-08 07:01:59 +01:00
|
|
|
}
|