43 lines
1.2 KiB
HLSL
43 lines
1.2 KiB
HLSL
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
|
|
TEXTURE2D_X(_CameraDepthTexture);
|
|
SAMPLER(sampler_CameraDepthTexture);
|
|
|
|
float3 _GazeOrigin;
|
|
float3 _GazeDirection;
|
|
float _FoveaAngle;
|
|
float _PeriAngle;
|
|
|
|
float4 _FoveaColor = float4(0,1,0,0.25);
|
|
float4 _periColor = float4(1,0,0,0.18);
|
|
float4 _BlockedCol = float4(0.3,0.3,0.3,0.22);
|
|
|
|
half4 frag (Varyings input) : SV_Target
|
|
{
|
|
return float4(1, 0, 1, 0.5);
|
|
// Nimmt die Depth Texture und rekonstruiert daraus die World Position
|
|
//float depth = SAMPLE_TEXTURE2D_X(_CameraDepthTexture, sampler_CameraDepthTexture, input.texcoord).r;
|
|
//float4 clip = float4(input.texcoord * 2 - 1, depth, 1);
|
|
//float4 view = mul(UNITY_MATRIX_I_P, clip); view /= view.w;
|
|
//float3 world = mul(UNITY_MATRIX_I_V, view).xyz;
|
|
|
|
// Eryeugt einen Vektor vom Origin zum gewünschten Pixel
|
|
//float3 v = normalize(world - _GazeOrigin);
|
|
//float cosAng = dot(v, normalize(_GazeOrigin));
|
|
|
|
// Berechnung Cosinus
|
|
//float cosF = cos(_FoveaAngle);
|
|
//float cosP = cos(_PeriAngle);
|
|
|
|
//float4 col;
|
|
//if (cosAng >= cosF) col = _FoveaColor;
|
|
//else if (cosAng >= cosP) col = _periColor;
|
|
//else discard;
|
|
|
|
//uint gLayer = 8;
|
|
//if (unity_RenderingLayer.x & (1u << gLayer))
|
|
//col = _BlockedCol;
|
|
|
|
//return col;
|
|
}
|