project-aster/samples/03_model_render/shader/background.ps.hlsl

22 lines
527 B
HLSL

#include "graphics_structs.hlsli"
struct PS_Input
{
float3 WorldPosition : POSITION;
};
struct PS_Output
{
float4 Color : SV_Target0;
};
PS_Output main(PS_Input StageInput)
{
PS_Output StageOutput;
float3 Direction = normalize(StageInput.WorldPosition - Camera.Position.xyz);
float4 Color = TextureCubes[PushConstant.EnvCubeHandle].Sample(ImmutableSamplers[PushConstant.EnvCubeHandle], Direction);
StageOutput.Color = float4(Uncharted2Tonemap(Color.rgb), Color.a);
return StageOutput;
}