Exemplo n.º 1
0
        protected void SetMaterialKeywords(Material material)
        {
            BaseShaderGUI.SetMaterialKeywords(material);

            _lightingFeature.SetMaterialKeywords(material);
            _paletteFeature.SetMaterialKeywords(material);
        }
        public static void UpdateStandardMaterialKeywords(Material material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            if (material.GetTexture("_MetallicGlossMap"))
            {
                material.SetFloat("_Smoothness", material.GetFloat("_GlossMapScale"));
            }
            else
            {
                material.SetFloat("_Smoothness", material.GetFloat("_Glossiness"));
            }

            if (material.IsKeywordEnabled("_ALPHATEST_ON"))
            {
                material.SetFloat("_AlphaClip", 1.0f);
            }

            material.SetFloat("_WorkflowMode", 1.0f);
            CoreUtils.SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap"));
            CoreUtils.SetKeyword(material, "_METALLICSPECGLOSSMAP", material.GetTexture("_MetallicGlossMap"));
            UpdateSurfaceTypeAndBlendMode(material);
            BaseShaderGUI.SetupMaterialBlendMode(material);
        }
Exemplo n.º 3
0
            public CustomProperties(MaterialProperty[] properties)
            {
                shadeContrast       = BaseShaderGUI.FindProperty("_ShadeContrast", properties);
                toonShadingOn       = BaseShaderGUI.FindProperty("_ToonShadingOn", properties);
                toonShadeStep1      = BaseShaderGUI.FindProperty("_ToonShadeStep1", properties);
                toonShadeStep2      = BaseShaderGUI.FindProperty("_ToonShadeStep2", properties);
                toonShadeSmoothness = BaseShaderGUI.FindProperty("_ToonShadeSmoothness", properties);
                rimLightingOn       = BaseShaderGUI.FindProperty("_RimLightingOn", properties);
                rimBurnOn           = BaseShaderGUI.FindProperty("_RimBurnOn", properties);
                rimColor            = BaseShaderGUI.FindProperty("_RimColor", properties);
                rimPower            = BaseShaderGUI.FindProperty("_RimPower", properties);
                cubicRimOn          = BaseShaderGUI.FindProperty("_CubicRimOn", properties);
                coloredShadowOn     = BaseShaderGUI.FindProperty("_ColoredShadowOn", properties);
                shadowColor         = BaseShaderGUI.FindProperty("_ShadowColor", properties);
                shadowPower         = BaseShaderGUI.FindProperty("_ShadowPower", properties);
                hsvShiftOn          = BaseShaderGUI.FindProperty("_HSVShiftOn", properties);
                hue        = BaseShaderGUI.FindProperty("_Hue", properties);
                saturation = BaseShaderGUI.FindProperty("_Saturation", properties);
                brightness = BaseShaderGUI.FindProperty("_Brightness", properties);

                multipleFogOn = BaseShaderGUI.FindProperty("_MultipleFogOn", properties);
                fogColor1     = BaseShaderGUI.FindProperty("_FogColor1", properties);
                fogColor2     = BaseShaderGUI.FindProperty("_FogColor2", properties);
                fogDistance1  = BaseShaderGUI.FindProperty("_FogDistance1", properties);
                fogDistance2  = BaseShaderGUI.FindProperty("_FogDistance2", properties);

                heightFogOn     = BaseShaderGUI.FindProperty("_HeightFogOn", properties);
                heightFogColor  = BaseShaderGUI.FindProperty("_HeightFogColor", properties);
                heightFogYFrom  = BaseShaderGUI.FindProperty("_HeightFogYFrom", properties);
                heightFogHeight = BaseShaderGUI.FindProperty("_HeightFogHeight", properties);
            }
Exemplo n.º 4
0
        protected override void DrawEmissionProperties(Material material, bool keyword)
        {
            //Copied
            bool flag  = true;
            bool flag2 = emissionMapProp.textureValue != null;

            if (!keyword)
            {
                materialEditor.TexturePropertyWithHDRColor(Styles.emissionMap, emissionMapProp, emissionColorProp, showAlpha: false);
            }
            else
            {
                flag = materialEditor.EmissionEnabledProperty();
                EditorGUI.BeginDisabledGroup(!flag);
                materialEditor.TexturePropertyWithHDRColor(Styles.emissionMap, emissionMapProp, emissionColorProp, showAlpha: false);
                EditorGUI.EndDisabledGroup();
            }

            float maxColorComponent = emissionColorProp.colorValue.maxColorComponent;

            if (emissionMapProp.textureValue != null && !flag2 && maxColorComponent <= 0f)
            {
                emissionColorProp.colorValue = Color.white;
            }

            if (flag)
            {
                material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive;
                if (maxColorComponent <= 0f)
                {
                    material.globalIlluminationFlags |= MaterialGlobalIlluminationFlags.EmissiveIsBlack;
                }
            }

            //Insert
            if (emissionEdgeProp != null)
            {
                EditorGUI.BeginDisabledGroup(!flag);

                EditorGUI.BeginChangeCheck();
                EditorGUI.showMixedValue = emissionEdgeProp.hasMixedValue;
                BaseShaderGUI.DoPopup(emissionEdgeText, emissionEdgeProp, Enum.GetNames(typeof(EmissionEdgeMode)), materialEditor);
                if (EditorGUI.EndChangeCheck())
                {
                    foreach (var obj in materialEditor.targets)
                    {
                        MaterialChanged((Material)obj);
                    }
                }

                EditorGUI.BeginDisabledGroup(emissionEdgeProp.floatValue == 0);
                EditorGUI.showMixedValue = emissionEdgeWidthProp.hasMixedValue;
                materialEditor.ShaderProperty(emissionEdgeWidthProp, emissionEdgeWidthText);
                EditorGUI.EndDisabledGroup();

                EditorGUI.showMixedValue = false;

                EditorGUI.EndDisabledGroup();
            }
        }
