MurabitoB / UnitySpriteExtrudeShader

The Unity Standard Rendering Pipeline shader.
MIT License
8 stars 1 forks source link

upper triangles is missing and lit shader issue at unity 2022 #1

Open Bezhok opened 10 months ago

Bezhok commented 10 months ago

Hi. Good plugin but there are few issues(i use unity 2022.3.7f1):

geometric shader doesn't create Upper(usually) triangles. Probably it is intended behaviour(cardboard look) but i fixed it locally there are fixes if someone is looking for it:

[maxvertexcount(24)] //chnaged from 18 to 24
void geom_standard(triangle v2g IN[3],inout TriangleStream<g2f_standard> triStream)

and added to the end of method:

    //Draw Cardboard Side 
    v.pos = UnityObjectToClipPos(v2);
    v.texcoord = float3(v1dtex0,1);
    triStream.Append(v);

    v.pos = UnityObjectToClipPos(v1);
    v.texcoord = float3(v0dtex0,1);
    triStream.Append(v);

    v.pos = UnityObjectToClipPos(v1 + normal);
    v.texcoord = float3(v0dtex1,1);
    triStream.Append(v);

    triStream.RestartStrip();

    v.pos = UnityObjectToClipPos(v1 +  normal);
    v.texcoord = float3(v0dtex1,1);
    triStream.Append(v);

    v.pos = UnityObjectToClipPos(v2 + normal);
    v.texcoord = float3(v1dtex1,1);
    triStream.Append(v);

    v.pos = UnityObjectToClipPos(v2);
    v.texcoord = float3(v1dtex0,1);
    triStream.Append(v);

    triStream.RestartStrip();

shadow casting works fine

lit shader doesn't work at all. just show nothing. changing Tags {"LightMode"="Deferred"} to Tags {"LightMode"="UniversalGBuffer"} doesn't help. if i change to forward rendering i have grey mesh

using frag_lit instead of frag_deffered_lit seams ok for me(at least front and back) but no shadow receiving

Bezhok commented 10 months ago

Tags {"LightMode"="UniversalGBuffer"} + dereffered in urp settings gives white texture