jmeplanet

Home Forum Development User Code & Projects jmeplanet

This topic contains 117 replies, has 30 voices, and was last updated by  Ascaria Quynn 1 month, 1 week ago.

Viewing 15 posts - 1 through 15 (of 118 total)
  • Author
    Posts
  • #25111
    +32

    aaronperkins
    76p
    Participant

    [video]http://www.youtube.com/watch?v=Si4P8ACTFyg[/video]

    It’s a planet generator that renders efficiently from space to ground level using quadtree based LOD, skirt based seam correction, and a fractal height generator.

    The goal of the project is to keep things simple. When exploring how to do this, a lot of the examples were really complex, and the code, often in C++, wasn’t very easy to understand. Most of the work was distilling all these ideas and code samples into something clean and concise.

    The code can be found here

    UPDATE
    2/23/2012
    New video of physics and shadow integration. Added Jaime walking across the surface by popular demand. ;-)
    I also removed the logarithmic depth buffer for now and switched to a dual viewport scheme. this allows me to utilize stock jme3 materials and filters.

    UPDATE:
    1/27/2013
    Added physics integration! Going to fast will end in clipping through the terrain but otherwise you can now travel along the surface of the planet.

    5/13/2012
    Added atmosphere and other effects. New video!

    5/8/2012
    Added water (using t0neg0d’s deformation shaders), some stars and a moon. New screenshot below.

    4/29/2012
    Added rickard’s lighting material.

    TODO:

    Generate terrain patches on a different thread to speed things up
    More complex atmosphere (clouds)
    Sun
    Foliage (possibly with Forester)

    #175186

    Normen Hansen
    2797p
    Keymaster

    Hey, cool. Think there could be some transitioning/data transfer to go down to terain quad level with this when zooming in?

    #175187

    aaronperkins
    76p
    Participant

    Not quite following you on that.

    When you zoom the terrain splits and get more complicated in a way very similar to the jme3 terrain engine. I actually explored modifying the jme terrain engine for this, but it got a little to complicated for my sanity.

    #175188

    Normen Hansen
    2797p
    Keymaster

    Yeah, basically like that but in the end, when you get close to the ground it technically becomes just a terrainquad like the ones that already exist so I thought of some blending option. e.g. when you look at the whole planet you see your algo’s results but when you zoom in to a continent you eventually see the terrainquads..

    #175189

    Brent Owens
    461p
    Keymaster

    oh hey sweet, this looks nice!
    Now I want to make a space game and use it… hehe

    What normen means is when you get down close enough it switches to jme3’s TerrainQuad system. Might be tricky but not impossible I should think.

    #175190

    aaronperkins
    76p
    Participant

    I understand now.

    Conceptually a jmeplant is constructed from 6 quads arranged in a cube. The quad’s vertices are normalized around a center point to make it a sphere. I initially tried to make those 6 quads jme3 TerrainQuads. I’m missing a lot of the nice features jme3 terrain has, like collision detection, splatting, and terrain manipulation.It would be nice to leverage all those features somehow, but like I said, trying to get jme3 terrain to be curved hurt my brain.

    I’ll be integrating collision detection for sure, so you can walk (or drive, or crash) on the surface. Not sure about the other features.

    #175191

    Normen Hansen
    2797p
    Keymaster

    But thats what I say. When I walk around in the field I don’t have the feeling I walk on a curved surface. So a normal TerrainQuad should do, shouldn’t it?

    #175192

    aaronperkins
    76p
    Participant

    The idea is to make the planet very large. Hence you won’t notice the curve just like you don’t notice the surface of Earth is curved.

    #175193

    Normen Hansen
    2797p
    Keymaster

    …hence you can just as well use a TerrainQuad with all its goodies.. got me mate? :)

    #175194

    zarch
    692p
    Keymaster

    @normen said:
    But thats what I say. When I walk around in the field I don’t have the feeling I walk on a curved surface. So a normal TerrainQuad should do, shouldn’t it?

    When viewed from space (or even an airplane sufficiently high) though that field would be part of a curved surface. It’s just flat at the human scale.

    Maybe the solution would be to generate a TerrainQuad hightmap from the data and then switch it in when you get close enough then switch back when you leave?

    #175195

    Normen Hansen
    2797p
    Keymaster

    @zarch said:
    When viewed from space (or even an airplane sufficiently high) though that field would be part of a curved surface. It’s just flat at the human scale.

    Maybe the solution would be to generate a TerrainQuad hightmap from the data and then switch it in when you get close enough then switch back when you leave?

    Exactly, when viewed from space you see like a million people. No way you can keep simulating bullet characters and all collision shapes at that scale. So you have to switch stuff anyway and it makes only sense to have this stuff going on when you are zoomed in anyway. As in any good game that thrives to go to planet scales, your data about the entitites is decoupled from the visual output. So you only need to switch the algorithm from say particles that simulate the characters locations to the actual characters roaming on the collision shape of the TerrainQuad when you zoom in and then you don’t have any curvature anymore.

    #175196

    madjack
    629p
    Participant

    Hmm.

    #175197

    aaronperkins
    76p
    Participant

    I got you….

    I just don’t know how I’d go about integrating a TerrainQuad into this.

    I’ll give it some thought.

    #175199

    KayTrance
    31p
    Member

    The idea is to make the planet very large..

    It would be interesting to see some images showing planet in real scales.

    Maybe the solution would be to generate a TerrainQuad hightmap from the data and then switch it in when you get close enough then switch back when you leave?

    I doubt it will work smooth because of the curvature.

    #175200
    +1

    zarch
    692p
    Keymaster

    @KayTrance said:
    It would be interesting to see some images showing planet in real scales.

    I doubt it will work smooth because of the curvature.

    The point is that on a reasonably sized planet by the time you get close enough to do the switch then the visual field will essentially be flat anyway so you won’t see the difference. A full sized planet would map to millions of terrain quads but you would only switch in a max of 4 at once, and then only once you got close enough.

Viewing 15 posts - 1 through 15 (of 118 total)

You must be logged in to reply to this topic.