Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

imDivineLight

Do all HeightMapped terrains have Artifacts??

This topic is 5257 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi! i got a nice little scale height map terrain rendering system. Yesterday i implemented repeating textures on it, but i now when i take a closer look on my terrain system i see strange artifacts. There are more triangles being rendered above & below actual terrain. I have implemented many variations, like i first implemented the idea given at TwoKings tutorial then in the book "Introduction To Game Programming with DX9" but all give me those errors. If i disable culling i get very clearly seen distortion in my terrain please help it out. See the screen shot here: http://www.geocities.com/darkengine2d/terrainerror.jpg

Share this post


Link to post
Share on other sites
Advertisement
You need a z-buffer. A z-buffer will organize your polygons so that they''re drawn back-to-front (the proper way).

When you''re filling in your presentation paremeters, make sure you add one like so:


m_D3DPresentationParameters.AutoDepthStencilFormat = D3DFMT_D16;
m_D3DPresentationParameters.EnableAutoDepthStencil = TRUE;


Then enable it before drawing your heightmap.


pD3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
pD3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);


And don''t forget to clear it when you''re clearing your scene.


pD3DDevice->Clear(0,0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0);


Should fix that right up.




Share this post


Link to post
Share on other sites
Did you create one during initialisation when you filled in your presentation parameters too?

If you did, I have no idea then. That just SCREAMS z-buffer / z-fighting to me.

[edited by - GroZZleR on May 29, 2004 3:05:24 PM]

Share this post


Link to post
Share on other sites
Sad, & how to correct that ZFighting,
but i think it is more problem at terrain side, because i have many other objects, skyboxes, walls etc they are all rendered without distortion.

Share this post


Link to post
Share on other sites
Well, two things, first, are those other things multitextured? because that could do it i think, second, i have a radeon, and for wahtever reason, i get artifacts similar to that when playing ut2003, my friend on a geforce (a much lesser geforce i might add) does not get those same artifacts, maybe its got something to do with your card (oh by the way i think it was only with the dx implementation but im not sure)
-Dan

Share this post


Link to post
Share on other sites
Agh, i have Geforce 2, it''s not the card i know something is wrong with the code, if there''s is any real expert out there willing to help i can show him my code

Share this post


Link to post
Share on other sites
Hi there,

unfortunately, the link to the screenshot isn't working, so I can only guess what your problem might be. What are your near/far plane settings? try to increase the near plane and see if that would help. If it doesn't, try using a 32 bit depth buffer.

So long!

[edited by - IH82W8 on May 30, 2004 5:09:44 AM]

Share this post


Link to post
Share on other sites
Are you multi-texturing that terrain? It looks like you might be rendering the terrain in more than one pass, using the same geometry but different textures. Have you tried one pass rendering? Perhaps some code or a link to a demo might be easier for people to see what''s going on.

---------------------------------------

Let''s struggle for our dream of Game!

http://andrewporritt.4t.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!