Anyone know what might be causing this issue?

Started by
4 comments, last by pindrought 5 years, 8 months ago

I'm not sure what the correct terminology is to describe what is happening. In the following video, you will see that the grass quad has one of the tris glitching out towards the end in the far distance.

YOUTUBE VIDEO DEMO

 

Anyone know what might be causing this? Here is a link to the github if it helps. The actual drawing is done in the Graphics.cpp RenderFrame function

GITHUB LINK  (set project to x86 to run or go into the libs folder and extract the x64 archives to run as x64)

 

Edited to Add: To move camera use WASD / Space / Z

Advertisement

Badly chosen near+far planes maybe, seems like z-fighting?

.:vinterberg:.

Agreed, but looks sensible with near:1 far:1000. My guess would be check your binary grass.p3d for perhaps an extra set of indices causing a possible overdraw in that corner. Or maybe, wild shot...I see you started with .obj which is cool, but maybe we have an off by one in the write of those binary files being how .obj is 1=first based instead of 0=first and you may have still have been in that mode when writing the .p3d export code somewhere. The file load code I see and seems good. Maybe double check those thoughts.

I haven't checked your code, but is it possible that your grass mesh is not correct? I noticed that the flickering effect only happens on the left half of the scene. If it was an issue with the far plane, the mesh should be cut of all the way from the left to the right. I once had a similar effect. The source of my problem was that I had two faces/planes sharing the same vertices but facing away from each other (like a sheet of paper would have four vertices at the corners, but there are two different planes using the same vertices facing in opposite directions). I used backface culling and the GPU had a problem in deciding whether it should render the top or the non-existent back.

17 hours ago, vinterberg said:

Badly chosen near+far planes maybe, seems like z-fighting?

Thank you everybody for your responses.

It looks like it may have had something to do with the tip of the grass tris being past the far z plane. I increased the far z plane from 1000 to 2000 and I did not see the issue anymore. Thanks everybody for your help!

This topic is closed to new replies.

Advertisement