AmplifyCreations / AmplifyShaderEditor-Feedback

4 stars 0 forks source link

2D - New 2D Light Texture #113

Open Dawie3565 opened 1 year ago

Dawie3565 commented 1 year ago

see LightTextureNode.cs

using Usage = UnityEditor.ShaderGraph.GraphDelta.GraphType.Usage;

namespace UnityEditor.ShaderGraph.Defs { internal class LightTextureNode : IStandardNode { public static string Name => "LightTexture"; public static int Version => 1;

    public static NodeDescriptor NodeDescriptor => new(
        Version,
        Name,
        functions: new FunctionDescriptor[] {
            new (
                "LightTex0",
                "Out = UnityBuildTexture2DStructNoScale(_ShapeLightTexture0);",
                new ParameterDescriptor[]
                {//TODO: need a light texture type, or a light tetexture REF
                    new ParameterDescriptor("Out", TYPE.Texture2D, Usage.Out)
                }
            ),
            new (
                "LightTex1",
                "Out = UnityBuildTexture2DStructNoScale(_ShapeLightTexture1);",
                new ParameterDescriptor[]
                {
                    new ParameterDescriptor("Out", TYPE.Texture2D, Usage.Out)
                }
            ),
            new (
                "LightTex2",
                "Out = UnityBuildTexture2DStructNoScale(_ShapeLightTexture2);",
                new ParameterDescriptor[]
                {
                    new ParameterDescriptor("Out", TYPE.Texture2D, Usage.Out)
                }
            ),
            new (
                "LightTex3",
                "Out = UnityBuildTexture2DStructNoScale(_ShapeLightTexture3);",
                new ParameterDescriptor[]
                {
                    new ParameterDescriptor("Out", TYPE.Texture2D, Usage.Out)
                }
            ),
        }
    );

    public static NodeUIDescriptor NodeUIDescriptor => new(
        Version,
        Name,
        displayName: "2D Light Texture",
        tooltip: "A 2D Light texture asset.",
        category: "Utility/Input/2D",
        synonyms: new string[0],
        hasPreview: false,
        selectableFunctions: new()
        {
            { "LightTex0", "LightTex0" },
            { "LightTex1", "LightTex1" },
            { "LightTex2", "LightTex2" },
            { "LightTex3", "LightTex3" }
    },
        functionSelectorLabel: "Blend Style",
        parameters: new ParameterUIDescriptor[] {
            new ParameterUIDescriptor(
                name: "Out",
                displayName: "Out",
                tooltip: "selected 2D light texture"
            )
        }
    );
}

}

Dawie3565 commented 1 year ago

Bumping 2D workflow up from 1.9.2.0 to 1.9.1.1

Dawie3565 commented 4 months ago

Bump for user requested

Dawie3565 commented 4 months ago

for reference

[Render2DLightingPass.cs]

Dawie3565 commented 4 months ago

for info from user https://blog.ldev.app/custom-2d-toon-lighting-in-unity-2021-2/

Dawie3565 commented 2 months ago

Bump for more user requests

diogovtx commented 1 month ago

I have no idea what this is about. Please add a proper explanation about this on the original post description.

Dawie3565 commented 1 month ago

@diogovtx unity docs are busted for this link

its a new node needed for 2d Light texture image