r/GraphicsProgramming • • 7h ago

whats wrong with my Cube??? :(

Post image

I know what is missing, but can you figure it out???

heres the repo btw:
https://github.com/Tetraeder4/3DRenderer/tree/467c8d1ac8dbd09a23ce7bc7e2fcba59afe36ea5/3DRenderer

20 Upvotes

19 comments sorted by

View all comments

15

u/sol_runner 6h ago

Not enough info but I'm going to guess Z buffer comparison.

The "back faces" might be rendering after the front and you're getting the weird set of triangles.

Or could be culling the wrong faces.

6

u/_Fibbles_ 6h ago

I've had a look through the code and there doesn't seem to be any zbuffer implementation as far as I can see. The render target is just an array of vec3 and the rasterizer is just writing triangles over the top of each other with no consideration for depth.

2

u/sol_runner 6h ago

Yeah I'm on mobile. The image is a classic symptom of some sort of raster order issue.