Striping instead of gradient problem
From far away, I get this striping problem. When I move closer to my ferris wheel, the lineation goes away and it looks as it should. Any suggestions as to what might be the problem is and how I can fix it would be much appreciated.
![[Image: ICGSS005.png]](http://i24.photobucket.com/albums/c11/skeldi/ICGSS005.png)
PS. HIII *waves* I still exist
![[Image: ICGSS005.png]](http://i24.photobucket.com/albums/c11/skeldi/ICGSS005.png)
PS. HIII *waves* I still exist
looks like z-fighting... try pulling your far plane in, or pushing your near plane out.
Also, make sure that your depth buffer has the highest value you can choose. Be very careful with putting polygons either very close together or on top of each other, since this will happen. If they are facing different sides and you don't have cull facing enabled, you can try enabling that as well.
How do I increase the depth buffer's size?
And how would I dynamically set my near/far plane so I'm not clipping wanted things? or... something?
And how would I dynamically set my near/far plane so I'm not clipping wanted things? or... something?
Why is it so pixel-y? I suppose if you have a surface texture, it could also be a moire. So if you have a blending option, try that.
skyhawk Wrote:How do I increase the depth buffer's size?How are you setting up your context? If it's an NSOpenGLView, you can set it from Interface Builder. You'd know how to do it if you were setting it up programatically, so I doubt you're going that rout. If you're using GLUT, look at this function. I don't know how to do it in SDL, since I've never used it. The highest value you can set the depth buffer to is 32 bits.
And how would I dynamically set my near/far plane so I'm not clipping wanted things? or... something?
As for setting near and far plane, adjust your gluPerspective call.
To set the size of the depth-buffer in SDL you do:
You shouldn't need a bigger buffer for a scene like that though, the most likely problem is that you've set your zNear plane to 0.001 or something small like that. The gluPerspective man page says thus:
Try setting your zNear to something larger, like 1.0 or 10.0.
Code:
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 32);You shouldn't need a bigger buffer for a scene like that though, the most likely problem is that you've set your zNear plane to 0.001 or something small like that. The gluPerspective man page says thus:
Quote:Depth buffer precision is affected by the values specified for zNear
and zFar. The greater the ratio of zFar to zNear is, the less effec-
tive the depth buffer will be at distinguishing between surfaces that
are near each other. If
r = zFar/zNear
roughly log2® bits of depth buffer precision are lost. Because r
approaches infinity as zNear approaches 0, zNear must never be set to
0.
Try setting your zNear to something larger, like 1.0 or 10.0.
I am using GLUT (by no free will of my own) I will try what you suggested when I get home and can test.
as for chris ball:
It is pixelly cause I have no anti-aliasing, am using a non-infinitely large window, and the object is constructed of small pipes (pipings are known to be very pixellated when not antialiased).
the off colored, I do not know, but hopefully increasing depth buffer will solve the problem.
as for chris ball:
It is pixelly cause I have no anti-aliasing, am using a non-infinitely large window, and the object is constructed of small pipes (pipings are known to be very pixellated when not antialiased).
the off colored, I do not know, but hopefully increasing depth buffer will solve the problem.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| circular gradient Quartz2D | pj_madrid | 0 | 2,373 |
May 17, 2011 12:24 PM Last Post: pj_madrid |
|

