This repository has been archived on 2024-06-19. You can view files and clone it, but cannot push or open issues or pull requests.
evermillion/Assets/Forst/CTI Runtime Components/CTI Runtime Components BIRP/Shaders/Includes/CTI_indirect.cginc

24 lines
766 B
HLSL
Raw Normal View History

2024-06-05 03:10:54 +00:00
#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
struct IndirectShaderData
{
float4x4 PositionMatrix;
float4x4 InversePositionMatrix;
float4 ControlData;
};
#if defined(SHADER_API_GLCORE) || defined(SHADER_API_D3D11) || defined(SHADER_API_GLES3) || defined(SHADER_API_METAL) || defined(SHADER_API_VULKAN) || defined(SHADER_API_PSSL) || defined(SHADER_API_XBOXONE)
StructuredBuffer<IndirectShaderData> VisibleShaderDataBuffer;
#endif
#endif
void setup()
{
#ifdef UNITY_PROCEDURAL_INSTANCING_ENABLED
unity_LODFade = VisibleShaderDataBuffer[unity_InstanceID].ControlData;
unity_ObjectToWorld = VisibleShaderDataBuffer[unity_InstanceID].PositionMatrix;
unity_WorldToObject = VisibleShaderDataBuffer[unity_InstanceID].InversePositionMatrix;
#endif
}