You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

35 lines
1.2 KiB

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/HDROutput.hlsl"
#pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch
#pragma kernel KCIExyGen
#define GROUP_SIZE_X 8
#define GROUP_SIZE_Y 8
TEXTURE2D_X(_SourceTexture);
RW_TEXTURE2D_X(float, _xyBuffer);
float4 _HDRxyBufferDebugParams;
#define _SizePerDim _HDRxyBufferDebugParams.xy
float2 RGBtoxy(float3 rgb)
{
float3 XYZ = RotateOutputSpaceToXYZ(rgb);
return XYZ.xy / (dot(XYZ, 1));
}
[numthreads(GROUP_SIZE_X, GROUP_SIZE_Y, 1)]
void KCIExyGen(uint groupIndex : SV_GroupIndex,
uint3 dispatchThreadId : SV_DispatchThreadID)
{
UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z);
float3 rgbData = LOAD_TEXTURE2D_X(_SourceTexture, dispatchThreadId.xy).rgb;
float2 xy = (RGBtoxy(rgbData));
_xyBuffer[COORD_TEXTURE2D_X(xy * _SizePerDim)] = 1;
}