Loading YouTube Feed...

Thursday, January 2, 2014

Voxels in Space

Here is a teaser from a new Voxel Farm prototype:


This is taken from some sort of asteroid field. What seems to be a mountain range is the surface of an asteroid where the camera has landed. This one in particular is a few kilometers diameter.

As you can see these asteroids have quite interesting surfaces. And you can dig across them as you fly or walk by. If I had the extra time I would add some pew-pew lasers and rocks being blasted into space.

You can fly around and visit all these rocks. It is all seamless. We are also testing a new system for LOD transitions, where vertices morph gradually from one LOD to the next as you approach them. This makes LOD switches virtually unnoticeable.

The star in the distance is a modified version from this one in shadertoy.com


31 comments:

  1. "... makes LOD switches virtually unnoticeable."

    Vids or it didn't happen. ;-)

    ReplyDelete
    Replies
    1. Here you go, hopefully YouTube will let you see the wireframe: http://www.youtube.com/watch?v=rakmUDn7O_s

      This system still needs a lot of work, but the key parts are already there.

      Delete
  2. Does this mean a potential evolution of your engine to incorporate a planet (read spherical) coordinate system?

    ReplyDelete
    Replies
    1. No evolution needed. Most of the stuff I have shown lately was already off-grid. Spheres (or lumpy rocks in the case of asteroids) are just a particular case.

      Another way to look at it, the engine can produce any surface you define as a field function. It makes no difference if this function is for a spherical object, a heightmap or a house.

      Delete
    2. Ah neat, so... Instancing the world(s) around you? I take it embedded, or instances spawning other instances aren't an issue?

      So this means someone could do something like spawning tunnels/rivers/etc on said asteroids/planets/whatnot.

      How does your physics engine work? Is gravity a uniform unidirectional property? Or can there be attractive forces between bodies?

      Delete
    3. Not sure what you mean by instancing. Each asteroid is unique and made of voxels, which means you can have tunnels, buildings, etc on them. Blasting them into pieces and mining too.

      For the most of the physics part, the gravity vector is left for the application to define. You could have a game where a character suddenly "bends" gravity and asteroids flock to him/her.

      Delete
    4. Earlier, you had mentioned that trees/rocks were instanced objects that can procedurally generate so that all of them are unique, but you don't need to store the unique data for each instance. My thought was if the world you are building on is an instance, then it should be fairly straight forward to instance planets in a solar system, or solar systems in galaxies. Essentially, you eliminate the infinite plane and have a procedurally generated universe where you can design/build/destroy anything.

      Your gravity answer got me thinking, it is probably best to have either a stationary universe, or have the elements of said universe move according to predetermined orbits rather then continuously calculating gravitational fields.

      Delete
    5. However that would limit the overall scope and possibility in certain circumstances. I see what you mean, but I also see the strengths in a decent gravitational model from a simulation standpoint.

      Delete
  3. “The star in the distance is a modified version from this one…”

    I love Robert Hodgin’s stuff. It’s always so beautiful.

    ReplyDelete
    Replies
    1. Agreed, still Inigo Quilez is my favorite: https://www.shadertoy.com/user/iq

      Just look at this thing: https://www.shadertoy.com/view/Mss3zM

      I'm still studying his work for Pixar's Brave. Very inspirational.

      Delete
  4. Do the asteroids move? Can they simultaneously move and function as a voxel?

    ReplyDelete
    Replies
    1. Not in this prototype. This is coming soon.

      Delete
  5. As always cool. New Year - new great news !!!

    ReplyDelete
  6. This makes me wonder, does everything go infinitely just as well in 3d as in 2d?

    With the mention of field equations... How well would this handle something like the Mandelbulb or other 3d fractal scaled up to planet-size?

    ReplyDelete
    Replies
    1. I guess it would be the same as every 3D Mandelbulb out there (did you know Mandelbrot used to fart on people at IBM?).

      What is planet-sized is more about what texturing you use and how the camera behaves. A sphere could be either a star, a planet an atom.

      Delete
    2. I meant something like a mandelbulb of rock with whatever other phases with trees and such you do on it afterwards applied, and interacting with the physics engine, as the differing part. And planet sized I presumably mean on the same scale as the current physics engine and LOD and such is using and optimised for.

      Delete
    3. Yes that would be quite a sight.

      Delete
    4. Yea. Hence why I'm wondering how hard it would be to implement, and if it'd be significantly slower than the normal terrain generation you've shown working well in real time.

      Delete
  7. at some day, this guy's work will give us a infinite universe with all sorts of physics, weather, geology and artifical intelligence simulated to a degree; where most game designers become unemployed, because you already can play anything you want in this world, just by writing some scripts, a plugin or just -behaving- like you need to! :)

    ReplyDelete
    Replies
    1. Gives me the feeling of Dwarf Fortress again =P. But then more the world-simulation part than the actual gameplay part.

      Delete
    2. Yes that is something i want to see in this engine
      also where the dwarfs would have such complex body system like in dwarf fortress

      Delete
  8. I find it impressive how almost every time, it seems like you're going in one direction, and then BWAM you go almost 90 degrees into another, equally, if not more, awesome direction, I do hope space is not the final frontier in this case =P.

    ReplyDelete
  9. almost expecting you to post that your procedural worlds will be a part of elite dangerous, or some other game after that maybe, full planets, diverse alien worlds, gravity, asteroid belts, comets, i think of space engine but landing and terraforming/harvesting resources and fuels but with a wurm like crafting system and community.

    at any rate, every post you make inspires me greatly Miguel, thank you!
    always bringing it to the next level x)

    ReplyDelete
    Replies
    1. More like noman's sky. Elite Dangerous isn't likely to have this sort of technology, or if they are considering it they have been very tight lipped on the concept.

      What I will say is Chris Roberts has mentioned that he is looking into this technology for the future (not at launch ofcourse)

      Delete
  10. Indeed, sky isn't the limit. Interesting direction to this project!

    ReplyDelete
  11. Hi Miguel ...
    Where do you generate and store the working voxel set? I've been toying with using compute shaders to generate and store things like terrain voxel arrays in the gRam then additional shaders to translate in to vertex buffers that i then render. I then backed away from that in favour of focusing the gfx card hardware on working with the vertex data only after generation as this seems to be how engines like unity are designed to behave.

    I noticed 2 things ...
    1. those massive arrays are generated and worked on faster on the gpu (of course).
    2. making unity render a buffer without pulling that data back to the cpu proved impossible due to how the engine worked (you have to declare a mesh object then let unity pass that to the gpu for you).

    That then made me think i was wrong to do any form of generation on the GPU directly because I would lose time sending the data back and forth (possibly just a unity limitation) thus offsetting the whole reason for using the gpu in the first place, also in a finished game the gpu already has it's workload maxxed out just drawing stuff so piling on cpu work would make the situation worse.

    I know you have unity plugin for voxelfarm, how does voxelfarm get round that?
    I gather the voxelfarm engine is C++ code that can be "plugged in" to a game engine like unity which suggests that any gpu based generation must always be pulled from gRam then sent to the app calling code where it is then sent back to the gpu ... seems really in-effecient to me but somehow you seem to be doing it whilst holding up a decent frame rate !!!



    ReplyDelete
    Replies
    1. I believe Miguel has answered this in the past. Don't quote me on this because things could have changed since then. But he experienced similar issues, his engine relies on cpu voxel generation leaving the gpu entirely to with rendering work.

      Delete
    2. Ah ok, thx Robin ... it looks like i'm taking the right path then :) Trying to do something a little out of the box with voxels but the fundamentals are most definitely always the same. My biggest perf loss is actually telling unity "here's some vertex info and index info go render it" ... seems like getting data to the gpu is a real slow process (relatively speaking).

      Generating that data on the gpu solves that problem but then ties it up from a rendering point of view so you can't win i guess lol.

      Delete
  12. I can envision how your morph system might work for smoothly varying surfaces like terrain, but how do you handle narrow columns/walls of material that vanish at the next lower LOD? Not sure how you would avoid a pop.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Asteroids are great but can you do a space station with centrifugal gravity.
    http://appliedimpossibilies.blogspot.com.au/2012/03/space-station-challenge.html
    I argue that this is needed and it's unavailable with one limited exception. Procedural worlds are either flat or spheroid [spore, planetary annihilation] but centrifugal structures require new code based on new math as I noted in the blog post.

    ReplyDelete

There was an error in this gadget