Closed Thread Icon

Topic awaiting preservation: Voxel Rendering (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25627" title="Pages that link to Topic awaiting preservation: Voxel Rendering (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Voxel Rendering <span class="small">(Page 1 of 1)</span>\

 
wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 04-27-2005 17:26

I was just thinking about making a voxel rendered (in relation to this month's 20 liner ;p ). However, there was one thing I was wondering about - interpolation. That is, you make a map randomly or whatever, and you trace out a ray to find the appropriate height value for each span. However, as almost invariably this point will not lie exactly on one of the values of the map, you have to find the appropriate height. So, would you interpolate from the 4 surrounding points? It seems that this would take a massive amount of calculation for each frame, and even then getting a good algorithm for it would be troublesome - any suggestions?

Wrayal

Meh, one day I'll have a website worth seeing...honest

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 04-27-2005 17:59

Indeed, you should interpolate from the 4 surrounding points.
Check Copter Cruise : 20 lines JavaScript TERRAIN contest. The map is 16x16 but I have pre-interpolated it by up-scaling the map to 256x256. That way I don't need to interpolate based on the 4 neighbors.

wrayal
Bipolar (III) Inmate

From: Cranleigh, Surrey, England
Insane since: May 2003

posted posted 04-27-2005 18:06

poi: where d'ya think I got the idea? ;p
And I saw the concept of map_small and map_large (or whatever names you used....), but is 256x256 really enough values for the (comparative) smoothness of gradient you got? I'll give it a go
There are a couple of other things, but sometimes there's stuff you oughta work out for yourself ;p

Wrayal

Meh, one day I'll have a website worth seeing...honest

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 04-27-2005 18:17
quote:
where d'ya think I got the idea?

hehe

Actually, to be more precise, in Copter Cruise, for each square of 16x16 I choose at random to interpolate the values with a linear or quadratic interpolation ( or was it with a quadratic or cubic interpolation ).

16 levels of (pre)interpolation should be enough if the slopes are not too harsh. If the map_small is built carefuly the resulting map_large will be smooth. If need be you can run few passes of blur on the map_small. Whatever for a "real" game, a map_small of 16x16 is way too small anyway.



(Edited by poi on 04-27-2005 18:28)

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 04-27-2005 20:29

http://www.rpi.edu/~laporj2/media/code/voxel/

In fact, my first Javascript proggy EVER.

It uses cubic interpolation. However, since it's only doing 1D voxel mapping, it's pretty fast. Interpolating 2D voxels *should* be fast, the concern creeps in when it comes to rendering. How precisely do you want to render? And, if your map is made smooth enough, how big is the scale?

And, in fact, if you're rendering with square blocks anyway, you can simply pre-interpolate a small map onto a big one and render the big one directly.

There are lots of techniques to speed of voxel maps, so have a go and see what you come up with.

---
Website

« BackwardsOnwards »

Show Forum Drop Down Menu