Beispiel #1
0
        /////////////////////////////////////////////////////////////////////////////////////////////
        // Draw                                                                                    //
        /////////////////////////////////////////////////////////////////////////////////////////////
        internal void DrawRefraction(MaterialEditor materialEditor, MaterialProperty[] properties)
        {
            //All refraction properties needs to be available on the material
            //the refraction tab is used for check
            if (_refractionBehavior != null)
            {
                if (EditorHelper.HandleBehavior(UI.refractionTab.text, "", _refractionBehavior, null, materialEditor, false))
                {
                    FindProperties(properties);
                    EditorGUI.BeginChangeCheck();
                    materialEditor.ShaderProperty(_indexOfRefraction, UI.indexOfRefraction);
                    if (EditorGUI.EndChangeCheck())
                    {
                        ManageKeywordsIndexOfRefraction();
                    }
                    EditorGUI.BeginChangeCheck();
                    if (_refractionDistortionMap.textureValue != null)
                    {
                        materialEditor.TexturePropertySingleLine(UI.refractionDistortionMap, _refractionDistortionMap, _refractionDistortionMapScale);
                        materialEditor.ShaderProperty(_refractionDistortion, UI.refractionDistortion);
                    }
                    else
                    {
                        materialEditor.TexturePropertySingleLine(UI.refractionDistortionMap, _refractionDistortionMap);
                    }
                    if (EditorGUI.EndChangeCheck())
                    {
                        ManageKeywordsRefractionMap();
                    }
                    materialEditor.ShaderProperty(_refractionDistortionFade, UI.refractionDistortionFade);
                }

                EditorHelper.DrawSplitter();
            }
        }
        protected override void DrawStylizeContent(MaterialEditor materialEditor)
        {
            DrawLightingStylize(materialEditor);

            EditorHelper.Divider();
            DrawGooch(materialEditor);

            EditorHelper.Divider();
            DrawRim(materialEditor);

            EditorHelper.Divider();
            DrawIridescence(materialEditor);

            EditorHelper.Divider();
            DrawArtistic(materialEditor);

            EditorHelper.Divider();
            DrawColorGrading(materialEditor);

            EditorHelper.Divider();
            DrawDissolve(materialEditor);

            EditorHelper.Divider();
            DrawVertexAnimation(materialEditor);
        }
        protected virtual void DrawLightingStylize(MaterialEditor materialEditor)
        {
            DrawLightingHeader();
            EditorGUI.BeginChangeCheck();
            materialEditor.ShaderProperty(_light, UI.light);
            if (EditorGUI.EndChangeCheck())
            {
                ManageKeywordsLight();
            }
            if (_light.floatValue == (int)(Light.Cel) || _light.floatValue == (int)(Light.Banded))
            {
                materialEditor.ShaderProperty(_lightThreshold, UI.lightThreshold);
            }
            if (_light.floatValue == (int)(Light.Banded))
            {
                materialEditor.ShaderProperty(_lightBands, UI.lightBands);
                materialEditor.ShaderProperty(_lightBandsScale, UI.lightBandsScale);
            }
            EditorHelper.Divider();

            DrawLightingThreshold(materialEditor);

            if (_light.floatValue == (int)(Light.Ramp))
            {
                EditorHelper.Divider();
                DrawLightingRamp(materialEditor);
            }
            if (_light.floatValue != (int)(Light.Ramp) && _light.floatValue != (int)(Light.Builtin))
            {
                EditorHelper.Divider();
                DrawLightingSmoothness(materialEditor);
            }
        }
Beispiel #4
0
 private void ManageKeywordsVertexAnimationStutter()
 {
     foreach (Material mat in _vertexAnimationStutter.targets)
     {
         EditorHelper.SetKeyword(Properties.vertexAnimationStutter.GetValue(mat), Keywords.vertexAnimationStutter, mat);
         //No Keyword = Vertex Animation Stutter Off
     }
 }