Exemplo n.º 5
0
            internal LitProperties(MaterialProperty[] properties)
            {
                // Surface Option Props
                workflowMode = BaseShaderGUI.FindProperty("_WorkflowMode", properties, false);
                // Surface Input Props
                metallic             = BaseShaderGUI.FindProperty("_Metallic", properties);
                specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties, false);
                metallicGlossMap     = BaseShaderGUI.FindProperty("_MetallicGlossMap", properties);
                specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
                smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
                smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessTextureChannel", properties, false);
                bumpMapProp          = BaseShaderGUI.FindProperty("_BumpMap", properties, false);
                bumpScaleProp        = BaseShaderGUI.FindProperty("_BumpScale", properties, false);
                parallaxMapProp      = BaseShaderGUI.FindProperty("_ParallaxMap", properties, false);
                parallaxScaleProp    = BaseShaderGUI.FindProperty("_Parallax", properties, false);
                occlusionStrength    = BaseShaderGUI.FindProperty("_OcclusionStrength", properties, false);
                occlusionMap         = BaseShaderGUI.FindProperty("_OcclusionMap", properties, false);
                // Advanced Props
                highlights  = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
                reflections = BaseShaderGUI.FindProperty("_EnvironmentReflections", properties, false);

                clearCoat           = BaseShaderGUI.FindProperty("_ClearCoat", properties, false);
                clearCoatMap        = BaseShaderGUI.FindProperty("_ClearCoatMap", properties, false);
                clearCoatMask       = BaseShaderGUI.FindProperty("_ClearCoatMask", properties, false);
                clearCoatSmoothness = BaseShaderGUI.FindProperty("_ClearCoatSmoothness", properties, false);
            }
Exemplo n.º 6
0
            public SimpleLitProperties(MaterialProperty[] properties)
            {
                // Surface Input Props
                specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties);
                specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
                specHighlights       = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
                smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessSource", properties, false);
                smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
                bumpMapProp          = BaseShaderGUI.FindProperty("_BumpMap", properties, false);

                outline      = BaseShaderGUI.FindProperty("_Outline", properties, false);
                outlineColor = BaseShaderGUI.FindProperty("_OutlineColor", properties, false);

                rimMin   = BaseShaderGUI.FindProperty("_RimMin", properties, false);
                rimMax   = BaseShaderGUI.FindProperty("_RimMax", properties, false);
                rimPower = BaseShaderGUI.FindProperty("_RimPower", properties, false);

                rampMinStep      = BaseShaderGUI.FindProperty("_RampMinStep", properties, false);
                rampMinThreshold = BaseShaderGUI.FindProperty("_RampMinThreshold", properties, false);
                rampMaxStep      = BaseShaderGUI.FindProperty("_RampMaxStep", properties, false);
                rampMaxThreshold = BaseShaderGUI.FindProperty("_RampMaxThreshold", properties, false);

                specSmoothness = BaseShaderGUI.FindProperty("_SpecSmoothness", properties, false);
                specBlend      = BaseShaderGUI.FindProperty("_SpecBlend", properties, false);
            }
Exemplo n.º 7
0
        public static void Inputs(TexelLitProperties properties, MaterialEditor materialEditor, Material material)
        {
            DoMetallicSpecularArea(properties, materialEditor, material);
            BaseShaderGUI.DrawNormalArea(materialEditor, properties.bumpMapProp, properties.bumpScaleProp);

            if (properties.occlusionMap != null)
            {
                materialEditor.TexturePropertySingleLine(Styles.OcclusionText, properties.occlusionMap,
                                                         properties.occlusionMap.textureValue != null ? properties.occlusionStrength : null);
            }

            if (properties.posterizationStepCount != null)
            {
                materialEditor.VectorProperty(
                    properties.posterizationStepCount,
                    Styles.PosterizationColorText);
            }

            if (properties.lightPosterizationStepCount != null)
            {
                materialEditor.VectorProperty(
                    properties.lightPosterizationStepCount,
                    Styles.PosterizationLightText);
            }
        }
Exemplo n.º 8
0
 public LCDDisplayProperties(MaterialProperty[] properties)
 {
     pixelMask         = BaseShaderGUI.FindProperty("_PixelMask", properties, false);
     pixelLuma         = BaseShaderGUI.FindProperty("_PixelLuma", properties, false);
     pixelLayout       = BaseShaderGUI.FindProperty("_PixelLayout", properties, false);
     pixelLayoutOffset = BaseShaderGUI.FindProperty("_PixelLayoutOffset", properties, false);
     colorWashout      = BaseShaderGUI.FindProperty("_ColorWashout", properties, false);
 }
