Posts

Post not yet marked as solved
2 Replies
1.8k Views
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 setnode.renderingOrder = 1so 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
Posted
by Bartik.
Last updated
.
Post not yet marked as solved
0 Replies
248 Views
Hi, I wonder if anybody of you faced the same. When I build my menu HUD in sksprite scene and use it in overlaySKScene of SceneKitScene, the blend modes seems have some bugs. Alpha is behaving as expected but screen/add blending don't work.. at least to me.. Works well in the editor though, see the picture. I guess it may be problem of contexts. When I use either SceneKit or ARKit, the background is either from camera or my SCeneKitScene.. rendering pipeline doesn't work with the pixels from those different contexts. Wny workaround?
Posted
by Bartik.
Last updated
.