Beispiel #5
0
 private void DrawOptions(MaterialEditor materialEditor)
 {
     EditorHelper.DrawSplitter();
     if (OptionsBehavior(materialEditor))
     {
         DrawOptionsContent(materialEditor);
     }
 }
 private void ManageKeywordsParallax()
 {
     //Parallax
     foreach (Material mat in _parallax.targets)
     {
         EditorHelper.SetKeyword(Properties.heightMap.GetValue(mat) && Properties.parallax.GetValue(mat) != 0.0f, Keywords.parallax, mat);
     }
 }
 private void ManageKeywordsHeightMap()
 {
     //Height map
     foreach (Material mat in _heightMap.targets)
     {
         EditorHelper.SetKeyword(Properties.heightMap.GetValue(mat), Keywords.heightMap, mat);
     }
 }
Beispiel #8
0
 private void DrawAdvanced(MaterialEditor materialEditor)
 {
     if (AdvancedBehavior(materialEditor))
     {
         DrawAdvancedContent(materialEditor);
     }
     EditorHelper.DrawSplitter();
 }
 /////////////////////////////////////////////////////////////////////////////////////////////
 // Variants Setup                                                                          //
 /////////////////////////////////////////////////////////////////////////////////////////////
 private void ManageKeywordsNormalMap()
 {
     //Normalmap
     foreach (Material mat in _normalMap.targets)
     {
         EditorHelper.SetKeyword(Properties.normalMap.GetValue(mat), Keywords.normalMap, mat);
     }
 }
 private void ManageKeywordsArtisticProjection()
 {
     //Artistic Projection
     foreach (Material mat in _artisticProjection.targets)
     {
         EditorHelper.SetKeyword(Properties.artisticProjection.GetValue(mat) == ArtisticProjection.ScreenSpace, Keywords.artisticProjection[1], mat);
     }
 }
 private void ManageKeywordsReceiveShadows()
 {
     //env reflections
     foreach (Material mat in _receiveShadows.targets)
     {
         EditorHelper.SetKeyword(Properties.receiveShadows.GetValue(mat), Keywords.receiveShadows, mat);
     }
 }
 private void ManageKeywordsSpecularMap()
 {
     //Workflow
     foreach (Material mat in _specularMap.targets)
     {
         EditorHelper.SetKeyword(Properties.specularMap.GetValue(mat) && _shaderTemplate == ShaderTemplate.Simple, Keywords.pbsMap0, mat);
     }
 }
 private void ManageKeywordsArtisticAnimation()
 {
     //Artistic Animation
     foreach (Material mat in _artisticFrequency.targets)
     {
         EditorHelper.SetKeyword(Properties.artisticFrequency.GetValue(mat) != 0.0f, Keywords.artisticAnimation, mat);
     }
 }
 private void ManageKeywordsEmissionMap()
 {
     //emission
     foreach (Material mat in _emissionMap.targets)
     {
         EditorHelper.SetKeyword(Properties.emissionMap.GetValue(mat), Keywords.emissionMap, mat);
     }
 }
 private void ManageKeywordsWrappedDiffuse()
 {
     //env reflections
     foreach (Material mat in _wrappedDiffuse.targets)
     {
         EditorHelper.SetKeyword(Properties.wrappedLighting.GetValue(mat), Keywords.wrappedLighting, mat);
     }
 }
 private void ManageKeywordsThicknessMap()
 {
     //Thickness
     foreach (Material mat in _thicknessMap.targets)
     {
         EditorHelper.SetKeyword(Properties.thicknessMap.GetValue(mat), Keywords.thicknessMap, mat);
     }
 }
 private void ManageKeywordsGoochDarkMap()
 {
     //Gooch Dark Map
     foreach (Material mat in _goochDarkMap.targets)
     {
         EditorHelper.SetKeyword(Properties.goochDarkMap.GetValue(mat), Keywords.goochDarkMap, mat);
     }
 }
 private void ManageKeywordsFresnelHighlights()
 {
     //env reflections
     foreach (Material mat in _environmentReflections.targets)
     {
         EditorHelper.SetKeyword(Properties.fresnelHighlights.GetValue(mat), Keywords.fresnelHighlights, mat);
     }
 }
 private void ManageKeywordsDetailNormalMap()
 {
     //detail bump
     foreach (Material mat in _detailNormalMap.targets)
     {
         EditorHelper.SetKeyword(Properties.detailNormalMap.GetValue(mat), Keywords.detailNormalMap, mat);
     }
 }
 private void ManageKeywordsIridescence()
 {
     //Iridescence
     foreach (Material mat in _iridescence.targets)
     {
         EditorHelper.SetKeyword(Properties.iridescence.GetValue(mat) == Iridescence.On, Keywords.iridescence[1], mat);
         //No keyword = iridescence off
     }
 }
 private void ManageKeywordsPBSMaps()
 {
     //Workflow
     foreach (Material mat in _workflow.targets)
     {
         EditorHelper.SetKeyword(Properties.metallicMap.GetValue(mat) && Properties.workflow.GetValue(mat) == Workflow.Metallic || Properties.specularMap.GetValue(mat) && Properties.workflow.GetValue(mat) == Workflow.Specular, Keywords.pbsMap0, mat);
         EditorHelper.SetKeyword(Properties.roughnessMap.GetValue(mat), Keywords.pbsMap1, mat);
     }
 }