Exemplo n.º 9
0
 public LitProperties(MaterialProperty[] properties)
 {
     detailMask           = BaseShaderGUI.FindProperty("_DetailMask", properties, false);
     detailAlbedoMapScale = BaseShaderGUI.FindProperty("_DetailAlbedoMapScale", properties, false);
     detailAlbedoMap      = BaseShaderGUI.FindProperty("_DetailAlbedoMap", properties, false);
     detailNormalMapScale = BaseShaderGUI.FindProperty("_DetailNormalMapScale", properties, false);
     detailNormalMap      = BaseShaderGUI.FindProperty("_DetailNormalMap", properties, false);
 }
Exemplo n.º 10
0
 static void UpgradeV2(Material material, ShaderPathID shaderID)
 {
     // fix 50 offset on shaders
     if (material.HasProperty("_QueueOffset"))
     {
         BaseShaderGUI.SetupMaterialBlendMode(material);
     }
 }
            public CustomProperties(MaterialProperty[] properties)
            {
                billboardOn = BaseShaderGUI.FindProperty("_BillboardOn", properties);

                dissolveAreaSize      = BaseShaderGUI.FindProperty("_DissolveAreaSize", properties);
                dissolveOrigin        = BaseShaderGUI.FindProperty("_DissolveOrigin", properties);
                dissolveSlow          = BaseShaderGUI.FindProperty("_DissolveSlow", properties);
                dissolveDistance      = BaseShaderGUI.FindProperty("_DissolveDistance", properties);
                dissolveRoughness     = BaseShaderGUI.FindProperty("_DissolveRoughness", properties);
                dissolveNoise         = BaseShaderGUI.FindProperty("_DissolveNoise", properties);
                dissolveEdgeSharpness = BaseShaderGUI.FindProperty("_DissolveEdgeSharpness", properties);
                dissolveEdgeAddColor  = BaseShaderGUI.FindProperty("_DissolveEdgeAddColor", properties);
                dissolveEdgeSubColor  = BaseShaderGUI.FindProperty("_DissolveEdgeSubColor", properties);

                noisePattern             = BaseShaderGUI.FindProperty("_NoisePattern", properties);
                ditherPattern            = BaseShaderGUI.FindProperty("_DitherPattern", properties);
                ditherAlpha              = BaseShaderGUI.FindProperty("_DitherAlpha", properties);
                ditherMinAlpha           = BaseShaderGUI.FindProperty("_DitherMinAlpha", properties);
                ditherCameraDistanceFrom = BaseShaderGUI.FindProperty("_DitherCameraDistanceFrom", properties);
                ditherCameraDistanceTo   = BaseShaderGUI.FindProperty("_DitherCameraDistanceTo", properties);
                ditherCull         = BaseShaderGUI.FindProperty("_DitherCull", properties);
                heightDitherYFrom  = BaseShaderGUI.FindProperty("_HeightDitherYFrom", properties);
                heightDitherHeight = BaseShaderGUI.FindProperty("_HeightDitherHeight", properties);

                windStrength    = BaseShaderGUI.FindProperty("_WindStrength", properties);
                windSpeed       = BaseShaderGUI.FindProperty("_WindSpeed", properties);
                windBigWave     = BaseShaderGUI.FindProperty("_WindBigWave", properties);
                windRotateSpeed = BaseShaderGUI.FindProperty("_WindRotateSpeed", properties);

                rotateSpeedX = BaseShaderGUI.FindProperty("_RotateSpeedX", properties);
                rotateSpeedY = BaseShaderGUI.FindProperty("_RotateSpeedY", properties);
                rotateSpeedZ = BaseShaderGUI.FindProperty("_RotateSpeedZ", properties);

                shadeContrast   = BaseShaderGUI.FindProperty("_ShadeContrast", properties);
                rimLightingOn   = BaseShaderGUI.FindProperty("_RimLightingOn", properties);
                rimBurnOn       = BaseShaderGUI.FindProperty("_RimBurnOn", properties);
                rimColor        = BaseShaderGUI.FindProperty("_RimColor", properties);
                rimPower        = BaseShaderGUI.FindProperty("_RimPower", properties);
                cubicRimOn      = BaseShaderGUI.FindProperty("_CubicRimOn", properties);
                coloredShadowOn = BaseShaderGUI.FindProperty("_ColoredShadowOn", properties);
                shadowColor     = BaseShaderGUI.FindProperty("_ShadowColor", properties);
                shadowPower     = BaseShaderGUI.FindProperty("_ShadowPower", properties);
                hsvShiftOn      = BaseShaderGUI.FindProperty("_HSVShiftOn", properties);
                hue             = BaseShaderGUI.FindProperty("_Hue", properties);
                saturation      = BaseShaderGUI.FindProperty("_Saturation", properties);
                brightness      = BaseShaderGUI.FindProperty("_Brightness", properties);

                multipleFogOn = BaseShaderGUI.FindProperty("_MultipleFogOn", properties);
                fogColor1     = BaseShaderGUI.FindProperty("_FogColor1", properties);
                fogColor2     = BaseShaderGUI.FindProperty("_FogColor2", properties);
                fogDistance1  = BaseShaderGUI.FindProperty("_FogDistance1", properties);
                fogDistance2  = BaseShaderGUI.FindProperty("_FogDistance2", properties);

                heightFogOn     = BaseShaderGUI.FindProperty("_HeightFogOn", properties);
                heightFogColor  = BaseShaderGUI.FindProperty("_HeightFogColor", properties);
                heightFogYFrom  = BaseShaderGUI.FindProperty("_HeightFogYFrom", properties);
                heightFogHeight = BaseShaderGUI.FindProperty("_HeightFogHeight", properties);
            }
 public TessellationProperties(MaterialProperty[] properties)
 {
     tessellationMode               = BaseShaderGUI.FindProperty("_TessellationMode", properties);
     tessellationFactor             = BaseShaderGUI.FindProperty("_TessellationFactor", properties, false);
     tessellationFactorMinDistance  = BaseShaderGUI.FindProperty("_TessellationFactorMinDistance", properties, false);
     tessellationFactorMaxDistance  = BaseShaderGUI.FindProperty("_TessellationFactorMaxDistance", properties, false);
     tessellationFactorTriangleSize = BaseShaderGUI.FindProperty("_TessellationFactorTriangleSize", properties, false);
     tessellationShapeFactor        = BaseShaderGUI.FindProperty("_TessellationShapeFactor", properties, false);
 }
