Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

UniversalDOTSInstancing.hlsl 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef UNIVERSAL_DOTS_INSTANCING_INCLUDED
  2. #define UNIVERSAL_DOTS_INSTANCING_INCLUDED
  3. #ifdef UNITY_DOTS_INSTANCING_ENABLED
  4. #undef unity_ObjectToWorld
  5. #undef unity_WorldToObject
  6. #undef unity_MatrixPreviousM
  7. #undef unity_MatrixPreviousMI
  8. // TODO: This might not work correctly in all cases, double check!
  9. UNITY_DOTS_INSTANCING_START(BuiltinPropertyMetadata)
  10. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float3x4, unity_ObjectToWorld)
  11. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float3x4, unity_WorldToObject)
  12. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float4, unity_SpecCube0_HDR)
  13. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float4, unity_LightmapST)
  14. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float4, unity_LightmapIndex)
  15. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float4, unity_DynamicLightmapST)
  16. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float3x4, unity_MatrixPreviousM)
  17. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float3x4, unity_MatrixPreviousMI)
  18. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(SH, unity_SHCoefficients)
  19. UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(uint2, unity_EntityId)
  20. UNITY_DOTS_INSTANCING_END(BuiltinPropertyMetadata)
  21. #define unity_LODFade LoadDOTSInstancedData_LODFade()
  22. #define unity_SpecCube0_HDR UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_CUSTOM_DEFAULT(float4, unity_SpecCube0_HDR, unity_DOTS_SpecCube0_HDR)
  23. #define unity_LightmapST UNITY_ACCESS_DOTS_INSTANCED_PROP(float4, unity_LightmapST)
  24. #define unity_LightmapIndex UNITY_ACCESS_DOTS_INSTANCED_PROP(float4, unity_LightmapIndex)
  25. #define unity_DynamicLightmapST UNITY_ACCESS_DOTS_INSTANCED_PROP(float4, unity_DynamicLightmapST)
  26. #define unity_SHAr LoadDOTSInstancedData_SHAr()
  27. #define unity_SHAg LoadDOTSInstancedData_SHAg()
  28. #define unity_SHAb LoadDOTSInstancedData_SHAb()
  29. #define unity_SHBr LoadDOTSInstancedData_SHBr()
  30. #define unity_SHBg LoadDOTSInstancedData_SHBg()
  31. #define unity_SHBb LoadDOTSInstancedData_SHBb()
  32. #define unity_SHC LoadDOTSInstancedData_SHC()
  33. #define unity_ProbesOcclusion LoadDOTSInstancedData_ProbesOcclusion()
  34. #define unity_LightData LoadDOTSInstancedData_LightData()
  35. #define unity_WorldTransformParams LoadDOTSInstancedData_WorldTransformParams()
  36. #define unity_RenderingLayer LoadDOTSInstancedData_RenderingLayer()
  37. #define unity_MotionVectorsParams LoadDOTSInstancedData_MotionVectorsParams()
  38. #define UNITY_SETUP_DOTS_SH_COEFFS SetupDOTSSHCoeffs(UNITY_DOTS_INSTANCED_METADATA_NAME(SH, unity_SHCoefficients))
  39. #define UNITY_SETUP_DOTS_RENDER_BOUNDS SetupDOTSRendererBounds(UNITY_DOTS_MATRIX_M)
  40. // Not supported by BatchRendererGroup. Just define them as constants.
  41. // ------------------------------------------------------------------------------
  42. static const float2x4 unity_LightIndices = float2x4(0,0,0,0, 0,0,0,0);
  43. static const float4 unity_SpecCube0_BoxMax = float4(1,1,1,1);
  44. static const float4 unity_SpecCube0_BoxMin = float4(0,0,0,0);
  45. static const float4 unity_SpecCube0_ProbePosition = float4(0,0,0,0);
  46. static const float4 unity_SpecCube1_BoxMax = float4(1,1,1,1);
  47. static const float4 unity_SpecCube1_BoxMin = float4(0,0,0,0);
  48. static const float4 unity_SpecCube1_ProbePosition = float4(0,0,0,0);
  49. static const float4 unity_SpecCube1_HDR = float4(0,0,0,0);
  50. static const float4 unity_RendererBounds_Min = float4(0,0,0,0);
  51. static const float4 unity_RendererBounds_Max = float4(0,0,0,0);
  52. // Set up by BRG picking/selection code
  53. int unity_SubmeshIndex;
  54. #define unity_SelectionID UNITY_ACCESS_DOTS_INSTANCED_SELECTION_VALUE(unity_EntityId, unity_SubmeshIndex, _SelectionID)
  55. #else
  56. #define unity_SelectionID _SelectionID
  57. #define UNITY_SETUP_DOTS_RENDER_BOUNDS
  58. #endif
  59. #endif