- Home /
Shader: 1 Base Texture Overlaid by 1 Transparent Texture.
Trying to write a shader that takes 2 textures. The first is a base layer which only displays RGB data and does not have any transparency. Just a basic diffuse:
The transparent texture is a PNG with an alpha channel:
The transparent texture is overlaid over the baseTexture, in the same exact manner that Photoshop layers work.
The final result would be a diffuse image that looks exactly like these 2 layers would appear in Photoshop:
What's the most basic / fastest way to achieve this in CG shader code?
a-basetexture.jpg
(21.9 kB)
transparentlayer.png
(29.3 kB)
Comment
Add multiple RGBA textures together?
So like this pseudo code:
(colourA.rgb * colourA.alpha) + (colourB.rgb * colourB.alpha)