Exemplo n.º 13
0
 private void DrawNormalOptions(Material material, MaterialEditor materialEditor)
 {
     this.toonNormalOptionsFoldout.SetValue(EditorGUILayout.BeginFoldoutHeaderGroup(this.toonNormalOptionsFoldout.GetValue(), "Normal map Options"));
     if (this.toonNormalOptionsFoldout.GetValue())
     {
         BaseShaderGUI.DrawNormalArea(materialEditor, this.BumpMap, this.BumpScale);
     }
     EditorGUILayout.EndFoldoutHeaderGroup();
 }
Exemplo n.º 14
0
        public static void DoSpecularArea(SimpleLitProperties properties, MaterialEditor materialEditor, Material material)
        {
            SpecularSource specSource = (SpecularSource)properties.specHighlights.floatValue;

            EditorGUI.BeginDisabledGroup(specSource == SpecularSource.NoSpecular);
            BaseShaderGUI.TextureColorProps(materialEditor, Styles.specularMapText, properties.specGlossMap, properties.specColor, true);
            DoSmoothness(properties, material);
            EditorGUI.EndDisabledGroup();
        }
 public KnitwearProperties(MaterialProperty[] properties)
 {
     knitwearMap                = BaseShaderGUI.FindProperty("_KnitwearMap", properties, false);
     knitwearDivision           = BaseShaderGUI.FindProperty("_KnitwearDivision", properties, false);
     knitwearAspect             = BaseShaderGUI.FindProperty("_KnitwearAspect", properties, false);
     knitwearShear              = BaseShaderGUI.FindProperty("_KnitwearShear", properties, false);
     knitwearDistortion         = BaseShaderGUI.FindProperty("_KnitwearDistortion", properties, false);
     knitwearDistortionStrength = BaseShaderGUI.FindProperty("_KnitwearDistortionStrength", properties, false);
 }
Exemplo n.º 16
0
    private void DrawSurfaceOptions(Material material, MaterialEditor materialEditor)
    {
        this.surfaceOptionFoldout.SetValue(EditorGUILayout.BeginFoldoutHeaderGroup(this.surfaceOptionFoldout.GetValue(), "Surface Options"));
        if (this.surfaceOptionFoldout.GetValue())
        {
            BaseShaderGUI.DoPopup(ToonShaderEditorStatic.surfaceType, surfaceTypeProp, Enum.GetNames(typeof(BaseShaderGUI.SurfaceType)), materialEditor);
            if ((BaseShaderGUI.SurfaceType)material.GetFloat("_Surface") == BaseShaderGUI.SurfaceType.Transparent)
            {
                BaseShaderGUI.DoPopup(ToonShaderEditorStatic.blendingMode, blendModeProp, Enum.GetNames(typeof(BlendMode)), materialEditor);
            }

            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = cullingProp.hasMixedValue;
            var culling = (BaseShaderGUI.RenderFace)cullingProp.floatValue;
            culling = (BaseShaderGUI.RenderFace)EditorGUILayout.EnumPopup(ToonShaderEditorStatic.cullingText, culling);
            if (EditorGUI.EndChangeCheck())
            {
                materialEditor.RegisterPropertyChangeUndo(ToonShaderEditorStatic.cullingText.text);
                cullingProp.floatValue = (float)culling;
                material.doubleSidedGI = (BaseShaderGUI.RenderFace)cullingProp.floatValue != BaseShaderGUI.RenderFace.Front;
            }

            EditorGUI.showMixedValue = false;

            EditorGUI.BeginChangeCheck();
            EditorGUI.showMixedValue = alphaClipProp.hasMixedValue;
            var alphaClipEnabled = EditorGUILayout.Toggle(ToonShaderEditorStatic.alphaClipText, alphaClipProp.floatValue == 1);
            if (EditorGUI.EndChangeCheck())
            {
                alphaClipProp.floatValue = alphaClipEnabled ? 1 : 0;
            }
            EditorGUI.showMixedValue = false;

            if (alphaClipProp.floatValue == 1)
            {
                materialEditor.ShaderProperty(alphaCutoffProp, ToonShaderEditorStatic.alphaClipThresholdText, 1);
            }

            if (receiveShadowsProp != null)
            {
                EditorGUI.BeginChangeCheck();
                EditorGUI.showMixedValue = receiveShadowsProp.hasMixedValue;
                var receiveShadows =
                    EditorGUILayout.Toggle(ToonShaderEditorStatic.receiveShadowText, receiveShadowsProp.floatValue == 1.0f);
                if (EditorGUI.EndChangeCheck())
                {
                    receiveShadowsProp.floatValue = receiveShadows ? 1.0f : 0.0f;
                }
                EditorGUI.showMixedValue = false;
            }

            EditorGUILayout.Space();
        }

        EditorGUILayout.EndFoldoutHeaderGroup();
    }
