Jump to content


Photo

3D Textures From Far Away


  • Please log in to reply
3 replies to this topic

#1 Spirox

Spirox

    GMC Member

  • GMC Member
  • 35 posts
  • Version:GM8

Posted 17 June 2012 - 05:41 PM

I'm pretty advanced with GameMaker's 3D, but I'm stumped here.

Here's a screenshot of a close up view of the game.
http://desmond.image...png&res=landing

Now here's a screenshot of the same game from a far, zoomed out camera. Notice that in some spots, there's a gap between the textures of grass??
http://desmond.image...png&res=landing

What am I missing here? Any help is appreciated.

Again, I'm just trying to get rid of the weird spaces between textures when the camera zooms out.
  • 0

#2 Nebuer

Nebuer

    GMC Member

  • GMC Member
  • 21 posts

Posted 17 June 2012 - 08:53 PM

gamemaker's 3d system is pretty old and crappy, i've encountered this problem a few times on my own and on the forums, and the general advice i have seen given and used myself is just to extend the surfaces buy a small amount when the camera is far away.

If you extend the surfaces too much when close in you'll get too much z-fighting. so basically try and make a 'workaround'

maybe you could draw the grass below the blocks as well, and not draw the dirt walls if there are adjacent blocks and turn culling on, that may also fix the problem
  • 1

#3 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1590 posts
  • Version:GM8.1

Posted 17 June 2012 - 09:43 PM

The problem is z-fighting; each pixel stores its depth in the z-buffer so that it can check whether a pixel drawn later is behind it. The depth values are not spaced evenly though. When near the camera's znear plane, the GFX card can make distinctions between VERY close surfaces; when it's far away, even surfaces a few units apart may occupy the same depth. Fortunately, you can severely reduce this problem by assigning a smaller range for minimum and maximum depth (znear and zfar in d3d_set_projection_ext)

NOTE: Make sure that znear is as large as you can reasonably make it.

Another way to fix the problem is to remove problematic surfaces (You should never see the dirt walls if the blocks touch, so you can remove them)

Edited by Gamer3D, 17 June 2012 - 09:44 PM.

  • 0

#4 Qon

Qon

    GMC Member

  • GMC Member
  • 85 posts

Posted 04 July 2012 - 03:37 PM

Things that you know will be above other stuff but still on the same plane should have lower depth. Lets say a pool of blood on the ground that's drawn separately, the pool of blood should have lower depth than the ground or else the same effect (but much worse) will happen on any distance.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users