public Material GetBlurLight()
 {
     if (blur_light == null || blur_light.Get() == null)
     {
         blur_light = LightingMaterial.Load("Light2D/Internal/BlurLight");
     }
     return(blur_light.Get());
 }
 public Material GetRoomMultiply()
 {
     if (roomMultiply == null || roomMultiply.Get() == null)
     {
         roomMultiply = LightingMaterial.Load("Light2D/Internal/RoomMultiply");
     }
     return(roomMultiply.Get());
 }
 public Material GetBumpedDaySprite()
 {
     if (bumpedDaySprite == null || bumpedDaySprite.Get() == null)
     {
         bumpedDaySprite = LightingMaterial.Load("Light2D/Internal/DayBump");
     }
     return(bumpedDaySprite.Get());
 }
 public Material GetSoftShadow()
 {
     if (softShadow == null || softShadow.Get() == null)
     {
         softShadow = LightingMaterial.Load("Light2D/Internal/SoftShadow");
     }
     return(softShadow.Get());
 }
 public Material GetNormalMapSpriteObjectToLight()
 {
     if (normalObjectToLightSprite == null || normalObjectToLightSprite.Get() == null)
     {
         normalObjectToLightSprite = LightingMaterial.Load("Light2D/Internal/NormalMapObjectToLight");
     }
     return(normalObjectToLightSprite.Get());
 }
 public Material GetMask()
 {
     if (mask == null || mask.Get() == null)
     {
         mask = LightingMaterial.Load("Light2D/Internal/Mask");
     }
     return(mask.Get());
 }
 public Material GetRoomMask()
 {
     if (roomMask == null || roomMask.Get() == null)
     {
         roomMask = LightingMaterial.Load("Light2D/Internal/RoomMask");
     }
     return(roomMask.Get());
 }
 public Material GetBlurMask()
 {
     if (blur_mask == null || blur_mask.Get() == null)
     {
         blur_mask = LightingMaterial.Load("Light2D/Internal/BlurMask");
     }
     return(blur_mask.Get());
 }
 public Material GetAdditive()
 {
     if (additive == null || additive.Get() == null)
     {
         additive = LightingMaterial.Load("Light2D/Internal/Additive");
     }
     return(additive.Get());
 }
    public Material GetSpriteProjectionMaterial()
    {
        if (spriteProjection == null || spriteProjection.Get() == null)
        {
            spriteProjection = LightingMaterial.Load("Light2D/Internal/SpriteProjection");
        }

        return(spriteProjection.Get());
    }
    public Material GetShadowBlur()
    {
        if (shadowBlur == null || shadowBlur.Get() == null)
        {
            shadowBlur = LightingMaterial.Load("Light2D/Internal/AlphaBlended");

            shadowBlur.SetTexture("textures/shadowblur");
        }
        return(shadowBlur.Get());
    }
    public Material GetAlphaBlend()
    {
        if (alphablend == null || alphablend.Get() == null)
        {
            alphablend = LightingMaterial.Load("Light2D/Internal/AlphaBlended");

            alphablend.SetTexture("textures/white");
        }
        return(alphablend.Get());
    }
    public Material GetAtlasMaterial()
    {
        if (atlasMaterial == null || atlasMaterial.Get() == null)
        {
            atlasMaterial = LightingMaterial.Load("Light2D/Internal/AlphaBlended");
        }

        atlasMaterial.SetTexture(AtlasSystem.Manager.GetAtlasPage().GetTexture());

        return(atlasMaterial.Get());
    }
 public Material GetMultiplyHDR()
 {
     if (multiplyHDR == null || multiplyHDR.Get() == null)
     {
         if (hdr == true)
         {
             multiplyHDR = LightingMaterial.Load("Light2D/Internal/Multiply HDR");
         }
         else
         {
             multiplyHDR = LightingMaterial.Load("Light2D/Internal/Multiply");
         }
     }
     return(multiplyHDR.Get());
 }
    public Material GetOcclusionBlur()
    {
        if (occlusionBlur == null || occlusionBlur.Get() == null)
        {
            if (hdr == true)
            {
                occlusionBlur = LightingMaterial.Load("Light2D/Internal/Multiply HDR");
            }
            else
            {
                occlusionBlur = LightingMaterial.Load("Light2D/Internal/Multiply");
            }

            occlusionBlur.SetTexture("textures/occlussionblur");
        }
        return(occlusionBlur.Get());
    }
    public Material GetLight()
    {
        if (light == null || light.Get() == null)
        {
            light = LightingMaterial.Load("Light2D/Internal/Light");
        }

        if (Lighting2D.ProjectSettings.colorSpace == LightingSettings.ColorSpace.Linear)
        {
            light.Get().SetFloat("_LinearColor", 1);
        }
        else
        {
            light.Get().SetFloat("_ColorSpace", 0);
        }

        return(light.Get());
    }
Example #17
0
    public Material GetMaterial()
    {
        if (material == null || material.Get() == null)
        {
            switch (cameraSettings.renderShader)
            {
            case CameraSettings.RenderShader.MultiplyHDR:

                material = LightingMaterial.Load("Light2D/Internal/Multiply HDR");

                break;

            case CameraSettings.RenderShader.Multiply:

                material = LightingMaterial.Load("Light2D/Internal/Multiply");

                break;

            case CameraSettings.RenderShader.Additive:

                material = LightingMaterial.Load(Max2D.shaderPath + "Particles/Additive");

                break;

            case CameraSettings.RenderShader.Custom:

                material = LightingMaterial.Load(cameraSettings.GetMaterial());

                break;
            }
        }

        material.SetTexture(renderTexture.renderTexture);

        return(material.Get());
    }