Ejemplo n.º 1
0
 // material main surface inputs
 public override void DrawSurfaceInputs(Material material)
 {
     base.DrawSurfaceInputs(material);
     DrawEmissionProperties(material);
     DrawReflectionProperties(material);
     PSXMaterialUtils.DrawTileOffset(materialEditor, mainTexProp);
 }
Ejemplo n.º 2
0
        // material changed check
        public override void MaterialChanged(Material material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            PSXMaterialUtils.SetMaterialKeywords(material);
        }
Ejemplo n.º 3
0
 protected virtual void DrawReflectionProperties(Material material)
 {
     PSXMaterialUtils.DrawReflectionProperties(
         material,
         materialEditor,
         reflectionProp,
         reflectionBlendModeProp,
         reflectionCubemapProp,
         reflectionTextureProp,
         reflectionColorProp
         );
 }
        public void DrawSurfaceOptions(Material material)
        {
            PSXMaterialUtils.DrawRenderQueueCategory(materialEditor, renderQueueCategoryProp);
            // PSXMaterialUtils.DrawVertexColorMode(materialEditor, vertexColorModeProp);
            PSXMaterialUtils.DrawLightingMode(material, materialEditor, lightingModeProp, lightingBakedProp, lightingDynamicProp);
            PSXMaterialUtils.DrawShadingEvaluationMode(materialEditor, shadingEvaluationModeProp);
            // PSXMaterialUtils.DrawSurfaceTypeAndBlendMode(material, materialEditor, surfaceTypeProp, blendModeProp);
            PSXMaterialUtils.DrawCullingSettings(material, materialEditor, cullingProp);
            // PSXMaterialUtils.DrawAlphaClippingSettings(material, alphaClipProp, alphaClippingDitherIsEnabledProp);

            PSXMaterialUtils.DrawAffineTextureWarpingWeight(affineTextureWarpingWeightProp);
            PSXMaterialUtils.DrawPrecisionGeometryWeight(precisionGeometryWeightProp);
            PSXMaterialUtils.DrawFogWeight(fogWeightProp);
        }
Ejemplo n.º 5
0
        public virtual void DrawSurfaceOptions(Material material)
        {
            PSXMaterialUtils.DrawRenderQueueCategory(materialEditor, renderQueueCategoryProp);
            PSXMaterialUtils.DrawTextureFilterMode(materialEditor, textureFilterModeProp);
            PSXMaterialUtils.DrawVertexColorMode(materialEditor, vertexColorModeProp);
            PSXMaterialUtils.DrawLightingMode(material, materialEditor, lightingModeProp, lightingBakedProp, lightingDynamicProp);
            PSXMaterialUtils.DrawShadingEvaluationMode(materialEditor, shadingEvaluationModeProp);
            PSXMaterialUtils.DrawSurfaceTypeAndBlendMode(material, materialEditor, surfaceTypeProp, blendModeProp);
            PSXMaterialUtils.DrawCullingSettings(material, materialEditor, cullingProp, doubleSidedNormalModeProp, doubleSidedConstantsProp);
            PSXMaterialUtils.DrawAlphaClippingSettings(material, alphaClipProp, alphaClippingDitherIsEnabledProp, alphaClippingScaleBiasMinMaxProp);

            PSXMaterialUtils.DrawAffineTextureWarpingWeight(affineTextureWarpingWeightProp);
            PSXMaterialUtils.DrawPrecisionGeometryWeight(precisionGeometryWeightProp);
            PSXMaterialUtils.DrawFogWeight(fogWeightProp);
            PSXMaterialUtils.DrawDrawDistanceOverride(drawDrawDistanceOverrideModeProp, drawDrawDistanceOverrideProp);
        }
        // material changed check
        public void MaterialChanged(Material material)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            // PSXMaterialUtils.SetMaterialKeywords(material);

            // Clear all keywords for fresh start
            PSXMaterialUtils.ClearMaterialKeywords(material);

            PSXMaterialUtils.SetupMaterialLightingModeNoVertexColorSupported(material);
            PSXMaterialUtils.SetupMaterialShadingEvaluationMode(material);
            // PSXMaterialUtils.SetupMaterialBlendMode(material);
            PSXMaterialUtils.SetupMaterialFogKeyword(material);
            // PSXMaterialUtils.SetupMaterialReflectionKeyword(material);
            // PSXMaterialUtils.SetupMaterialEmissionKeyword(material);
        }
Ejemplo n.º 7
0
        public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
        {
            if (material == null)
            {
                throw new ArgumentNullException("material");
            }

            // _Emission property is lost after assigning Standard shader to the material
            // thus transfer it before assigning the new shader
            if (material.HasProperty("_Emission"))
            {
                material.SetColor("_EmissionColor", material.GetColor("_Emission"));
            }

            base.AssignNewShaderToMaterial(material, oldShader, newShader);

            if (oldShader == null || !oldShader.name.Contains("Legacy Shaders/"))
            {
                PSXMaterialUtils.SetupMaterialBlendMode(material);
                return;
            }

            PSXMaterialUtils.SurfaceType surfaceType = PSXMaterialUtils.SurfaceType.Opaque;
            PSXMaterialUtils.BlendMode   blendMode   = PSXMaterialUtils.BlendMode.AlphaPostmultiply;
            if (oldShader.name.Contains("/Transparent/Cutout/"))
            {
                surfaceType = PSXMaterialUtils.SurfaceType.Opaque;
                material.SetFloat("_AlphaClip", 1);
            }
            else if (oldShader.name.Contains("/Transparent/"))
            {
                // NOTE: legacy shaders did not provide physically based transparency
                // therefore Fade mode
                surfaceType = PSXMaterialUtils.SurfaceType.Transparent;
                blendMode   = PSXMaterialUtils.BlendMode.AlphaPostmultiply;
            }
            material.SetFloat("_Surface", (float)surfaceType);
            material.SetFloat("_Blend", (float)blendMode);

            MaterialChanged(material);
        }
Ejemplo n.º 8
0
        // Copied from shaderGUI as it is a protected function in an abstract class, unavailable to others

        public new static MaterialProperty FindProperty(string propertyName, MaterialProperty[] properties, bool propertyIsMandatory)
        {
            return(PSXMaterialUtils.FindProperty(propertyName, properties, propertyIsMandatory));
        }
Ejemplo n.º 9
0
        // Copied from shaderGUI as it is a protected function in an abstract class, unavailable to others

        public new static MaterialProperty FindProperty(string propertyName, MaterialProperty[] properties)
        {
            return(PSXMaterialUtils.FindProperty(propertyName, properties));
        }
Ejemplo n.º 10
0
 public void DoPopup(GUIContent label, MaterialProperty property, string[] options)
 {
     PSXMaterialUtils.DoPopup(label, property, options, materialEditor);
 }
Ejemplo n.º 11
0
 protected virtual void DrawEmissionProperties(Material material)
 {
     PSXMaterialUtils.DrawEmissionProperties(material, materialEditor, emissionTextureProp, emissionColorProp, emissionBakedMultiplierProp);
 }
Ejemplo n.º 12
0
 public virtual void DrawAdvancedOptions(Material material)
 {
     PSXMaterialUtils.DrawAdvancedOptions(material, materialEditor);
 }
Ejemplo n.º 13
0
 public virtual void DrawSurfaceInputs(Material material)
 {
     PSXMaterialUtils.DrawMainProperties(material, materialEditor, mainTexProp, mainColorProp);
 }