예제 #1
0
        private string GetFunctionName()
        {
            var function = GetFunctionToConvert();

            return(function.Name + (function.IsStatic ? string.Empty : "_" + GuidEncoder.Encode(guid)) + "_" + concretePrecision.ToShaderString()
                   + (this.GetSlots <DynamicVectorMaterialSlot>().Select(s => NodeUtils.GetSlotDimension(s.concreteValueType)).FirstOrDefault() ?? "")
                   + (this.GetSlots <DynamicMatrixMaterialSlot>().Select(s => NodeUtils.GetSlotDimension(s.concreteValueType)).FirstOrDefault() ?? ""));
        }
        public SamplerStateShaderProperty()
        {
            displayName = "SamplerState";

            if (value == null)
            {
                value = new TextureSamplerState();
            }

            if (string.IsNullOrEmpty(overrideReferenceName))
            {
                overrideReferenceName = string.Format("{0}_{1}_{2}_{3}"
                                                      , propertyType
                                                      , GuidEncoder.Encode(guid)
                                                      , value.filter
                                                      , value.wrap);
            }
        }
        internal override ShaderInput Copy()
        {
            var vt = new VirtualTextureShaderProperty
            {
                displayName = displayName,
                hidden      = hidden,
                value       = new SerializableVirtualTexture(),
                precision   = precision
            };

            // duplicate layer data, but reset reference names (they should be unique)
            for (int layer = 0; layer < value.layers.Count; layer++)
            {
                var guid = Guid.NewGuid();
                vt.value.layers.Add(
                    new SerializableVirtualTextureLayer(
                        value.layers[layer].layerName,
                        $"Layer_{GuidEncoder.Encode(guid)}",
                        value.layers[layer].layerTexture));
            }

            return(vt);
        }
예제 #4
0
        private string SubGraphFunctionName()
        {
            var functionName = subGraphAsset != null?NodeUtils.GetHLSLSafeName(subGraphAsset.name) : "ERROR";

            return(string.Format("sg_{0}_{1}", functionName, GuidEncoder.Encode(referencedGraph.guid)));
        }
예제 #5
0
 public override string GetDefaultReferenceName()
 {
     return($"Color_{GuidEncoder.Encode(guid)}");
 }
예제 #6
0
 private string SubGraphFunctionName(GraphContext graphContext)
 {
     var functionName = subGraphAsset != null ? NodeUtils.GetHLSLSafeName(subGraphAsset.name) : "ERROR";
     return string.Format("sg_{0}_{1}_{2}", functionName, graphContext.graphInputStructName, GuidEncoder.Encode(referencedGraph.guid));
 }