Problem with direct3d

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Guest

Problem with direct3d

Post 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.
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Post by sdi2000 »

it looks like a zbuffer problem
try to increase the lod of the cam
Guest

Post 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
Guest

Post 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.
guest(again)

Post 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.
Guest

Post 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:
Guest

Post 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:
guest(again)

Post 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)
TomB
Posts: 12
Joined: Wed Jan 25, 2006 11:52 pm
Location: Melbourne
Contact:

Post 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
Post Reply