Hello, i have a problem when use Direct3d to render a scene. If i use OpenGL the problem seems disappear. Here are you are some screenshots:
DirectX
OpenGL
Any idea?
Thanks.
Problem with direct3d
Yeah it's the z-buffer.
do this:
Try scaling all your models down to half their size and reducing your farclipplane much lower (say 500 or 1000). It happens because your DX version is defaulting to 16bit zbuffer and doesn't have enough "resolution" to sort properly
or:
you CAN set a 32 bit zbuffer to stop this but irrlicht itself requires a stencil buffer (your machine/users maching may not have it and fallsback to 16bit which is why you need to ensure it looks good in 16 by doing the first point) - I posted some code in a thread oh here to add 24X8 (no stencil buffer) format that may help.
do this:
Try scaling all your models down to half their size and reducing your farclipplane much lower (say 500 or 1000). It happens because your DX version is defaulting to 16bit zbuffer and doesn't have enough "resolution" to sort properly
or:
you CAN set a 32 bit zbuffer to stop this but irrlicht itself requires a stencil buffer (your machine/users maching may not have it and fallsback to 16bit which is why you need to ensure it looks good in 16 by doing the first point) - I posted some code in a thread oh here to add 24X8 (no stencil buffer) format that may help.
Yeah, i'm the one who just posted the 2 point plan to perfection... I obviously am not the other "guest" who is asking this question.
I forgot to mention you can also move the near clip plane closer (1.0f+) to allow the zbuffer to work on the "Important" parts of the scene with 16bits only - but you have to add a fix (on this forum) to stop the perspective going screwy.
either way, one of these will sort you out - I know because I had exactly the same problem (as did most of irrlicht users) at one time before we learned of the work arounds.
I forgot to mention you can also move the near clip plane closer (1.0f+) to allow the zbuffer to work on the "Important" parts of the scene with 16bits only - but you have to add a fix (on this forum) to stop the perspective going screwy.
either way, one of these will sort you out - I know because I had exactly the same problem (as did most of irrlicht users) at one time before we learned of the work arounds.
I've changed the model size and seems solved the z buffer problem, on the other hand some objects dissappear or start flickering.
look this screenshot
http://adriancuevas.iespana.es/SmashBall2/flicker.bmp
Sorry for the illumination
look this screenshot
http://adriancuevas.iespana.es/SmashBall2/flicker.bmp
Sorry for the illumination
I've changed the model size and seems solved the z buffer problem, on the other hand some objects dissappear or start flickering.
look this screenshot
http://adriancuevas.iespana.es/SmashBall2/flicker.bmp
Sorry for the illumination
look this screenshot
http://adriancuevas.iespana.es/SmashBall2/flicker.bmp
Sorry for the illumination
hmm.. still looks like zubffer probs. OR double rendering. Did you reduce the farclip plane also?
Bear in mind when modeling that you should always give a decent gap between planes anyway as you are asking for trouble. You can use a z-bias in pure DX (not sure if you can access it via irrlicht though) to fine tune the zproblems on close meshes.
How much did you reduce the size by? (don't make them too tiny but just enough to fit into a decent space within near/far clip planes (i.e 500.0f or 1000.0f)
Bear in mind when modeling that you should always give a decent gap between planes anyway as you are asking for trouble. You can use a z-bias in pure DX (not sure if you can access it via irrlicht though) to fine tune the zproblems on close meshes.
How much did you reduce the size by? (don't make them too tiny but just enough to fit into a decent space within near/far clip planes (i.e 500.0f or 1000.0f)
OpenGl is actually worse for me and I don't have the option of setting the Far Clipping plane so close. My environment/model is out in the open and you can see things getting clipped far away. It looks real bad. The models I use also need to keep their scale, I cant move two objects farther from each other. I will also have many users and need to make sure that this runs on multiple machines.
oh my my. what to do?
Many helps would be of goodness,
TomB
oh my my. what to do?
Many helps would be of goodness,
TomB