You can have a look at this forum thread, where SquaLLio shared a lot of information about shader graph setup in combination with Spine:
Use Premultiplied Alpha when texture packing normal maps?
MichelVictor ha scritto
I tried to create from scratch inside Shader Graph, I almost got everything working except that I didn't find a way to use Diffuse Ramp and normal maps wasn't working with the Tangents that spine provide
Regarding tangents you need to enable Advanced
- Add Tangents
and Add Normals
in the SkeletonRenderer
inspector to generate the tangents. Otherwise none will be generated at the mesh, leading to obviously wrong behaviour when accessing the tangents in the shader.
Regarding diffuse ramp: I'm not sure what nodes are available in shader graph, so it might be a bit complicated to cover this feature. What diffuse ramp does is it adds one indirection during lighting: Normally in simple lambert lighting, diffuse light intensity is computed by the angle between the light direction and the normal
float nDotL = dot(n, l);
float lightIntensity = max(0, nDotL); // we don't want the negative [-1..0] part if it's on the other side
which is then multiplied by the light color, then multiplied by the texture color. When using a diffuse ramp, one indirection happens, using a texture lookup which maps the light intensity from [0..1] to [leftmostDiffuseRampPixel .. rightmostDiffuseRampPixel]. This is done by e.g.
float2 rampUVCoords = lightIntensity.xx;
float3 rampedLightColor = texture2D(rampTexture, rampUVCoords);
I'm not sure this makes sense to you, unfortunately this all requires some understanding of shader programming and basic lighting equation math.