public virtual void SetLightingMaterialKeywords(Material material)
 {
     ShurikenMaster.LightMode lightMode = (ShurikenMaster.LightMode)material.GetInt("_LightMode");
     ShurikenMaster.SetKeyword(material, "VFX_LIGHTING", lightMode == ShurikenMaster.LightMode.DynamicPerPixel);
     ShurikenMaster.SetKeyword(material, "VFX_LIGHTING_VERTEX", lightMode == ShurikenMaster.LightMode.DynamicPerVertex);
     ShurikenMaster.SetKeyword(material, "VFX_LIGHTING_SH", lightMode == ShurikenMaster.LightMode.LightProbeProxyVolume);
 }
Exemplo n.º 2
0
        public override void SetLightingMaterialKeywords(Material material)
        {
            CloudLightMode lightMode = (CloudLightMode)material.GetInt("_LightMode");

            ShurikenMaster.SetKeyword(material, "VFX_LIGHTING", lightMode == CloudLightMode.DynamicPerPixel);
            ShurikenMaster.SetKeyword(material, "VFX_LIGHTING_FAKEDIRECTIONAL", lightMode == CloudLightMode.FakeDirectional);
            ShurikenMaster.SetKeyword(material, "VFX_LIGHTING_RAYMARCH2D", lightMode == CloudLightMode.Raymarch2D);
        }
        public virtual void SetMaterialKeywords(Material material)
        {
            // Note: keywords must be based on Material value not on MaterialProperty due to multi-edit & material animation
            // (MaterialProperty value might come from renderer material property block)
            if (GetCapability(ShurikenMaster.Capabilities.Lighting))
            {
                // For custom lighting models
                SetLightingMaterialKeywords(material);
            }

            if (GetCapability(ShurikenMaster.Capabilities.FlipbookBlending))
            {
                ShurikenMaster.SetKeyword(material, "VFX_FLIPBOOKBLEND", material.GetFloat("_EnableFlipbookBlending") == 1.0f);
                ShurikenMaster.SetKeyword(material, "VFX_FLIPBOOKBLEND_OFLOW", material.GetFloat("_EnableOFlowBlending") == 1.0f);
            }

            if (GetCapability(ShurikenMaster.Capabilities.SoftParticles))
            {
                ShurikenMaster.SetKeyword(material, "VFX_DEPTHFADING", material.GetFloat("_SoftParticle") == 1.0f);
            }

            if (GetCapability(ShurikenMaster.Capabilities.CameraFading))
            {
                ShurikenMaster.SetKeyword(material, "VFX_CAMERAFADING", material.GetFloat("_CameraFade") == 1.0f);
            }

            if (GetCapability(ShurikenMaster.Capabilities.UseNormalMap))
            {
                ShurikenMaster.SetKeyword(material, "VFX_USENORMALMAP", material.GetTexture("_NormalMap") != null);
            }
            if (GetCapability(ShurikenMaster.Capabilities.SwitchColorSource))
            {
                ShurikenMaster.SetKeyword(material, "COLORSOURCE_RGBA", material.GetInt("_ColorSetup") == 0);
                ShurikenMaster.SetKeyword(material, "COLORSOURCE_ALPHA", material.GetInt("_ColorSetup") == 1);
                ShurikenMaster.SetKeyword(material, "COLORSOURCE_ALTERNATEALPHA", material.GetInt("_ColorSetup") == 2);
            }
        }