Exemplo n.º 17
0
 public IridescenceProperties(MaterialProperty[] properties)
 {
     iridescence               = BaseShaderGUI.FindProperty("_Iridescence", properties, false);
     iridescenceThickness      = BaseShaderGUI.FindProperty("_IridescenceThickness", properties, false);
     iridescenceThicknessMap   = BaseShaderGUI.FindProperty("_IridescenceThicknessMap", properties, false);
     iridescenceThicknessRemap = BaseShaderGUI.FindProperty("_IridescenceThicknessRemap", properties, false);
     iridescenceEta2           = BaseShaderGUI.FindProperty("_IridescneceEta2", properties, false);
     iridescenceEta3           = BaseShaderGUI.FindProperty("_IridescneceEta3", properties, false);
     iridescenceKappa3         = BaseShaderGUI.FindProperty("_IridescneceKappa3", properties, false);
 }
Exemplo n.º 18
0
 public SimpleLitProperties(MaterialProperty[] properties)
 {
     // Surface Input Props
     specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties);
     specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
     specHighlights       = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
     smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessSource", properties, false);
     smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
     bumpMapProp          = BaseShaderGUI.FindProperty("_BumpMap", properties, false);
 }
Exemplo n.º 19
0
        public static void Inputs(LitProperties properties, MaterialEditor materialEditor, Material material)
        {
            DoMetallicSpecularArea(properties, materialEditor, material);
            BaseShaderGUI.DrawNormalArea(materialEditor, properties.bumpMapProp, properties.bumpScaleProp);

            if (properties.occlusionMap != null)
            {
                materialEditor.TexturePropertySingleLine(Styles.occlusionText, properties.occlusionMap,
                                                         properties.occlusionMap.textureValue != null ? properties.occlusionStrength : null);
            }
        }
Exemplo n.º 20
0
        static void UpgradeV2(Material material, ShaderID shaderID)
        {
            if (shaderID.IsShaderGraph())
            {
                return;
            }

            // fix 50 offset on shaders
            if (material.HasProperty("_QueueOffset"))
            {
                BaseShaderGUI.SetupMaterialBlendMode(material);
            }
        }
Exemplo n.º 21
0
        public SimpleLitProperties(MaterialProperty[] properties)
        {
            // Surface Input Props
            specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties);
            specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
            specHighlights       = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
            smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessSource", properties, false);
            smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
            bumpMapProp          = BaseShaderGUI.FindProperty("_BumpMap", properties, false);

            //Cross-Hatch
            crossHatchColor          = BaseShaderGUI.FindProperty("_CrossHatchColor", properties);
            crossHatchMap            = BaseShaderGUI.FindProperty("_CrossHatchMap", properties, false);
            crossHatchTriPlanarScale = BaseShaderGUI.FindProperty("_CrossHatchMap_TriPlanar_Scale", properties, false);
        }
 public LitProperties(MaterialProperty[] properties)
 {
     // Surface Option Props
     workflowMode = BaseShaderGUI.FindProperty("_WorkflowMode", properties, false);
     // Surface Input Props
     metallic             = BaseShaderGUI.FindProperty("_Metallic", properties);
     specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties, false);
     metallicGlossMap     = BaseShaderGUI.FindProperty("_MetallicGlossMap", properties);
     specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
     smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
     smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessTextureChannel", properties, false);
     // Advanced Props
     highlights  = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
     reflections = BaseShaderGUI.FindProperty("_EnvironmentReflections", properties, false);
 }
