Procedural Infinite 3D Cave Generation

Home Forum Development User Code & Projects Procedural Infinite 3D Cave Generation

This topic contains 32 replies, has 12 voices, and was last updated by  mifth 2 years, 3 months ago.

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #16948
    +3

    mazander
    9p
    Member

    Hello,
    I want to show my latest project ‘Procedural Infinite 3D Cave Generation’. The idea I got from NVidia’s article: Chapter 1. Generating Complex Procedural Terrains Using the GPU.

    Video:
    http://www.youtube.com/watch?v=KIEY3py5w1k

    Cave scalar field is sum of 5 random 3D noises. Each of them is tri-linearly interpolated. Marching tetrahedrons algorithm is used for polygonization. Texture coordinates for tri-planar texture and bump mapping are calculated in shader program. Geometry is calculated in another thread in CPU, not in GPU like in the NVidia’s article.

    Here is my first shader program: ‘Triplanar texture and bump mapping shader’. The shader samples two textures: diffuse and normal.

    triplanaltexturing.frac

    triplanaltexturing.vert

    #115240

    Normen Hansen
    2792p
    Keymaster

    Wow, cool! So your are still working on this? Any chance to see some contribution growing out of this? It really looks great.

    Cheers,
    Normen

    P.S.: I removed the “html link” around your youtube video link to it displays in the thread.

    #115241

    Erlend Sogge Heggen
    508p
    Keymaster

    Gorgeous! This is like one of our coolest graphics showcases to date :) I might be out of time for today but I’m gonna take a snapshot of the HD video and add it to our showcase screenshots. If you could give me a screenshot if your own though, that’d be even better. Ideally you also include a description of the image (SEO stuff basically), though I do have enough to go on by what you’ve explained in this post. Lastly, I suppose I could include a link of your choice.

    Great job man.

    #115242

    Skye Book
    368p
    Keymaster

    @erlend_sh, shouldn’t you be sure that @mazander did this in jME3? The GLSL could be for a number of graphics packages :)

    Either way, it looks fantastic! Can’t wait to see more on this!

    #115243

    mazander
    9p
    Member

    This is done with JME2. I haven’t tried JME3 yet. Maybe I should, because I want to test this with SSAO.

    #115244

    Erlend Sogge Heggen
    508p
    Keymaster

    I see, sorry I jumped to conclusions. Too bad though, it won’t make the showcase then. If you do end up porting this to jME3 though, I guarantee you we’ll showcase it; it might very well be frontpage material ;)

    #115245

    Eric
    -2p
    Participant

    I’m at a lost where to start, but how do I use this in JME3? :D

    #115246

    nehon
    1876p
    Keymaster

    You can’t USE it. Mazender is just demonstrating his work.
    It’s made for JME2, and the given shader code is just used to render the material of the cave.
    Though it would need some adaptation to work with JME3.

    But if you are eager to step into this, you would need to generate a procedural terrain first with JME3, which is far from trivial.
    You can start by reading the article on GPU gem about this (if you didn’t yet).
    But be aware that this is a very advanced topic.

    #115247

    Eric
    -2p
    Participant

    I did read the article, and it did feel above my level at this point for sure. But definitely within my grasp with time. And I was referring to the article and the terrain generation described there, not Mazander’s. Sorry for confusion.

    #115248
    +4

    mazander
    9p
    Member

    If someone wants use or just test this, the source code of the project is now hosted on Google.
    https://code.google.com/p/cave3d/

    I added one y-axis scaled noise which produced nice stalactites:

    #115249

    Skye Book
    368p
    Keymaster

    That’s a great contribution to the community! Kudos :)

    #115250

    Normen Hansen
    2792p
    Keymaster

    I totally agree to what Skye said! Fantastic, that will make porting it to jme3 easier.. Anyone? :D

    #115251

    wax
    5p
    Participant

    Cooool

    #115252
    +3

    rickard
    162p
    Participant

    Jme3:

    A few issues to sort out still.
    1. Texture stretching. I need to properly calculate the tex coords from the view projection. I’ve realized it has to do with trigonometry. Simply using pythagoras theorem on the “v” coord produces a radial shape in the texture.
    2. Normal maps. Ran into some problems generating TangentBinormals. It seems no triangles are found/generated for the VertexData. I haven’t worked with that before so i’m not sure how to solve it.

    The reason for this is it’s now using the Lighting material. Previously everything was handled by the shader (and i didn’t get that to work)

    Now i need to get some fresh air. Hope to complete this later :)

    Edit: issue clarification. If anyone has any pointers to give regarding the issues, feel free to mention them.

    #115253

    nehon
    1876p
    Keymaster

    Good work Rickard!

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

You must be logged in to reply to this topic.