Jump to content


sparse voxel octree painting


17 replies to this topic

#1 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 12 August 2011 - 08:16 PM

it might be a little too early to make a big fuss about, but ive just got painting working on my "infinite voxels" engine. (after a huge gpu headache, you might have seen a few vain posts from me about technical details recently) unlimited detail makes me sick tho, so i shouldnt really use infinite or unlimited to describe it.

face it, detail is limited by the storage capacity of the hard drive, who cares if you can render it all, its got nothing to do with it.

so then ive got to get voxel csg working, then ill come back with something better than unlimited detail, hopefully. :) 100% unique painted geometry, should be pretty cool.

im planning to give it away for free, see what happens. :)

Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#2 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 12 August 2011 - 11:34 PM

Posted Image
it actually paints it to the disk.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#3 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 19 August 2011 - 10:27 AM

i plotted some axis aligned boxes, and painted a few, this is coming along... csg isnt implemented yet, they are just voxelized into each other.
Posted Image
but it actually looks like its gonna be pretty damn cool :)
I want to be first to get to a working id tech 6 engine. hehe


that souped selection of boxes is 30 meg, but thats completely uncompressed, it would be about 5 meg if it was huffman encoded and a few other tricks.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#4 }:+()___ (Smile)

    Member

  • Members
  • PipPipPip
  • 169 posts

Posted 21 August 2011 - 11:58 AM

Hmm... such simple scene must compress to few kilobytes. You compression algorithm is quite bad.
Sorry my broken english!

#5 Reedbeta

    DevMaster Staff

  • Administrators
  • 5307 posts
  • LocationBellevue, WA

Posted 21 August 2011 - 04:11 PM

It's because those simple-looking boxes are actually enormous voxel arrays.
reedbeta.com - developer blog, OpenGL demos, and other projects

#6 }:+()___ (Smile)

    Member

  • Members
  • PipPipPip
  • 169 posts

Posted 21 August 2011 - 06:33 PM

...with the same values in each cell and regular repetitive pattern. They must compress to near zero compared with uncompressed representation. Otherwise compression algorithm is bad. Especially Huffman works badly in case of one value have high probability (say 0.9+).
Sorry my broken english!

#7 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 22 August 2011 - 12:09 AM

Glad to get some attention from a few comments, ill be working on compression later... Smiley, Ill be compressing as much as I can, if you are right and I can get it to a few kilobytes for a small setting like that id be really happy... but to tell you the truth 5 megabyte seems appropriate, thats 2 bits positional data and 2 bits colour information, I think. but its only an estimated target... right now im storing it like a point cloud with full byte list -> "x y z r g b", so it comes to 30 meg...

I might be counting wrong, you may be right Smiley. It might be less than 5 meg, it could be 2 even, but I havent implemented compression yet, just theorized it a little.

Im working more on this now... ill be posting more soon.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#8 }:+()___ (Smile)

    Member

  • Members
  • PipPipPip
  • 169 posts

Posted 22 August 2011 - 08:47 AM

4 bits per point is obviously too much. It must be small fraction of bit per point (say 0.001). There is where badness of Huffman algorithm lie: it cannot assign fraction of bits to values.

Do you have AAB voxels or points at arbitrary positions? In the latter case create hierarchy by grouping points with similar parameters. In the former case hierarchy come naturally (octree). Then store differences between current and parent value per point. In case of color it will be zero in most cases and compress very well.

Also think about lossy compressing. It can be in order of magnitude smaller than lossless.
Sorry my broken english!

#9 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 22 August 2011 - 12:31 PM

Im storing in a neighbourhood fashion, each voxel has possibly 6 neighbours, so i store 6 bits per voxel, about. Also to get 4 bits per vxoel, im only allowing 12 bit colour, just to keep the store down.

Just to add, your bold statements I wish were valid, but I really doubt to get it below 4 bit.

PS If what you say was true there would be no disk problem with this method! Maybe I need you Smile on my team :)
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#10 }:+()___ (Smile)

    Member

  • Members
  • PipPipPip
  • 169 posts

Posted 22 August 2011 - 11:01 PM

Well, basically you doesn't use compression at all, just store all values for all voxels.

For example, of 2^6 possible combinations only few have frequent occurrence. Assign few bits for this combinations. Also I suggest using octree hierarchy instead of neighbourhood. I think it can help for color/normal storage and automatically give low-res mipmaps. For color storage read about gif/jpeg compression algorithms.
Sorry my broken english!

#11 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 24 August 2011 - 05:35 AM

just stuffing around...
Posted Image
Posted Image
http://imageshack.us...awesomegame.png
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#12 Razor

    Member

  • Members
  • PipPip
  • 46 posts

Posted 28 August 2011 - 04:32 AM

Nice! I've started playing around with something similar, though I'm not as far along as you. What approach are you using, is it the raycasting I've seen elsewhere or something different?

Personally I'm trying a form of rasterization. It's not exactly fast so far, but maybe expecting one core of my laptop to render per pixel geometry at more than 2fps was a little optimistic.

#13 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 28 August 2011 - 05:07 AM

oh yeh razor, it needs gpu accelleration, even im only going 8-15 fps on a gtx 480. (thats with turning points into cubes per point). But I figure get a 590 onto it and it should blow it away.
Yes, im just rastering.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#14 Razor

    Member

  • Members
  • PipPip
  • 46 posts

Posted 30 August 2011 - 02:13 PM

You're no doubt right about needing hardware acceleration. I'll attempt to switch to cuda or opencl when I'm more happy with the algorithm. I'm not sure how to make it that parallel without losing a lot of the efficiency though.

Just to make you look awesome, this is what I have:
Posted Image

Full of artefacts and not even storing color data. Uses about 1gb of memory, but only because every non-leaf node has 64bit pointers to all the children. Objects become see through close to the camera because you can see between the atoms :P But I have made some speed improvements, that scene keeps above 5fps now, though admittedly that is at 512x512 res. Hopefully I can find a couple more tricks up my sleeve.

#15 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 30 August 2011 - 05:01 PM

hey... awesome.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#16 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 13 September 2011 - 04:59 PM

hey good news Razor, ive just got csg implemented!!! well see if i can get something totally sick out of it. :)

Give me a couple of days, ill have a really nice screenshot!

Next thing tho, after I have another little play... will be to import models directly from 3d coat into it, then i should be able to get something really really nice.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#17 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 13 September 2011 - 05:19 PM

just to prove it heres a screen, but its got bugs yet, but nothing i cant fix.
Posted Image

now ill be painting on proper complex geometry, should look heaps better.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#18 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 14 September 2011 - 12:12 AM

modest beginnings, i cant tackle a proper environment (i actually tried, it was a miserable failure, wont even bother you with what it looked like) without the necessary plotting tools and selections etc... stay tuned :)
Posted Image
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users