Exemplo n.º 23
0
            public LitProperties(MaterialProperty[] properties)
            {
                // Surface Option Props
                workflowMode = BaseShaderGUI.FindProperty("_WorkflowMode", properties, false);
                // Surface Input Props
                metallic             = BaseShaderGUI.FindProperty("_Metallic", properties);
                specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties, false);
                metallicGlossMap     = BaseShaderGUI.FindProperty("_MetallicGlossMap", properties);
                specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
                smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
                smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessTextureChannel", properties, false);
                bumpMapProp          = BaseShaderGUI.FindProperty("_BumpMap", properties, false);
                bumpScaleProp        = BaseShaderGUI.FindProperty("_BumpScale", properties, false);
                occlusionStrength    = BaseShaderGUI.FindProperty("_OcclusionStrength", properties, false);
                occlusionMap         = BaseShaderGUI.FindProperty("_OcclusionMap", properties, false);
                // Advanced Props
                highlights  = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
                reflections = BaseShaderGUI.FindProperty("_EnvironmentReflections", properties, false);

                //stylized Lit
                useBrushTex             = BaseShaderGUI.FindProperty("_UseBrushTex", properties, false);
                brushTex                = BaseShaderGUI.FindProperty("_BrushTex", properties, false);
                medColor                = BaseShaderGUI.FindProperty("_MedColor", properties, false);
                medThreshold            = BaseShaderGUI.FindProperty("_MedThreshold", properties, false);
                medSmooth               = BaseShaderGUI.FindProperty("_MedSmooth", properties, false);
                medBrushStrength        = BaseShaderGUI.FindProperty("_MedBrushStrength", properties, false);
                shadowColor             = BaseShaderGUI.FindProperty("_ShadowColor", properties, false);
                shadowThreshold         = BaseShaderGUI.FindProperty("_ShadowThreshold", properties, false);
                shadowSmooth            = BaseShaderGUI.FindProperty("_ShadowSmooth", properties, false);
                shadowBrushStrength     = BaseShaderGUI.FindProperty("_ShadowBrushStrength", properties, false);
                reflColor               = BaseShaderGUI.FindProperty("_ReflectColor", properties, false);
                reflThreshold           = BaseShaderGUI.FindProperty("_ReflectThreshold", properties, false);
                reflSmooth              = BaseShaderGUI.FindProperty("_ReflectSmooth", properties, false);
                reflBrushStrength       = BaseShaderGUI.FindProperty("_ReflBrushStrength", properties, false);
                giIntensity             = BaseShaderGUI.FindProperty("_GIIntensity", properties, false);
                ggxSpecular             = BaseShaderGUI.FindProperty("_GGXSpecular", properties, false);
                specularLightOffset     = BaseShaderGUI.FindProperty("_SpecularLightOffset", properties, false);
                specularThreshold       = BaseShaderGUI.FindProperty("_SpecularThreshold", properties, false);
                specularSmooth          = BaseShaderGUI.FindProperty("_SpecularSmooth", properties, false);
                specularIntensity       = BaseShaderGUI.FindProperty("_SpecularIntensity", properties, false);
                directionalFresnel      = BaseShaderGUI.FindProperty("_DirectionalFresnel", properties, false);
                fresnelThreshold        = BaseShaderGUI.FindProperty("_FresnelThreshold", properties, false);
                fresnelSmooth           = BaseShaderGUI.FindProperty("_FresnelSmooth", properties, false);
                fresnelIntensity        = BaseShaderGUI.FindProperty("_FresnelIntensity", properties, false);
                reflProbeIntensity      = BaseShaderGUI.FindProperty("_ReflProbeIntensity", properties, false);
                metalReflProbeIntensity = BaseShaderGUI.FindProperty("_MetalReflProbeIntensity", properties, false);
                reflProbeRotation       = BaseShaderGUI.FindProperty("_ReflProbeRotation", properties, false);
            }
 public ParticleProperties(MaterialProperty[] properties)
 {
     // Surface Option Props
     colorMode = BaseShaderGUI.FindProperty("_ColorMode", properties, false);
     // Advanced Props
     flipbookMode                  = BaseShaderGUI.FindProperty("_FlipbookBlending", properties);
     softParticlesEnabled          = BaseShaderGUI.FindProperty("_SoftParticlesEnabled", properties);
     cameraFadingEnabled           = BaseShaderGUI.FindProperty("_CameraFadingEnabled", properties);
     distortionEnabled             = BaseShaderGUI.FindProperty("_DistortionEnabled", properties, false);
     softParticlesNearFadeDistance = BaseShaderGUI.FindProperty("_SoftParticlesNearFadeDistance", properties);
     softParticlesFarFadeDistance  = BaseShaderGUI.FindProperty("_SoftParticlesFarFadeDistance", properties);
     cameraNearFadeDistance        = BaseShaderGUI.FindProperty("_CameraNearFadeDistance", properties);
     cameraFarFadeDistance         = BaseShaderGUI.FindProperty("_CameraFarFadeDistance", properties);
     distortionBlend               = BaseShaderGUI.FindProperty("_DistortionBlend", properties, false);
     distortionStrength            = BaseShaderGUI.FindProperty("_DistortionStrength", properties, false);
 }
Exemplo n.º 25
0
        public override void FindProperties(MaterialProperty[] properties)
        {
            base.FindProperties(properties);
            litProperties           = new LitGUI.LitProperties(properties);
            settingQualityLevelProp = BaseShaderGUI.FindProperty("_SettingQualityLevel", properties, false);
            emissionEdgeProp        = FindProperty("_EmissionEdge", properties, false);
            emissionEdgeWidthProp   = FindProperty("_EmissionEdgeWidth", properties, false);

            editMoreOptionsProp = FindProperty("_EditMoreOptions", properties, false);
            zwriteProp          = FindProperty("_ZWrite", properties, false);
            extraPassMaskProp   = FindProperty("_ExtraPassMask", properties, false);

            outlineNoFitProp            = FindProperty("_OutlineNoFit", properties, false);
            outlineLerpNVProp           = FindProperty("_OutlineLerpNV", properties, false);
            outlineColorProp            = FindProperty("_OutlineColor", properties, false);
            outlineWidthProp            = FindProperty("_OutlineWidth", properties, false);
            outlineZPostionInCameraProp = FindProperty("_OutlineZPostionInCamera", properties, false);
            outlineStencilIDProp        = FindProperty("_OutlineStencilID", properties, false);
        }
