void DoSubsurfaceArea()
 {
     MGUI.PropertyGroup(() => {
         me.ShaderProperty(subsurface, "Enable");
         MGUI.ToggleGroup(subsurface.floatValue == 0);
         MGUI.PropertyGroupLayer(() => {
             MGUI.SpaceN1();
             me.TexturePropertySingleLine(Tips.thicknessMapText, thicknessMap, thicknessMap.textureValue ? thicknessMapPower : null);
             if (thicknessMap.textureValue)
             {
                 MGUI.TexPropLabel("Power", 94);
             }
             me.ShaderProperty(scatterCol, Tips.scatterCol);
             me.ShaderProperty(scatterAlbedoTint, Tips.scatterAlbedoTint);
             MGUI.Space8();
             me.ShaderProperty(scatterIntensity, Tips.scatterIntensity);
             me.ShaderProperty(scatterAmbient, Tips.scatterAmbient);
             me.ShaderProperty(scatterPow, Tips.scatterPow);
             me.ShaderProperty(scatterDist, Tips.scatterDist);
             me.ShaderProperty(wrappingFactor, Tips.wrappingFactor);
             MGUI.SpaceN2();
         });
         MGUI.ToggleGroupEnd();
     });
 }
 void DoFilteringArea()
 {
     MGUI.PropertyGroup(() => {
         me.ShaderProperty(filtering, "Enable");
         MGUI.ToggleGroup(filtering.floatValue == 0);
         MGUI.BoldLabel("Base Color");
         MGUI.PropertyGroupLayer(() => {
             MGUI.SpaceN1();
             me.ShaderProperty(hue, "Hue");
             me.ShaderProperty(saturation, "Saturation");
             me.ShaderProperty(brightness, "Brightness");
             me.ShaderProperty(contrast, "Contrast");
             MGUI.SpaceN2();
         });
         MGUI.Space4();
         MGUI.BoldLabel("Detail Color");
         MGUI.PropertyGroupLayer(() => {
             MGUI.SpaceN1();
             me.ShaderProperty(hueDet, "Hue");
             me.ShaderProperty(saturationDet, "Saturation");
             me.ShaderProperty(brightnessDet, "Brightness");
             me.ShaderProperty(contrastDet, "Contrast");
             MGUI.SpaceN2();
         });
         if (emissionEnabled)
         {
             MGUI.Space4();
             MGUI.BoldLabel("Emission Color");
             MGUI.PropertyGroupLayer(() => {
                 MGUI.SpaceN1();
                 me.ShaderProperty(hueEmiss, "Hue");
                 me.ShaderProperty(saturationEmiss, "Saturation");
                 me.ShaderProperty(brightnessEmiss, "Brightness");
                 me.ShaderProperty(contrastEmiss, "Contrast");
                 MGUI.SpaceN2();
             });
         }
         MGUI.Space4();
         MGUI.BoldLabel("Global Color");
         MGUI.PropertyGroupLayer(() => {
             MGUI.SpaceN1();
             me.ShaderProperty(huePost, "Hue");
             me.ShaderProperty(saturationPost, "Saturation");
             me.ShaderProperty(brightnessPost, "Brightness");
             me.ShaderProperty(contrastPost, "Contrast");
             MGUI.SpaceN2();
         });
         MGUI.ToggleGroupEnd();
     });
 }
 void DoRimArea()
 {
     MGUI.PropertyGroup(() => {
         me.ShaderProperty(rimTog, "Enable");
         MGUI.ToggleGroup(rimTog.floatValue == 0);
         MGUI.PropertyGroupLayer(() => {
             MGUI.SpaceN2();
             me.ShaderProperty(rimBlend, Tips.rimBlend);
             me.ShaderProperty(rimCol, Tips.rimCol);
             me.ShaderProperty(rimStr, Tips.rimStr);
             me.ShaderProperty(rimWidth, Tips.rimWidth);
             me.ShaderProperty(rimEdge, Tips.rimEdge);
             MGUI.SpaceN2();
         });
         MGUI.ToggleGroupEnd();
     });
 }
 void DoEmissionArea(Material material)
 {
     if (me.EmissionEnabledProperty())
     {
         emissionEnabled = true;
         bool hadEmissionTexture = emissionMap.textureValue != null;
         MGUI.ToggleGroup(!emissionEnabled);
         MGUI.PropertyGroupLayer(() => {
             MGUI.SpaceN2();
             me.LightmapEmissionFlagsProperty(0, true);
             me.ShaderProperty(audioLinkEmission, Tips.audioLinkEmission);
             me.ShaderProperty(emissPulseWave, Tips.emissPulseWave);
             if (audioLinkEmission.floatValue > 0)
             {
                 me.ShaderProperty(audioLinkEmissionStrength, Tips.audioLinkEmissionStrength);
             }
             if (emissPulseWave.floatValue > 0)
             {
                 me.ShaderProperty(emissPulseStrength, Tips.emissPulseStrength);
                 me.ShaderProperty(emissPulseSpeed, Tips.emissPulseSpeed);
             }
             MGUI.Space2();
             me.TexturePropertySingleLine(Tips.emissionText, emissionMap, emissionColorForRendering, emissIntensity);
             MGUI.TexPropLabel("Intensity", 105);
             MGUI.SpaceN2();
             me.TexturePropertySingleLine(Tips.maskText, emissionMask);
             MGUI.SpaceN4();
         });
         MGUI.ToggleGroupEnd();
         float brightness = emissionColorForRendering.colorValue.maxColorComponent;
         if (emissionMap.textureValue != null && !hadEmissionTexture && brightness <= 0f)
         {
             emissionColorForRendering.colorValue = Color.white;
         }
     }
     else
     {
         emissionEnabled = false;
     }
 }
    void DoRenderingArea(Material mat)
    {
        MGUI.PropertyGroup(() => {
            MGUI.PropertyGroupLayer(() => {
                MGUI.SpaceN2();
                if (samplingMode.floatValue != 4)
                {
                    me.ShaderProperty(culling, Tips.culling);
                }
                queueOffset.floatValue = (int)queueOffset.floatValue;
                me.ShaderProperty(queueOffset, Tips.queueOffset);
                MGUI.SpaceN1();
                MGUI.DummyProperty("Render Queue:", mat.renderQueue.ToString());
                MGUI.SpaceN4();
            });
            MGUI.Space1();
            MGUI.PropertyGroupLayer(() => {
                MGUI.SpaceN2();
                MGUI.ToggleFloat(me, Tips.useFresnel, useFresnel, fresnelStrength);
                MGUI.ToggleFloat(me, Tips.highlightsText, highlights, specularStrength);
                MGUI.ToggleFloat(me, Tips.reflectionsText, reflections, reflectionStrength);
                MGUI.ToggleFloat(me, Tips.ssrText, ssr, ssrStrength);
                if (ssr.floatValue == 1)
                {
                    me.ShaderProperty(edgeFade, Tips.edgeFadeText);
                }
                MGUI.ToggleFloat(me, Tips.reflVertexColor, reflVertexColor, reflVertexColorStrength);
                MGUI.ToggleFloat(me, Tips.reflShadows, reflShadows, reflShadowStrength);
                if (reflShadows.floatValue == 1)
                {
                    me.ShaderProperty(brightnessReflShad, "Brightness", 1);
                    me.ShaderProperty(contrastReflShad, "Contrast", 1);
                    me.ShaderProperty(hdrReflShad, "HDR", 1);
                }
                MGUI.ToggleFloat(me, Tips.gsaa, gsaa, gsaaStrength);
            });
            MGUI.Space1();
            MGUI.PropertyGroupLayer(() => {
                MGUI.SpaceN3();
                me.ShaderProperty(_BakeryMode, Tips.bakeryMode);
                me.ShaderProperty(_BAKERY_SHNONLINEAR, "Bakery Non-Linear SH");
                me.ShaderProperty(_BAKERY_LMSPEC, "Bakery Lightmap Specular");
                me.ShaderProperty(bicubicLightmap, Tips.bicubicLightmap);
                                #if LTCGI_INCLUDED
                me.ShaderProperty(ltcgi, "LTCGI");
                if (ltcgi.floatValue == 1)
                {
                    me.ShaderProperty(ltcgi_spec_off, "LTCGI Disable Specular");
                    me.ShaderProperty(ltcgi_diffuse_off, "LTCGI Disable Diffuse");
                }
                                #else
                ltcgi.floatValue = 0;
                mat.DisableKeyword("LTCGI");
                                #endif
                me.EnableInstancingField();
                MGUI.SpaceN2();
                me.DoubleSidedGIField();
                MGUI.SpaceN3();
            });

            if (ssr.floatValue == 1)
            {
                MGUI.DisplayInfo("\nScreenspace reflections in VRChat requires the \"Depth Light\" prefab found in: Assets/Mochie/Unity/Prefabs\n\nIt is also is VERY expensive, please use it sparingly!\n");
            }
            MGUI.Space1();
            // me.TexturePropertySingleLine(new GUIContent("RNM0"), _RNM0);
            // me.TexturePropertySingleLine(new GUIContent("RNM1"), _RNM1);
            // me.TexturePropertySingleLine(new GUIContent("RNM2"), _RNM2);
        });
    }
    void DoUVArea()
    {
        bool needsHeightMaskUV = (((workflow.floatValue > 0 && useHeight.floatValue == 1) || (workflow.floatValue == 0 && heightMap.textureValue)) && parallaxMask.textureValue) && samplingMode.floatValue < 3;
        bool needsEmissMaskUV  = emissionEnabled && emissionMask.textureValue;
        bool needsAlphaMaskUV  = blendMode.floatValue > 0 && useAlphaMask.floatValue > 0;

        MGUI.PropertyGroup(() => {
            MGUI.BoldLabel("Primary");
            EditorGUI.BeginChangeCheck();
            MGUI.PropertyGroupLayer(() => {
                MGUI.SpaceN2();
                if (samplingMode.floatValue < 3)
                {
                    me.ShaderProperty(uvPri, Tips.uvSetLabel.text);
                    MGUI.TextureSOScroll(me, albedoMap, uv0Scroll);
                }
                else
                {
                    MGUI.TextureSO(me, albedoMap);
                }
                if (EditorGUI.EndChangeCheck())
                {
                    emissionMap.textureScaleAndOffset = albedoMap.textureScaleAndOffset;
                }
                me.ShaderProperty(uv0Rot, "Rotation");
                MGUI.SpaceN2();
            });
            MGUI.Space4();
            MGUI.BoldLabel("Detail");
            MGUI.PropertyGroupLayer(() => {
                MGUI.SpaceN2();
                if (samplingMode.floatValue < 3)
                {
                    me.ShaderProperty(uvSetSecondary, Tips.uvSetLabel.text);
                    MGUI.TextureSOScroll(me, detailAlbedoMap, uv1Scroll);
                }
                else
                {
                    MGUI.TextureSO(me, detailAlbedoMap);
                }
                me.ShaderProperty(uv1Rot, "Rotation");
                me.ShaderProperty(detailSamplingMode, Tips.detailSamplingMode);
                MGUI.SpaceN4();
            });
            if (needsHeightMaskUV)
            {
                MGUI.Space4();
                MGUI.BoldLabel("Height Mask");
                MGUI.PropertyGroupLayer(() => {
                    MGUI.SpaceN2();
                    me.ShaderProperty(uvHeightMask, Tips.uvSetLabel.text);
                    MGUI.TextureSOScroll(me, parallaxMask, uv2Scroll);
                    MGUI.SpaceN2();
                });
            }
            if (needsEmissMaskUV)
            {
                MGUI.Space4();
                MGUI.BoldLabel("Emission Mask");
                MGUI.PropertyGroupLayer(() => {
                    MGUI.SpaceN2();
                    me.ShaderProperty(uvEmissMask, Tips.uvSetLabel.text);
                    MGUI.TextureSOScroll(me, emissionMask, uv3Scroll);
                    me.ShaderProperty(uv3Rot, "Rotation");
                    MGUI.SpaceN2();
                });
            }
            if (needsAlphaMaskUV)
            {
                MGUI.Space4();
                MGUI.BoldLabel("Alpha Mask");
                MGUI.PropertyGroupLayer(() => {
                    MGUI.SpaceN2();
                    me.ShaderProperty(uvAlphaMask, Tips.uvSetLabel.text);
                    MGUI.TextureSOScroll(me, alphaMask, uv4Scroll);
                    me.ShaderProperty(uv4Rot, "Rotation");
                    MGUI.SpaceN2();
                });
            }
        });
    }
 void DoPrimaryArea(Material material)
 {
     MGUI.PropertyGroup(() => {
         me.TexturePropertySingleLine(Tips.albedoText, albedoMap, albedoColor);
         if (useAlphaMask.floatValue == 1 && blendMode.floatValue > 0)
         {
             me.TexturePropertySingleLine(Tips.alphaMaskText, alphaMask, alphaMaskOpacity, alphaMaskChannel);
         }
         GUIContent roughLabel    = Tips.roughnessText;
         GUIContent roughStrLabel = Tips.roughnessPackedText;
         if (useSmoothness.floatValue == 1)
         {
             roughLabel.text    = "Smoothness";
             roughStrLabel.text = "Smoothness Strength";
         }
         else
         {
             roughLabel.text    = "Roughness";
             roughStrLabel.text = "Roughness Strength";
         }
         if (workflow.floatValue == 1)
         {
             me.TexturePropertySingleLine(Tips.packedMapText, packedMap);
             MGUI.sRGBWarning(packedMap);
             if (packedMap.textureValue)
             {
                 MGUI.PropertyGroupLayer(() => {
                     MGUI.SpaceN3();
                     me.ShaderProperty(metallicChannel, "Metallic");
                     me.ShaderProperty(roughChannel, roughLabel.text);
                     me.ShaderProperty(occlusionChannel, "Occlusion");
                     if (useHeight.floatValue == 1 && samplingMode.floatValue < 3)
                     {
                         me.ShaderProperty(heightChannel, "Height");
                     }
                     MGUI.SpaceN3();
                 });
                 MGUI.PropertyGroupLayer(() => {
                     MGUI.SpaceN2();
                     MGUI.ToggleSlider(me, Tips.metallicPackedText, metalMult, metallic);
                     MGUI.ToggleSlider(me, roughStrLabel, roughMult, roughness);
                     MGUI.ToggleSlider(me, Tips.occlusionPackedText, occMult, occlusionStrength);
                     if (useHeight.floatValue == 1 && samplingMode.floatValue < 3)
                     {
                         MGUI.ToggleSlider(me, Tips.heightMapPackedText, heightMult, heightMapScale);
                         me.ShaderProperty(steps, Tips.stepsText);
                         me.ShaderProperty(parallaxOfs, Tips.parallaxOfsText);
                     }
                     MGUI.SpaceN2();
                 });
                 MGUI.Space8();
             }
             if (useHeight.floatValue == 1 && samplingMode.floatValue < 3)
             {
                 me.TexturePropertySingleLine(Tips.heightMaskText, parallaxMask);
             }
         }
         else
         {
             me.TexturePropertySingleLine(Tips.metallicMapText, metallicMap, metallic);
             MGUI.sRGBWarning(metallicMap);
             me.TexturePropertySingleLine(roughLabel, roughnessMap, roughness);
             MGUI.sRGBWarning(roughnessMap);
             me.TexturePropertySingleLine(Tips.occlusionText, occlusionMap, occlusionMap.textureValue ? occlusionStrength : null);
             MGUI.sRGBWarning(occlusionMap);
             if (samplingMode.floatValue < 3)
             {
                 me.TexturePropertySingleLine(Tips.heightMapText, heightMap, heightMap.textureValue ? heightMapScale : null);
                 MGUI.sRGBWarning(heightMap);
                 if (heightMap.textureValue)
                 {
                     me.TexturePropertySingleLine(Tips.heightMaskText, parallaxMask);
                     me.ShaderProperty(steps, Tips.stepsText, 2);
                     me.ShaderProperty(parallaxOfs, Tips.parallaxOfsText, 2);
                 }
             }
         }
         me.TexturePropertySingleLine(Tips.normalMapText, bumpMap, bumpMap.textureValue ? bumpScale : null);
         me.TexturePropertySingleLine(Tips.reflOverrideText, reflOverride);
         me.TexturePropertySingleLine(Tips.reflCubeText, reflCube, reflCube.textureValue ? cubeThreshold : null);
         me.TexturePropertySingleLine(Tips.detailMaskText, detailMask, detailMask.textureValue ? detailMaskChannel : null);
         DoEmissionArea(material);
     });
 }