I was wondering if it is possible two make a material which has two layers. That is, everything of the image in the foreground should be visible. However in the places in which it is transparent or in case it isn’t filling up the whole plane/Gameobject the background image should be visible. Here’s an example picture:
!(http://
The gray areas would be transparent.)
You can easly create a new shader with shadergraph(if you use HDRP or URP) to do what you need.
Could you show how exactly the code of the shader should look like?
With the shadergraph you wount need to code.
you can just connect multiple nodes with a easly ui
This would require the foreground layer has a alpha channel for controlling what to keep from the foreground
Thank you for your answer.
When I tried to set everything up I had to change my render pipeline which previously wasn’t assigned. After I did that all of my objects in my scene turned purple.
Now I am wondering:
Does it cost more performance if I set the render pipeline?
The different render pipelines do have different feature sets and performance costs.
The URP is designed for low end / devices without compute shader compatibility.
The HDRP is for High end visuals.
If you change from the default pipeline to one of the script able ones you will need to change your materials to use the shaders apportiert for that render pipeline or they will all turn pink/purple.
Performance wise the URP should be the same or faster then the default render pipeline.
There is a upgrade to URP wizzard that should help you to change your project to URP in case that is what you ant to do.
This is in the edit menu:
If you don’t want that you many need to look into shader coding or take a look at tools like “amplify shader editor” the Amplify Shader Editor | Visual Scripting | Unity Asset Store
it supports the default pipeline.
Thank you for your ellaborate answer. I will probably go with URP since it is a mobile game


