I’m trying to create two transparent boxes that do not add up alpha values, as you can see in the border area where the alpha values seem to be adding up. My goal is to make the two boxes appear as one.
Can anyone help me with this issue? Please check out the playground link to see the problem.
Is it for your game? I suppose we are not talking about two boxes but rather a number of boxes. Where substract is probably not an option. You could have used the alphaIndex but it won’t work from all angles. Not sure either what OIT could help here. Say your boxes would be made from planes, you could use the stencil, but I don’t know how to make it work on a box mesh. That’s too far fetched for me The solution of an opacity texture would most likely be the easiest and the one a loose graphic designer like me would use. Else, I sure would be happy to read about the expert answer for this @Evgeni_Popov ?
Yes, I went about as far as that. I can also have it ok from above but with one side angle always showing the inner face of the cube. There must be some maths to apply to the function accounting the camera angle to make it work 100%. I’m just not very good with maths
The stencil option is probably the best one. I think you don’t need the material to be transparent anymore with this solution? Your artefacts arise because the material is transparent and because of the order the faces are drawn: the bottom of the cube is drawn first, so when viewed from top, the stencil prevents the other faces to cover it.