Dynamic Effect

o.greil 3 years ago updated by jackielo 3 years ago 6

Hey there,

I am trying out Shader Weaver and see if I can use it for my project - now from the tutorials the stuff is clear, however I don't need an effect for a specific card, rather I want global effects for cards.

E.g. enchanting  a card would give a electric glow around etc. Since in your tutorials you are always using a base texture (the card itself) - I wonder if i could only make an effect based on the size of the card but without any base image, which I could then apply to all cards and enable in case of enchantment?

Do you have any guidance on how to do this or what would be the most performant way to do this?

Thanks a lot,


Since I am really new to shader I was playing around a bit today... so what I found out now is that I can remove the main texture - and replace this with different card images (?), the effect always stays at the same place... but if I want to make a glowing outside border, I guess I have to make a transparent border around my card (UI image) so I can put the effect on it? Would be great if you could give me a hint on how I would do this best performance wise?

Since I am only using UI for my game... e.g. my card is a image... shall I put another image over it which is a bit larger so I can lay it behind the card and this image will get the shader effect? or rather put the material directly on the card but then I need to have a permanent transparent border around the card to let the effect fit on it.., hope you understand what I mean :D

Thank alot,


Playing around even more... I see applying the material to my card image works fine - so I can just move this effect to all cards I need once they are enchanted - that would work and doesn't cost additional batches - so I guess best performance wise - and I could also share it with other cards?

What I found out is that when using the "Remap" feature of the shader - the base Material (e.g. a cards border) - I can remove after wards in the material view and it doesn't change the shader effect - so the "Remap" only needs this for generating the "path" but afterwards the texture itself wont get used? But why is this texture still in the final materual?

Would be great to get a bit more insights about how this works :)

So far I am impressed by the results!!

Under review

Hi Oliver,

(1) How to apply effects to multiple cards

If cards are same size sprites/Images, just assgin a single material created with Shader Weaver to them, it should works.

(2) Both ways works. It depends on you.

If you only need surrounding effects, it is ok to make another effect below card itself.

If you want effect to interact with card,it is better to have 1 effect per card

(3) You are right, remap node's parent node should not be in the material if it is only use to generate remap texture.

It should be excluded.

This fix will be added in the next update.

Best Regards,

Jackie Lo

I see thanks alot for your explanation :)

One last question for now... the MainTexture or RootTex - I found out when looking at the final material (using a Unity UI Image) I can remove the main texture in the material and the shader still works totally fine? So what is this main texture actually doing in the shader/material itself? It looks like it will only get used if the UI Image "Source Image" field is not used - otherwise it will be replaced by it? - is this the correct assumption?

So to point (2): Ok then I will make an effect below the card. 

-> If it is like mentioned above then I guess in order to make this effect - all I need is a rootTexture with e.g. a transparent 1x1 pixel png image - so that the generated shader will render everything transparent (leaving the UI Image Source Image empty) - then I should only see the shader effect behind it (once I put this new UI image behind the card)?

There seems to be a small bug though in shader weaver. When changing the root Texture and updating the shader the final material will not update the mainTex. I have to replace the maintex in the generated material afterwards manually. Or am I doing something wrong here?

Thanks a lot,



(1) If you assign material to UIImage,  Unity will set sprite used in UIImage  as MainTexture, so it doesnt matter what you set in material. Usually just keep UIImage/Root node use same sprite.

(2) You assign card sprite to Root node as usual, but turn on 'Exclude Root' in setting. Then sprite use by root node will not be displayed.

Perfect thanks a lot :)