Skip to main content
GameDev.net gamedev.net
🔒 Locked

I want a bug fixed.

Started by pendragon274 Feb 27, 2011 at 4:31 AM 5 replies 1.2k views
Original Post
pendragon274
pendragon274
I am having a bug in my program, if you would like to help, my project website is: http://www.godsstash.webs.com. The rendering produces jaggedy edges. If you would like more information, or source snippets, post a comment describing the information you want. The images attached to my post show what exactly I am talking about.
pendragon274
pendragon274

I am having a bug in my program, if you would like to help, my project website is: http://www.godsstash.webs.com. The rendering produces jaggedy edges. If you would like more information, or source snippets, post a comment describing the information you want. The images attached to my post show what exactly I am talking about.


On further experimenting, and googling, I find that the jaggedy edges are caused by the resolution of the z buffer, which i have now fixed, the problem is now the front face of both the blocks should be green.
pendragon274
pendragon274

[quote name='Pendragon274' timestamp='1298781066' post='4779526']
I am having a bug in my program, if you would like to help, my project website is: http://www.godsstash.webs.com. The rendering produces jaggedy edges. If you would like more information, or source snippets, post a comment describing the information you want. The images attached to my post show what exactly I am talking about.


On further experimenting, and googling, I find that the jaggedy edges are caused by the resolution of the z buffer, which i have now fixed, the problem is now the front face of both the blocks should be green.
[/quote]

And upon even further research, I have found out how to solve the second problem, perhaps I should not have posted this. Forgive me, I am quite new to this.
jbadams
jbadams
Perhaps you could share your solution to help others who experience the same problem in future! smile.gif
- Jason Astle-Adams
pendragon274
pendragon274

Perhaps you could share your solution to help others who experience the same problem in future! smile.gif


That is a good idea. The jagged edges problem is caused by too large a clipping plane. Not quite sure why, but to fix it, you can reduce the difference between zNear and zFar in your gluPerspective call. Hope this helped!
Tachikoma
Tachikoma
The problem is related to the fixed resolution of the depth buffer on your hardware. For sake of discussion, let's assume the hardware as 16-bit depth buffer, which yields 65536 unique steps per entry. Therefore, when you are defining a depth range [zNear, zFar], that range will be mapped internally to [0, 65535], which implies that smallest depth feature you can discern is roughly (zFar - zNear) / 65536. By increasing the depth range, you are effectively making the accuracy of the depth test worse, because you are stretching the limited depth resolution across a much greater distance. This is a simplistic explanation of the problem, as there could be other factors that affect accuracy. For instance, some hardware use non-linear mapping of the range [zNear, zFar] to [0, 65535] in order to increase the test accuracy for nearby objects, and less accuracy for far objects.
pendragon274
pendragon274
You see, I figured that changing the zNear and the zFar would be the only way to display the projected astronomically large scene. But I see now that the way I need to go about doing that involves rendering in phases, changing the zNear, and zFar for each phase.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.