init
This commit is contained in:
commit
2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions
34
gamedata/shaders/r2/depth_downs.ps.hlsl
Normal file
34
gamedata/shaders/r2/depth_downs.ps.hlsl
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include "common.hlsli"
|
||||
|
||||
uniform float4 screen_res;
|
||||
|
||||
float4 main(float2 tc : TEXCOORD0) : COLOR
|
||||
{
|
||||
#if SSAO_OPT_DATA == 2
|
||||
// FIXME: Should add a float-texel offset to I.tc0 here
|
||||
// This would fix horizontal line issue
|
||||
float4 P0 = tex2D(s_position, tc + 0.5f * screen_res.zw); // position.(mtl or sun)
|
||||
float4 P1 = tex2D(s_position, tc - 0.5f * screen_res.zw); // position.(mtl or sun)
|
||||
float4 P2 = tex2D(s_position, tc + 0.5f * float2(screen_res.z, -screen_res.w)); // position.(mtl or sun)
|
||||
float4 P3 = tex2D(s_position, tc + 0.5f * float2(-screen_res.z, screen_res.w)); // position.(mtl or sun)
|
||||
|
||||
float4 P = P0;
|
||||
|
||||
if (P1.z < P.z)
|
||||
{
|
||||
P = P1;
|
||||
}
|
||||
if (P2.z < P.z)
|
||||
{
|
||||
P = P2;
|
||||
}
|
||||
if (P3.z < P.z)
|
||||
{
|
||||
P = P3;
|
||||
}
|
||||
|
||||
return float4(P.zzzz);
|
||||
#else
|
||||
return tex2D(s_position, tc - 0.5f * screen_res.zw).zzzz;
|
||||
#endif
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue