示例#1
0
        public override VFXAbstractRenderedOutput.BlendMode GetBlendModeFromMaterial(VFXMaterialSerializedSettings materialSettings)
        {
            var blendMode = VFXAbstractRenderedOutput.BlendMode.Opaque;

            if (!materialSettings.HasProperty(HDMaterialProperties.kSurfaceType) ||
                !materialSettings.HasProperty(HDMaterialProperties.kBlendMode))
            {
                return(blendMode);
            }

            var surfaceType = materialSettings.GetFloat(HDMaterialProperties.kSurfaceType);

            if (surfaceType == (int)SurfaceType.Transparent)
            {
                switch (materialSettings.GetFloat(HDMaterialProperties.kBlendMode))
                {
                case (int)BlendMode.Additive:
                    blendMode = VFXAbstractRenderedOutput.BlendMode.Additive;
                    break;

                case (int)BlendMode.Alpha:
                    blendMode = VFXAbstractRenderedOutput.BlendMode.Alpha;
                    break;

                case (int)BlendMode.Premultiply:
                    blendMode = VFXAbstractRenderedOutput.BlendMode.AlphaPremultiplied;
                    break;
                }
            }

            return(blendMode);
        }
示例#2
0
 public override bool TryGetQueueOffset(ShaderGraphVfxAsset shaderGraph, VFXMaterialSerializedSettings materialSettings, out int queueOffset)
 {
     queueOffset = 0;
     if (materialSettings.HasProperty(HDMaterialProperties.kTransparentSortPriority))
     {
         queueOffset = (int)materialSettings.GetFloat(HDMaterialProperties.kTransparentSortPriority);
         return(true);
     }
     return(false);
 }
示例#3
0
 public override bool TryGetQueueOffset(ShaderGraphVfxAsset shaderGraph, VFXMaterialSerializedSettings materialSettings, out int queueOffset)
 {
     //N.B.: Queue offset is always overridable in URP
     queueOffset = 0;
     if (materialSettings.HasProperty(Rendering.Universal.Property.QueueOffset))
     {
         queueOffset = (int)materialSettings.GetFloat(Rendering.Universal.Property.QueueOffset);
         return(true);
     }
     return(false);
 }