Hana

Wondering if anyone has made a shader template that works with Amplify Shader Editor.

The reason is I don't know any coding, so using a default UI template in Amplify I altered the material tint to use a "Linearburn" blend mode, as it retains contrast quality much nicer than a multiply blend.

However you can see in the screenshot that tinting leaves darkened seams.
The premultiplied, one, one minus src alpha blend doesn't help when tinted.

Noticed spine shaders don't have this issue but I've had no luck trying to convert them into amplify templates, or make use of the CCincludes texts, with the "straight Alpha Texture" toggle that resolve these issues, as my knowledge inside Visual Studios is all copy paste n pray

Has anyone had any luck with using these shaders with Amplify or know any resources avaliable to do so?
You do not have the required permissions to view the files attached to this post.
User avatar
Hana
  • Posts: 7

Harald

Hana wrote:Noticed spine shaders don't have this issue but I've had no luck trying to convert them into amplify templates, or make use of the CCincludes texts, with the "straight Alpha Texture" toggle that resolve these issues, as my knowledge inside Visual Studios is all copy paste n pray
Thje easiest way to resolve this issue would be to export the atlas textures with straight alpha workflow (Bleed) instead of using PMA workflow (Premultiply alpha). This way you can use standard shader blending.

If you need to keep the PMA textures (for whatever reason): Could you show your current shader setup in Amplify? The part that reads the texture and forwards the read color is the most relevant part here.
You could then either:
  • a) change the output blend mode to fit the PMA color (I see problems here however, depending on how special blend modes like Linearburn work), or
  • b) un-premultiply the read PMA texture color by dividing the color.RGB part by color.A. You then also need handle the division by 0, e.g. by checking if color.A is 0 first and then using 1 instead of 0 for the division.
User avatar
Harald

Harri
  • Posts: 3994

Hana

I'd tried the suggested straight alpha workflow, exporting with bleed and changing to linear colour space but my seams with my shaders got worse. :think:

Fortunately a friend was able to convert one of the spine shaders into an amplify template, so I'm freely able to go ham in amplify now :fiesta: I've attached it in case it's useful to anyone else. Works within the spine shader folder.
You do not have the required permissions to view the files attached to this post.
User avatar
Hana
  • Posts: 7

Harald

Glad to hear you've figured it out, thanks very much for sharing the code!

I have added a link to the official docs pages so that other users can find your posting from there as well:
spine-unity Runtime Documentation: Amplify Shader Editor
User avatar
Harald

Harri
  • Posts: 3994

zlbb110

我怎么才能再URP的环境下使用Amplify Shader Editor.,上面的那个模板我尝试了下不适合在URP的环境中使用
zlbb110
  • Posts: 1

Harald

那么从工作的 URP 兼容的 Amplify 着色器图开始可能会有所帮助。 然后,您可以查看工作和非工作着色器图之间的区别。
It might help to start from a working URP compatible Amplify shader graph then. You could then have a look at what the difference is between the working and the non-working shader graphs.
User avatar
Harald

Harri
  • Posts: 3994


Return to Unity