Exemplo n.º 26
0
        public static void Inputs(LitProperties properties, MaterialEditor materialEditor, Material material)
        {
            DoMetallicSpecularArea(properties, materialEditor, material);
            BaseShaderGUI.DrawNormalArea(materialEditor, properties.bumpMapProp, properties.bumpScaleProp);

            if (HeightmapAvailable(material))
                DoHeightmapArea(properties, materialEditor);

            if (properties.occlusionMap != null)
            {
                materialEditor.TexturePropertySingleLine(Styles.occlusionText, properties.occlusionMap,
                    properties.occlusionMap.textureValue != null ? properties.occlusionStrength : null);
            }

            // Check that we have all the required properties for clear coat,
            // otherwise we will get null ref exception from MaterialEditor GUI helpers.
            if (ClearCoatAvailable(material))
                DoClearCoat(properties, materialEditor, material);
        }
Exemplo n.º 27
0
 public LitTessellationProperties(MaterialProperty[] properties)
 {
     // Surface Option Props
     workflowMode = BaseShaderGUI.FindProperty("_WorkflowMode", properties, false);
     // Surface Input Props
     metallic             = BaseShaderGUI.FindProperty("_Metallic", properties);
     specColor            = BaseShaderGUI.FindProperty("_SpecColor", properties, false);
     metallicGlossMap     = BaseShaderGUI.FindProperty("_MetallicGlossMap", properties);
     specGlossMap         = BaseShaderGUI.FindProperty("_SpecGlossMap", properties, false);
     smoothness           = BaseShaderGUI.FindProperty("_Smoothness", properties, false);
     smoothnessMapChannel = BaseShaderGUI.FindProperty("_SmoothnessTextureChannel", properties, false);
     bumpMapProp          = BaseShaderGUI.FindProperty("_BumpMap", properties, false);
     bumpScaleProp        = BaseShaderGUI.FindProperty("_BumpScale", properties, false);
     occlusionStrength    = BaseShaderGUI.FindProperty("_OcclusionStrength", properties, false);
     occlusionMap         = BaseShaderGUI.FindProperty("_OcclusionMap", properties, false);
     heightMap            = BaseShaderGUI.FindProperty("_HeightMap", properties, false);
     // Advanced Props
     highlights  = BaseShaderGUI.FindProperty("_SpecularHighlights", properties, false);
     reflections = BaseShaderGUI.FindProperty("_EnvironmentReflections", properties, false);
     // Geometry Input Props
     vertexColorMode                = BaseShaderGUI.FindProperty("_VertexColorMode", properties);
     tessellationScale              = BaseShaderGUI.FindProperty("_TessellationScale", properties);
     tessellationMap                = BaseShaderGUI.FindProperty("_TessellationMap", properties);
     tessellationMode               = BaseShaderGUI.FindProperty("_TessellationMode", properties);
     tessellationFactor             = BaseShaderGUI.FindProperty("_TessellationFactor", properties);
     tessellationFactorMin          = BaseShaderGUI.FindProperty("_TessellationFactorMin", properties);
     tessellationFactorMax          = BaseShaderGUI.FindProperty("_TessellationFactorMax", properties);
     tessellationDistanceMin        = BaseShaderGUI.FindProperty("_TessellationDistanceMin", properties);
     tessellationDistanceMax        = BaseShaderGUI.FindProperty("_TessellationDistanceMax", properties);
     tessellationEdgeLength         = BaseShaderGUI.FindProperty("_TessellationEdgeLength", properties);
     tessellationEdgeDistanceOffset = BaseShaderGUI.FindProperty("_TessellationEdgeDistanceOffset", properties);
     tessellationPostPro            = BaseShaderGUI.FindProperty("_TessellationPostPro", properties);
     tessellationPhongShape         = BaseShaderGUI.FindProperty("_TessellationPhongShape", properties);
     tessellationTriangleClipping   = BaseShaderGUI.FindProperty("_TessellationTriangleClipping", properties);
     tessellationTriangleClipBias   = BaseShaderGUI.FindProperty("_TessellationTriangleClipBias", properties);
     heightStrength    = BaseShaderGUI.FindProperty("_HeightStrength", properties, false);
     heightBase        = BaseShaderGUI.FindProperty("_HeightBase", properties, false);
     heightBlurMode    = BaseShaderGUI.FindProperty("_HeightBlurMode", properties, false);
     heightBlurSize    = BaseShaderGUI.FindProperty("_HeightBlurSize", properties, false);
     heightBlurSamples = BaseShaderGUI.FindProperty("_HeightBlurSamples", properties, false);
     heightBlurGaussStandardDeviation = BaseShaderGUI.FindProperty("_HeightBlurGaussStandardDeviation", properties, false);
     geometryCustomST = BaseShaderGUI.FindProperty("_GeometryCustomST", properties, false);
 }
