Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

ALPHAMASK #2572

Open
1vanK opened this issue Jan 25, 2020 · 4 comments
Open

ALPHAMASK #2572

1vanK opened this issue Jan 25, 2020 · 4 comments

Comments

@1vanK
Copy link
Contributor

1vanK commented Jan 25, 2020

LitSolid.glsl

        vec4 diffInput = texture2D(sDiffMap, vTexCoord.xy);
        #ifdef ALPHAMASK
            if (diffInput.a < 0.5)
                discard;
        #endif
        vec4 diffColor = cMatDiffColor * diffInput;

Unlit.glsl

        vec4 diffColor = cMatDiffColor * texture2D(sDiffMap, vTexCoord);
        #ifdef ALPHAMASK
            if (diffColor.a < 0.5)
                discard;
        #endif

if cMatDiffColor.a == 0 then Unlit discard pixels, but LitSolid do not discard

@igorsegallafa
Copy link
Contributor

Shouldn't discard to shader without ALPHAMASK define too? Because if cMatDiffColor.a == 0, this means that the object is supposed to be invisible, right? 🤔

@1vanK
Copy link
Contributor Author

1vanK commented Feb 5, 2020

Most techniques (Diff.xml for example) do not use alpha pass and objet should be visible even with .a == 0 (if ALPHAMASK is not defined ofc)

@eugeneko
Copy link
Contributor

eugeneko commented Feb 6, 2020

Shouldn't discard to shader without ALPHAMASK define too?

discard is not free. And if you have cMatDiffColor.a == 0, you shouldn't draw this object in first place.

@github-actions
Copy link

github-actions bot commented Mar 9, 2020

Marking this stale since there has been no activity for 30 days.
It will be closed if there is no activity for another 15 days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants