This site is no longer active and is available for archival purposes only. Registration and login is disabled.

3D Voxel rendering


3D Voxel rendering

Postby Joost » Sep 6, 2003 @ 7:41pm

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
Joost
 


Postby Guest » Sep 7, 2003 @ 3:51am

Guest
 


how to build?

Postby Conan » Sep 7, 2003 @ 7:21am

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Guest » Sep 7, 2003 @ 10:22am

Guest
 


voxels

Postby Joost » Sep 7, 2003 @ 12:34pm

Joost
 


Postby JoostB » Sep 7, 2003 @ 2:50pm

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 ...
JoostB
pm Member
 
Posts: 41
Joined: Sep 7, 2003 @ 12:49pm
Location: Belgium


Postby JoostB » Sep 7, 2003 @ 3:10pm

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.
JoostB
pm Member
 
Posts: 41
Joined: Sep 7, 2003 @ 12:49pm
Location: Belgium


Voxel demo

Postby Conan » Sep 8, 2003 @ 10:15am

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.
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby JoostB » Sep 8, 2003 @ 6:48pm

JoostB
pm Member
 
Posts: 41
Joined: Sep 7, 2003 @ 12:49pm
Location: Belgium


Postby Pam » Sep 8, 2003 @ 6:57pm

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
All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Postby JoostB » Sep 8, 2003 @ 7:57pm

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??
JoostB
pm Member
 
Posts: 41
Joined: Sep 7, 2003 @ 12:49pm
Location: Belgium


Postby Conan » Sep 8, 2003 @ 8:25pm

What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Pam » Sep 8, 2003 @ 8:29pm

All the easy problems have been solved.
User avatar
Pam
pm Insider
 
Posts: 449
Joined: Jan 24, 2002 @ 10:30pm
Location: Ohio


Link to terrain generation

Postby Conan » Sep 8, 2003 @ 8:58pm


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.
What is Best in Life ?
User avatar
Conan
pm Member
 
Posts: 1309
Joined: Dec 24, 2001 @ 5:16am
Location: the Shades, Ankh-Morpock


Postby Guest » Sep 9, 2003 @ 6:09pm

Guest
 


Next

Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron