Can somebody explain to/help me with transparency when I use custom metal shaders?
Simple shader like this:
fragment float4 fragmentShader(dataOut vertexShaderIn [[stage_in]])
{
// A
// return float4(1.0, 1.0, 1.0, 0.2);
// B premultiplied alpha
return float4(0.2, 0.2, 0.2, 0.2);
}
Won't cause transparency on my simple plane. I also set
node.renderingOrder = 1
so I'm sure plane is rendered when all background is already in place.
A) approach doesn't work as well as B) - premultiplied alpha one. What else I need to do or set to achieve semi-transparent plane in the scene? Why is it so complex? OpenGL shareds simply returned vec4(1, 1, 1, 0.1) and all worked...
Thanks