- Home /
Rendering problem with opaque objects with the same Mat rendering through each other (Grouped to the same empty object)
Ok so this is going to take a little bit of context, but note beforehand that both the material is set to transparent rendering, so i can turn down the alpha at any time ingame and have the block be transparent.
There exists a Lego building game named Blockland, i'm trying to make my own version from scratch starting having known nothing about unity, and i have to say things are going pretty well sofar, but there are a few problems. Here's what a single 1x1x1 block looks like. For the brick ingame i have the cap, the middle, and the bottom separate, so that there's no ZWriting error with transparent blocks, because reading around i found out that the computer can't properly ZWrite a single transparent model that has visible faces behind visible faces, so ok fine i'll just split the brick into thirds. note that nothing is visible from the inside, the top of the bottom section for instance.
So anyway, Working ingame, i make an empty named "Brick", and in that empty i set another empty called "Graphics" and in that empty i set the top middle and bottom in such a way so that they're perfectly positioned together, and i make a material, set the rendering mode to transparent, and set it to full white with full alpha, when a brick is planted a graphics logic script quickly fades the bricks to whatever color is set, I try it, it works great! Transparent bricks looks great, everything seems perfect. Until you get to a certain height where the other side of the bottom section of Opaque blocks would be visible if you would be able to see it. The highlighted section looks like it should also be displaying that glitch, and i think it use to, but it doesn't seem to now, since the last time i saw the glitch working completely, I accidentally deleted my player prefab and had to remake it from scratch, and changed the pieces of the brick from 3 separate blender files to the same blender file, taking the individual pieces out from the save file and putting them back together manually in the brick, as far as i know, none of that shouldn't change anything.
And i think its part of the same problem so i'll put this here too, the "Ghost Brick" (a ghost version of a brick that is for showing you where and how your brick would place at the current time) Has a similar rendering error with the middle section of brick and only that, when they occupy the same square, the ghost brick won't appear where the middle section of the brick and only the middle section can be seen. I am so stumped by all this, help!
It seems like its all the middle section's fault but i don't know.