Beispiel #22
0
 private void ManageKeywordsAlbedoMap()
 {
     //Colorsource
     foreach (Material mat in _albedoMap.targets)
     {
         EditorHelper.SetKeyword(Properties.albedoMap.GetValue(mat), Keywords.albedoMap, mat);
         //No Keyword == Vertex Colors
     }
 }
 private void ManageKeywordsGoochRamp()
 {
     //Gooch Ramp
     foreach (Material mat in _goochRamp.targets)
     {
         EditorHelper.SetKeyword(Properties.goochRamp.GetValue(mat), Keywords.goochRamp, mat);
         //No keyword = ramp off
     }
 }
Beispiel #24
0
 private void ManageKeywordsAlphaClipping()
 {
     //Alpha Clipping
     foreach (Material mat in _alphaClipping.targets)
     {
         EditorHelper.SetKeyword(Properties.alphaClipping.GetValue(mat), Keywords.alphaClipping, mat);
         //No Keyword == No Alpha Clipping
     }
 }
 private void ManageKeywordsLightTransmission()
 {
     //LightTransmission
     foreach (Material mat in _lightTransmission.targets)
     {
         EditorHelper.SetKeyword(Properties.lightTransmission.GetValue(mat) == LightTransmission.Translucent, Keywords.lightTransmission[1], mat);
         EditorHelper.SetKeyword(Properties.lightTransmission.GetValue(mat) == LightTransmission.SubSurfaceScattering, Keywords.lightTransmission[2], mat);
     }
 }
 private void ManageKeywordsThresholdMap()
 {
     //env reflections
     foreach (Material mat in _thresholdMap.targets)
     {
         EditorHelper.SetKeyword(Properties.thresholdMap.GetValue(mat), Keywords.thresholdMap, mat);
         //No Keyword = Reflections Disabled
     }
 }
Beispiel #27
0
 private void ManageKeywordsVertexAnimationMap()
 {
     //Vertex animation map
     foreach (Material mat in _vertexAnimationMap.targets)
     {
         EditorHelper.SetKeyword(Properties.vertexAnimationMap.GetValue(mat) != null, Keywords.vertexAnimationMap, mat);
         //No Keyword = Vertex Animation Map Off
     }
 }
 private void ManageKeywordsSpecularMode()
 {
     //spec highlights
     foreach (Material mat in _specular.targets)
     {
         EditorHelper.SetKeyword(Properties.specular.GetValue(mat) == Specular.Isotropic, Keywords.specular[1], mat);
         EditorHelper.SetKeyword(Properties.specular.GetValue(mat) == Specular.Anisotropic, Keywords.specular[2], mat);
         //No Keyword = Specular Off
     }
 }
 private void ManageKeywordsEnvironmentReflections()
 {
     //env reflections
     foreach (Material mat in _environmentReflections.targets)
     {
         EditorHelper.SetKeyword(Properties.environmentReflections.GetValue(mat) == EnvironmentReflection.Ambient, Keywords.environmentReflections[1], mat);
         EditorHelper.SetKeyword(Properties.environmentReflections.GetValue(mat) == EnvironmentReflection.Advanced, Keywords.environmentReflections[2], mat);
         //No Keyword = Reflections Disabled
     }
 }
 private void ManageKeywordsRim()
 {
     //rim style
     foreach (Material mat in _rim.targets)
     {
         EditorHelper.SetKeyword(Properties.rim.GetValue(mat) == Rim.Default, Keywords.rim[1], mat);
         EditorHelper.SetKeyword(Properties.rim.GetValue(mat) == Rim.Split, Keywords.rim[2], mat);
         //No keyword = rim off
     }
 }