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, it is for my game and we are talking about a lot of meshes.
To explain, I stream landscape data and stitch it together in real-time. Currently, I solve this issue by using textures that are transparent at the borders.
However, since I am using shader material and transparency (for example, water) for some landscape biomes, I am looking for an alternative solution.
This issue has been a headache for me.
Anyone who solves this issue will become a hero for me
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.