Exemplo n.º 28
0
        public static void ConvertHDRPtoURPMaterialKeywords(Material material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            if (material.GetTexture("_MetallicGlossMap"))
            {
                material.SetFloat("_Smoothness", 1);
            }
            //else
            //    material.SetFloat("_Smoothness", material.GetFloat("_Glossiness"));

            material.SetFloat("_WorkflowMode", 1.0f);
            CoreUtils.SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap"));
            CoreUtils.SetKeyword(material, "_METALLICSPECGLOSSMAP", material.GetTexture("_MetallicGlossMap"));
            UpdateSurfaceTypeAndBlendMode(material);
            BaseShaderGUI.SetupMaterialBlendMode(material);
        }
        public static void UpdateMaterialKeywords(Material material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            material.shaderKeywords = null;
            BaseShaderGUI.SetupMaterialBlendMode(material);
            UpdateMaterialSpecularSource(material);
            CoreUtils.SetKeyword(material, "_NORMALMAP", material.GetTexture("_BumpMap"));

            // A material's GI flag internally keeps track of whether emission is enabled at all, it's enabled but has no effect
            // or is enabled and may be modified at runtime. This state depends on the values of the current flag and emissive color.
            // The fixup routine makes sure that the material is in the correct state if/when changes are made to the mode or color.
            MaterialEditor.FixupEmissiveFlag(material);
            bool shouldEmissionBeEnabled = (material.globalIlluminationFlags & MaterialGlobalIlluminationFlags.EmissiveIsBlack) == 0;

            CoreUtils.SetKeyword(material, "_EMISSION", shouldEmissionBeEnabled);
        }
            public CustomProperties(MaterialProperty[] properties)
            {
                topColor1              = BaseShaderGUI.FindProperty("_TopColor1", properties);
                topColor2              = BaseShaderGUI.FindProperty("_TopColor2", properties);
                rightColor1            = BaseShaderGUI.FindProperty("_RightColor1", properties);
                rightColor2            = BaseShaderGUI.FindProperty("_RightColor2", properties);
                frontColor1            = BaseShaderGUI.FindProperty("_FrontColor1", properties);
                frontColor2            = BaseShaderGUI.FindProperty("_FrontColor2", properties);
                leftColor1             = BaseShaderGUI.FindProperty("_LeftColor1", properties);
                leftColor2             = BaseShaderGUI.FindProperty("_LeftColor2", properties);
                backColor1             = BaseShaderGUI.FindProperty("_BackColor1", properties);
                backColor2             = BaseShaderGUI.FindProperty("_BackColor2", properties);
                bottomColor1           = BaseShaderGUI.FindProperty("_BottomColor1", properties);
                bottomColor2           = BaseShaderGUI.FindProperty("_BottomColor2", properties);
                mixCubicColorOn        = BaseShaderGUI.FindProperty("_MixCubicColorOn", properties);
                multiplyCubicDiffuseOn = BaseShaderGUI.FindProperty("_MultiplyCubicDiffuseOn", properties);
                cubicColorPower        = BaseShaderGUI.FindProperty("_CubicColorPower", properties);
                worldSpaceNormal       = BaseShaderGUI.FindProperty("_WorldSpaceNormal", properties);
                worldSpaceGradient     = BaseShaderGUI.FindProperty("_WorldSpaceGradient", properties);

                gradOrigin_T = BaseShaderGUI.FindProperty("_GradOrigin_T", properties);
                gradOrigin_R = BaseShaderGUI.FindProperty("_GradOrigin_R", properties);
                gradOrigin_F = BaseShaderGUI.FindProperty("_GradOrigin_F", properties);
                gradOrigin_L = BaseShaderGUI.FindProperty("_GradOrigin_L", properties);
                gradOrigin_B = BaseShaderGUI.FindProperty("_GradOrigin_B", properties);
                gradOrigin_D = BaseShaderGUI.FindProperty("_GradOrigin_D", properties);

                gradHeight_T = BaseShaderGUI.FindProperty("_GradHeight_T", properties);
                gradHeight_R = BaseShaderGUI.FindProperty("_GradHeight_R", properties);
                gradHeight_F = BaseShaderGUI.FindProperty("_GradHeight_F", properties);
                gradHeight_L = BaseShaderGUI.FindProperty("_GradHeight_L", properties);
                gradHeight_B = BaseShaderGUI.FindProperty("_GradHeight_B", properties);
                gradHeight_D = BaseShaderGUI.FindProperty("_GradHeight_D", properties);

                gradRotate_T = BaseShaderGUI.FindProperty("_GradRotate_T", properties);
                gradRotate_R = BaseShaderGUI.FindProperty("_GradRotate_R", properties);
                gradRotate_F = BaseShaderGUI.FindProperty("_GradRotate_F", properties);
                gradRotate_L = BaseShaderGUI.FindProperty("_GradRotate_L", properties);
                gradRotate_B = BaseShaderGUI.FindProperty("_GradRotate_B", properties);
                gradRotate_D = BaseShaderGUI.FindProperty("_GradRotate_D", properties);
            }