dark99 Posted Thursday at 07:11 PM Share Posted Thursday at 07:11 PM (edited) Hi I wonder if there is a way to solve the problem below. First. In the screenshot, there is a blue cube and a pink cube, and since they are in the exact same X, Z position, there is Z-fighting. Is there a way to make a specific cube always render later? (Like a decal) I want to use this as an object modeling guide (so to speak). If the blue cube is a modeling guide and the pink cube is the actual object that the user is creating, I want the blue cube to be displayed as a semi-transparent overlap of the pink cube, but without Z-fighting even when they are in the exact same position and shape. Second. Is it possible to make the blue cube always appear on top of other objects, regardless of its position, like a visualizer or widget? Edited Thursday at 07:19 PM by dark99 Link to comment
arizmenda Posted yesterday at 07:53 AM Share Posted yesterday at 07:53 AM Hi, dark99! Z-fighting can occur when identical objects share the same coordinates. To minimize this issue, a straightforward and efficient approach is to slightly increase the scale of the object intended to appear on top. Adjusting the scale by as little as 0.00002 is often enough to eliminate the artifact. 2024-11-22 14-51-12.mp4 Will that work for you? Thanks! Link to comment
Amerio.Stephane Posted yesterday at 01:17 PM Share Posted yesterday at 01:17 PM There a few ways to achieve this, I think. The easiest would be if you are using a material inheriting from the mesh_base material: First solution: Set your material State/Geometry Inflation to "Wire". This will slightly offset the mesh vertices, hence preventing Z-fight altogether. Second solution: Set your material Common/Transparency Preset to "Alpha Blend" (even if your mesh is supposed to be fully opaque). This ensures your mesh is rendered after all opaque meshes Then uncheck Common/Options/Depth Test This ensures nothing can obscure your mesh. In fact, it will always appear above all other meshes. If you have other transparent meshes and still see z-fight, you can play with Common/Options/Rendering Order Independently, if you are trying to emulate the Visualizer, you might want to check Common/Transparency/Overlap along with enabling AlphaBlend. This ensures the mesh is not affected by your lights, and will always have the same appearance (aka unlit material). Also, you may want to duplicate your mesh and assign different materials to each duplicate, for example to be able to have "X-Ray vision" through other objects. Link to comment
dark99 Posted 22 hours ago Author Share Posted 22 hours ago (edited) Thanks for the reply. Especially, Amerio.Stephane's solutions are exactly what I wanted. Thanks. Edited 22 hours ago by dark99 Link to comment
Recommended Posts