Skip to main content
gamedev.net
🔒 Locked

Rendering bug

Started by IndyJones Feb 18, 2003 at 1:05 PM 4 replies 300+ views
Original Post
IndyJones
IndyJones
Hi guys - I''ve the following bug when I try to render my terrain: 1. screen - everything looks ok - let''s go one step nearer 2. screen - what the ... where do these lines come from? 3. screen - much more nearer to the terrain ... totally messed up with lines When go away from the terrain the lines disappear again ... when I move to the terrain the lines appear ... the nearer the more lines come ... I have no ideas where they come from I hope anyone can help me pointing out what causes this mess ... regards
S1CA
S1CA
Assuming no LOD or clipping schemes in YOUR code (try disabling any you do have to check) that are screwing up your vertex or index buffers (not passing enough or the wrong vertices for the current index buffer does stuff like that), some things to check:

D3DFVF_XYZRHW or D3DFVF_XYZ vertices ?
D3DRS_CLIPPING on ?

If XYZRHW and CLIPPING on, ensure your projection matrix is valid.

If CLIPPING off, try turning it on and vice versa.


Anybody been playing with D3DRS_ZBIAS ?


--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
IndyJones
IndyJones
My vertex format:
(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1)

Render states:

d3dDevice->SetRenderState(D3DRS_CLIPPING, FALSE);
d3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
d3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
d3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);

I don''t use LOD, quadtree or any other optimizations. I just fill a vertex buffer (no index buffer) and render it.

Turning culling on/off seems to doesn''t help.
OrangyTang
OrangyTang
quote:
Original post by Anonymous Poster
This could also be caused by what''s called "Z Fighting". If your Z buffer isn''t large enough you tend to get some floating point errors which cause some polygons to be shown in front of others due to the fact they are in relatively close proximity. You have two choices if this is the case, space the poly''s farther apart or increase the zbuffer to something like 32bit.


Complete crap. Firstly this doesnt even slightly look like z-fighting, and even if it did, moving closer would improve matters, not make them worse. Do not spread incorrect information.
IndyJones
IndyJones
Ha! I finally fixed it! Seems the ZBuffer really was the bad boy (well ... I admit I was the bad boy )

thx for your help guys!

[edited by - BrooksWackerman on February 19, 2003 8:55:02 AM]

Topic Locked

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

Sign in to reply to this topic.