PDA

View Full Version : 3d rendering - strange curved lines



Warlander
07-25-2013, 04:54 PM
Like in topic. I am making voxel engine based on 16X256X16 tile arrays and encountered strange problem. Screenshots below:

http://screenshooter.net/data/uploads/bh/wb/hmdd.jpghttp://screenshooter.net/data/uploads/fp/am/wlat.jpg
http://screenshooter.net/data/uploads/yj/uo/jijg.jpg

Rendering close to camera is very good, but while looking from a distance artifacts begin to appear. This artifacts are mostly composed of curved lines and rarely straight lines, but when I am moving camera away from the center in straight line something interesting happens:

http://screenshooter.net/data/uploads/vy/wh/zchz.jpg

I don't know what is causing this problem. I already tried using mipmaps and anisotropic filtering, but nothing works (I am not even sure if this is texturing issue or something else). Does anyone have idea why this happens and how can I fix this?

tonyo_au
07-25-2013, 06:50 PM
This is an image moire pattern. It cannot be eliminated only reduced using mipmaps and filtering.

yoyonel
07-26-2013, 01:06 AM
Yep it's a filtering problem.

You need to understand what you do when you're rendering a 'pixel' with your voxel engine.

In a few words, you need to consider a pixel like a mini frustum from the near plane of your camera and your world (voxel world).
So when you render a pixel, you need to considerer the volumic shape of this pixel, and compute the "average" of the volume intersection (with your voxel grid).
With this kind of consideration, you're transform your current (in your voxel engine, right now) pixel "point-sample" to a "area-sample" (frustum -> quad, (truncated) cone -> elipsoid, ...).

Good luck ^^
YoYOOoOo

Rakehell
07-26-2013, 10:06 PM
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);