Draw Debug Mode に 対応する
https://edanoue.gyazo.com/0402b507d540495fd04a0ef7e9fa48d5
Unity: 2023.2
Defines and Includes
code:.hlsl
#pragma shader_feature EDITOR_VISUALIZATION Structure
code:.hlsl
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
float2 VizUV : TEXCOORD1;
float4 LightCoord : TEXCOORD2;
};
Fragment
code:.hlsl
Varyings vertMeta(Attributes input)
{
// ...
UnityEditorVizData(input.positionOS.xyz, input.uv0, input.uv1, input.uv2, output.VizUV, output.LightCoord);
return output;
}
Varying
code:.hlsl
half4 fragMeta(Varyings input) : SV_Target
{
// ...
metaInput.VizUV = input.VizUV;
metaInput.LightCoord = input.LightCoord;
return UnityMetaFragment(metaInput);
}