- Home /
Png Surfaces transparent overlapping
Hey there,
I didn't find any solution after many researche, maybe there is a chance here : my issue is that i need to use a transparent shader for rendering my 'cut out' style character here ( and not an opaque shader with Alpha clip ). But as you can see it's creating overlapping problem.
There is a way to avoid that ? a setup ?
even if i need to script something for that no worries i'm open to any solution. Thanks !!!
Answer by BastianUrbach · May 04, 2021 at 08:39 AM
This is a classic problem in computer graphics. When drawing opaque objects (including objects with alpha clipping), visibility is determined using the Z-buffer, which stores the depth of each pixel so that when an object is drawn, you can just compare the new depth with the old one and only draw a pixel if the new depth is smaller. With transparency it's not that simple because all layers have an effect on the final color and their order matters. Sorting individual faces by depth is slow so many engines only sort objects instead. Try splitting your character into one object per layer and place the origin of each layer at the same x and y position but at the correct z position for the layer (assuming your planes are parallel to the xy-plane). This should result in correct back to front sorting of layers.