I am creating my first 3d game in java using the Lightweight Java Game Library and OpenGL.
I'm afraid I have just encountered the first problem so far for wich I can't find the answer on Google, so I decided to ask it here.
I have drawn four textured walls wich represent a house, and this works perfectly fine. However, Now I want to add a door to my house.
A door in my game is an entity wich is rendered as a rectangle just as heigh as a wall but with a door texture on it.
I was hoping that by drawing it later than the wall, it would just 'override' that part of the wall. This was not the case and the door and the wall started z-figting. So now it looks like this:
The door starts to flicker when the camera changes position.
If I disable GL_DEPTH_TEST, it looks fine from the right side, but if I stand on the other side of the house, I'll still see the door through the house, like this:
I understand this can be solved by drawing the part left and the part right of the wall seperately with the wall in between them, but I was hoping there is another way to solve this problem.