Page 1 of 1

Problem with direct3d

Posted: Tue Feb 28, 2006 10:00 am
by Guest
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 Image
OpenGLImage

Any idea?
Thanks.

Posted: Tue Feb 28, 2006 10:16 am
by sdi2000
it looks like a zbuffer problem
try to increase the lod of the cam

Posted: Tue Feb 28, 2006 10:44 am
by Guest
Thank you for answering so fast.
I also think that it's a zbuffer problem but I don't know how to solve it.
I've looked up for the lod of the cam in the specification but I didn't find anything.
Could you tell me how can I increase it please?
Thank you again :D

Posted: Tue Feb 28, 2006 10:44 am
by Guest
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.

Posted: Tue Feb 28, 2006 10:50 am
by guest(again)
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.

Posted: Tue Feb 28, 2006 11:24 am
by Guest
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 :oops:

Posted: Tue Feb 28, 2006 11:24 am
by Guest
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 :oops:

Posted: Wed Mar 01, 2006 10:11 am
by guest(again)
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)

Posted: Tue Apr 11, 2006 3:08 am
by TomB
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