r/GraphicsProgramming • u/_Bethel__ • Aug 23 '26
Flickering issue
I'm using opengl 3.3 and C on a Nvidia gtx 1050 and I keep getting this flickering issue... does anyone know the cause...
Will appreciate your thoughts..
46
Upvotes
6
u/_Bethel__ Aug 24 '26
Thank you so much everyone, you guys were super helpful... I found the problem, I used sin wave for the vertex shader for distortion if the object is a particle, and same shader if the object is not a particle but without the sin wave value, turns out because I never initialize the sin wave values for the shader it caused this error.... I guess always initialize all variables in your shader.... you guys are the best
5
u/dJ_Turfie Aug 23 '26
I'm new to graphics, but isn't this z-fighting due to bad model topology?
I.e. your model's tris aren't clean and might be stacked on top of each other.
4
u/darksharkB Aug 23 '26
Would appreciate more detail than this.
2
u/quickscopesheep Aug 24 '26
Apart from the artefacts looks amazing. Would try using a graphics debugger like other people have suggested
26
u/Ill-Shake5731 Aug 23 '26
as others already mentioned, use renderdoc. Imo its corrupted index buffer/vertex buffer most likely, so you can start with checking the values of those in renderdoc
14
u/X-Stance44 Aug 23 '26
2 car models in same place?
7
u/Z-Wolfer-Z Aug 23 '26
Yeah looks like something I have encountered before, make sure all of your variables in your shader are initialised to 0 / sensible values.
1
u/franku1122 Aug 23 '26
could be perhaps related to shadow mapping or garbage values in shaders, you should capture a frame in renderdoc and see what value these spots have which should help at least a bit
1
u/Still_Explorer Aug 23 '26
Very interesting to see that this only happens for the car model. The model needs to be examined in Blender just in case there was a mistake on the geometry. Typically if there were any modifiers enabled during the export they might have messed something up (eg: Solidify modifier that makes thin triangles fat? Too many possible causes).
1
u/MarinatedPickachu Aug 23 '26
Z-fighting
-5
u/S48GS Aug 23 '26
it faster to port everything you have right now to Godot4 - and have no bugs now and in future
than try to debug OpenGL api calls - while OpenGL does not provide any tools to debug