- Edited
Spine Shader Template for Amplify?
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?
Hana wroteNoticed 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 bycolor.A
. You then also need handle the division by 0, e.g. by checking ifcolor.A
is 0 first and then using 1 instead of 0 for the division.
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.
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
我怎么才能再URP的环境下使用Amplify Shader Editor.,上面的那个模板我尝试了下不适合在URP的环境中使用
那么从工作的 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.
@dokeng @Hana We're very sorry to say that due to a server update, some attachments of old forum posts that were attached directly to postings but not mentioned in-line have been lost in the update process. While we have taken measures to restore them and prevent this issue from happening in the future, it unfortunately seems like the lost attachments indeed could not be recovered.
Thus it would be great if @Hana could be so kind as to re-upload the amplify template. Sorry for the troubles!