DecalDrawErrorRenderPass.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. using Unity.Collections;
  3. using Unity.Mathematics;
  4. namespace UnityEngine.Rendering.Universal
  5. {
  6. internal class DecalDrawErrorSystem : DecalDrawSystem
  7. {
  8. private DecalTechnique m_Technique;
  9. public DecalDrawErrorSystem(DecalEntityManager entityManager, DecalTechnique technique) : base("DecalDrawErrorSystem.Execute", entityManager)
  10. {
  11. m_Technique = technique;
  12. }
  13. protected override int GetPassIndex(DecalCachedChunk decalCachedChunk)
  14. {
  15. switch (m_Technique)
  16. {
  17. case DecalTechnique.DBuffer:
  18. return ((decalCachedChunk.passIndexDBuffer == -1) && (decalCachedChunk.passIndexEmissive == -1)) ? 0 : -1;
  19. case DecalTechnique.ScreenSpace:
  20. return decalCachedChunk.passIndexScreenSpace == -1 ? 0 : -1;
  21. case DecalTechnique.GBuffer:
  22. return decalCachedChunk.passIndexGBuffer == -1 ? 0 : -1;
  23. case DecalTechnique.Invalid:
  24. return 0;
  25. default:
  26. return 0;
  27. }
  28. }
  29. protected override Material GetMaterial(DecalEntityChunk decalEntityChunk) => m_EntityManager.errorMaterial;
  30. }
  31. }