Thanks for the help with sphere tracing...

category: code [glöplog]
*g* "moot"
added on the 2012-11-08 17:12:06 by ferris ferris
kusma: if you want to do it without a cache, you need to sample eight points for each voxel. That means you're calling the distance field function eight times as much.
added on the 2012-11-08 17:59:22 by paniq paniq
...thinking about it - of course you could just always work on two slices of the entire volume, always keeping the previous slice from the last computation. That would keep it down.

But after the triangulation you end up with a shitload of vertices - even if you remove doubles - that you also need to store somewhere. With 1 GB of VRAM (assuming we don't need textures or framebuffers) you have space for 89 million vertices.

Now, divide that 89 million by the size of a 1080p framebuffer (let's say we'd ideally like to have per pixel vertex precision), and you end up with a meager 43 slices of depth.

If you take four pixels per vertex, that's 172 slices. eight pixels are 345, sixteen are 690... well, you're never going to get a single screen full of high precision data and 24-bit depth that way.
added on the 2012-11-08 18:10:13 by paniq paniq
Uhm, no? MC results only in geometry in cells that contains a surface. So you'll have room for a hell of a lot more slices.
added on the 2012-11-08 18:42:07 by kusma kusma
let's say we'd ideally like to have per pixel vertex precision

erm.. no?
you can make a polygon mesh of a sphere that looks just like a sphere when you render it nicely, without having a triangle per pixel.
added on the 2012-11-08 18:48:55 by smash smash
I don't know what kind of geometry you two are thinking of, but I bet it's boring. Anyway, this conversation is pointless. I can obviously not make you see the advantages of a different approach, I think you are not interested in learning something new from me either, and I am completely aware of the shortcomings of my method, so there is nothing for me to take away here.

Gentlemen, it has been a pleasure.
added on the 2012-11-08 19:57:44 by paniq paniq
Gentlemen, you really should have greater interest in surfing the great pr0n-train named TUMBLR like the rest of us. Your current hobby is unhealthy for sure...
added on the 2012-11-08 21:01:05 by maytz maytz
paniq: dont take it the wrong way - this is healthy debate, and i think its been interesting i think for other people too. if nobody talks about the negatives or the alternatives to a popular method everyone just assumes it's "the way", and nobody tries anything else and moves things forward.

in your case it sounds to me like sphere marching works great for you because youve kindof designed for sphere marching.. so its all good.
added on the 2012-11-09 12:54:36 by smash smash
http://www.youtube.com/watch?v=6E2hYDIFDIU as background music to this healthy debate
added on the 2012-11-09 16:20:48 by havamal havamal
and just cos i'm like Keops when it comes to recycling jokes:
BB Image
added on the 2012-11-09 23:00:40 by havamal havamal
What Smash said. I love these sort of threads and they give me insight and inspiration for my own meager coding efforts...
added on the 2012-11-09 23:25:27 by bloodnok bloodnok
Agreed, it's useful to hear both sides.

My conclusion: pick your engine to suit your content (and the people creating it), or pick your content to suit your engine. Giving a bunch of artists an sdf function won't go far, but give it to unc and it goes a whole long way :)
added on the 2012-11-09 23:57:49 by psonice psonice
got to read up on the thread. And yes, as smash said, for the design in question ray marching seems right..

paniq: if your cone/tile-marching (or whatever we call it) produces artifacts you are doing something wrong. And btw, do small tiles like 4x4 pixels.
1. Your threshold distance value in the tile part should be sqrt(2)/2 times the width of your tile frustum at the current camera distance - ie so the threshold-sphere will cover every pixel in your tile.
2. Incorrect SDFs (ie not providing a proper lower bound distance) may produce acceptable results (technically still artifacts) in a pure per-pixel marching, but make ugly tile artifacts in the tile-marcher.
3. In pixel-marching you can sometimes get away without modelling "back faces", but that WILL also artifact (overshoot) in the tile-marcher (I had to fix the bujr babil scene several places for this before it could be used in the realtime engine).

On top of limiting the number of iterations per pixel you can also use the tile marching to limit SDF complexity per tile, if your SDF is a composite, where you can mask out or select parts per tile.
added on the 2012-11-10 01:09:31 by Psycho Psycho
@paniq: If you ever plan to make an MMO out of it consider using hyperbolic geometry for the space. Math is difficult but it has a few advantages: geometry gets smaller exponentially with distance and with increasing world volume the average distance increases logarithmically instead of to the cubic root.
added on the 2012-11-10 13:25:13 by Kabuto Kabuto