Page 1 of 2

3D Voxel rendering

PostPosted: Sep 6, 2003 @ 7:41pm
by Joost
I'm working on a realtime terrain renderer by using voxels, could be nice to add to your games. I've uploaded a demo with source code and project files at http://www.omnytex.com/pf/fileexchange/fileexchange.asp.
It is still too slow and the quality is not as good as it can be. I'll try to implement fixed point math which should speed it up, and bilinear filtering on the height map and the texture those should drastically improve the quality. Another thing is correcting the fish eye effect.

regards, Joost Bruneel

PostPosted: Sep 7, 2003 @ 3:51am
by Guest

how to build?

PostPosted: Sep 7, 2003 @ 7:21am
by Conan

PostPosted: Sep 7, 2003 @ 10:22am
by Guest

voxels

PostPosted: Sep 7, 2003 @ 12:34pm
by Joost

PostPosted: Sep 7, 2003 @ 2:50pm
by JoostB
There it is, the fixed point version.(http://www.omnytex.com/pf/fileexchange/ ... xel_fp.rar the new file is 'voxeldemo3.cpp'),
it should be possible to copy the whole directory structure to:
'C:\Windows CE Tools\frog\PocketFrog_0_7_0\samples\'.

I'm prety excited right now, cause the rendering speed is really good (iPaq 3850). I used 16:16 fixed point implementation.
There's even possibility for some more optimizing (can get rid of the mult for the rendering in the screen buffer).
If anyone wants some more explanation about the algorithm/math behind it, feel free to contact me.
All right, the speed is there, now let's go for quality ...

PostPosted: Sep 7, 2003 @ 3:10pm
by JoostB
Oops, serious bug in the code,
fixed it, the patch can also be found at the download site.
The alg must remember for each column the highest span drawn (top screen row), by mistake a overwrote the maximum everytime with values that were sometimes too low, explaining the mountains that seemed to dance up and down.
It is even a bit faster now.

Voxel demo

PostPosted: Sep 8, 2003 @ 10:15am
by Conan
I have downloaded latest version plus fix plus PF7 & will get this working at lunch time.

If performance is good enough I will be interested in discussing use of the software in my next game.

30 minutes later..........
I built for arm & downloaded to my Axim. Performance of the demo is really good. There's one issue showing up with the height map ( the big white area seems to be too high).

I would be very interested in exploring this further as a module for my next game. My polygon terrain generator is not fast. I have a height map generator which creates terrain mathematically rather than from a bitmap. This is needed because I will have hundreds of planets with different terrain generated from a seed.

PostPosted: Sep 8, 2003 @ 6:48pm
by JoostB

PostPosted: Sep 8, 2003 @ 6:57pm
by Pam
Hi,

I am also interested in your demo. I started a voxel demo myself a few weeks back after reading the first article of Jacco's series, but I never completed it.

I have a Casio E-125 (MIPS) and the demo is quite garbled on the screen. It appears that you are not using the pitch of the backbuffer when you calculate the offset in your draw routine.

Check this thread for some more info on the pitch: [url]http://www.pocketmatrix.com/forums/viewtopic.php?t=6586&highlight=pitch
[/url]

Otherwise, it seems to run smooth enough.

Pam

PostPosted: Sep 8, 2003 @ 7:57pm
by JoostB
Pam, thanks a lot for the info,
I was even not aware of the pitch (shame on me).
I'll fix this right away.
By the way I've created a FPS counter on the screen and I noticed something very strange, when moving along the X-axis, it runs on my Ipaq at 12/13fps (on my friends Axim at 25/26fps!) when setting the angle to 90 degrees, it runs at 8/9fps on the ipaq, (on the axim also 8/9fps). The difference (factor 3 on axim) has definitely nothing to do with the math. when I copy a fixed value to the screen buffer it will work constantly at maximum fps, the problem should be somewhere in the texture lookup, in the tPix = texture[offset]; command according to some tests I've performed. Anyone an idea what could cause this drastic performance difference??

PostPosted: Sep 8, 2003 @ 8:25pm
by Conan

PostPosted: Sep 8, 2003 @ 8:29pm
by Pam

Link to terrain generation

PostPosted: Sep 8, 2003 @ 8:58pm
by Conan

This link is the article I used to get generated terrain (ie: not requiring a bitmap heightmap). This is in some ways better than my code as I ripped out the C++ stuff (classes etc).

The one thing that the Phantom does not mention is his article is reflections. His original PPC demo has nice reflections on the water.

While I don't want to give away too much about my next title in an open forum it involves terrains which change through time & via things the player does. If I can get a fast terrain engine working and a better 3D engine for the rest of the game then I will achieve my goal. (Of course I have about 6 months coding still left on STIII)

Joost, if you are interested in developing your demo into an actual terrain generator in a game I would be happy to discuss.

PostPosted: Sep 9, 2003 @ 6:09pm
by Guest