public void Init(NprShadowSettings shadowSettings)
 {
     IsSupported();
     string [] shaderNames =
     {
         "Hidden/NPR/ExtractShadows"
     };
     InitMaterials(shaderNames);
     this.shadowSettings = shadowSettings;
 }
Example #2
0
    public void RenderEdgesShadows(RenderTexture color, Texture shadowMap, Texture edgeMap, Texture background, RenderTexture destination,
                                   NprShadowSettings shadowSettings, Color edgeColor, bool useBackgroundColor = true)
    {
        if (shadowMap != null)
        {
            materials[EDGES_SHADOWS].SetTexture("_ShadowImageTex", shadowMap);
        }
        shadowSettings.ApplyToMaterial(materials[EDGES_SHADOWS], false);
        if (background != null)
        {
            materials[EDGES_SHADOWS].SetTexture("_BackGroundTex", background);
        }
        materials[EDGES_SHADOWS].SetTexture("_EdgeMapTex", edgeMap);
        materials[EDGES_SHADOWS].SetColor("_edgeColor", edgeColor);
        materials[EDGES_SHADOWS].SetInt("_useBackgroundEdgeColor", useBackgroundColor ? 1:0);

        RenderEffect(color, destination, EDGES_SHADOWS);
    }
Example #3
0
    public void RenderAll(RenderTexture color, Texture shadowMap, Texture edgeMap, RenderTexture destination, NprShadowSettings shadowSettings, Color edgeColor)
    {
        if (shadowMap != null)
        {
            materials[ALL].SetTexture("_ShadowImageTex", shadowMap);
        }
        shadowSettings.ApplyToMaterial(materials[ALL], false);
        materials[ALL].SetTexture("_EdgeMapTex", edgeMap);
        materials[ALL].SetColor("_edgeColor", edgeColor);

        RenderEffect(color, destination, ALL);
    }
Example #4
0
    public void RenderShadows(RenderTexture color, Texture shadowMap, RenderTexture destination, NprShadowSettings shadowSettings)
    {
        if (shadowMap != null)
        {
            materials[SHADOWS].SetTexture("_ShadowImageTex", shadowMap);
        }
        shadowSettings.ApplyToMaterial(materials[SHADOWS], false);

        RenderEffect(color, destination, SHADOWS);
    }