VFXExpressionLoadCameraBuffer.cs 931 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Linq;
  3. using System.Runtime.CompilerServices;
  4. using UnityEngine;
  5. using UnityEngine.VFX;
  6. namespace UnityEditor.VFX
  7. {
  8. class VFXExpressionLoadCameraBuffer : VFXExpression
  9. {
  10. public VFXExpressionLoadCameraBuffer() : this(VFXCameraBufferValue.Default, VFXValue<Vector2>.Default)
  11. {
  12. }
  13. public VFXExpressionLoadCameraBuffer(VFXExpression cameraBuffer, VFXExpression uv)
  14. : base(Flags.InvalidOnCPU, new VFXExpression[2] { cameraBuffer, uv })
  15. {
  16. }
  17. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  18. sealed public override VFXValueType valueType { get { return VFXValueType.Float4; } }
  19. public sealed override string GetCodeString(string[] parents)
  20. {
  21. return string.Format("LOAD_TEXTURE2D_X_LOD({0}, {1}, 0)", parents[0], parents[1]);
  22. }
  23. }
  24. }