init
This commit is contained in:
commit
2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions
49
gamedata/shaders/d3d11/sky.ps.hlsl
Normal file
49
gamedata/shaders/d3d11/sky.ps.hlsl
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#include "common.hlsli"
|
||||
|
||||
struct v2p
|
||||
{
|
||||
float4 factor : COLOR0;
|
||||
float3 p : TEXCOORD1;
|
||||
|
||||
float4 hpos_curr : TEXCOORD2;
|
||||
float4 hpos_old : TEXCOORD3;
|
||||
|
||||
float4 hpos : SV_POSITION;
|
||||
};
|
||||
|
||||
TextureCube s_sky0 : register(t0);
|
||||
TextureCube s_sky1 : register(t1);
|
||||
|
||||
struct sky
|
||||
{
|
||||
float4 Color : SV_Target0;
|
||||
float2 Velocity : SV_Target1;
|
||||
};
|
||||
|
||||
void main(in v2p I, out sky O)
|
||||
{
|
||||
float3 TexCoord = I.p;
|
||||
|
||||
#ifndef USE_FULL_SKY_SPHERE
|
||||
RemapVector(TexCoord);
|
||||
#endif
|
||||
|
||||
float3 s0 = s_sky0.SampleLevel(smp_rtlinear, TexCoord, 0.0f).xyz;
|
||||
float3 s1 = s_sky1.SampleLevel(smp_rtlinear, TexCoord, 0.0f).xyz;
|
||||
float3 sky = lerp(s0, s1, I.factor.w);
|
||||
|
||||
#ifdef USE_BGRA_SKYCOLOR
|
||||
sky *= L_sky_color.zyx;
|
||||
#else
|
||||
sky *= L_sky_color.xyz;
|
||||
#endif
|
||||
|
||||
#ifdef USE_LEGACY_SKY_TONEMAP
|
||||
O.Color = float4(detonemap(sky * 0.66f), 0.0f);
|
||||
#else
|
||||
O.Color = float4(PushGamma(sky), 0.0f);
|
||||
#endif
|
||||
|
||||
O.Velocity = I.hpos_curr.xy / I.hpos_curr.w - I.hpos_old.xy / I.hpos_old.w;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue