Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Fractal terrain and clouds, sun and lens flare.

Discussion in 'Works In Progress - Archive' started by DaveHoskins, May 20, 2014.

  1. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    Hi, here's a sneak peek at my new landscape renderer, the whole thing runs at 500fps on a GTX680 in HD.
    I'm posting on here because the fractal cloud system will eventually go in to the asset store.
    $Clouds.jpg

    The cloud system:-
    * Renders fractal clouds with a given random seed.
    * Cloud coverage settings..
    * Height and depth of cloud layer settings all done in real-time.
    * Renders as a single parabola sphere-map texture, and displays the whole thing quickly as a SINGLE QUAD! : )
    * Shading depth, density, and transparency settings.
    * Clouds created in 3 layers, the sky, the fog and then the clouds.
    * Has a real-time rendering option, that updates the clouds in as many frames as you want by dividing it up into small sections.
    * The fog layer is a post process that blends your scenery into the sky and fog colour.
    * Sun flare obscured by the depth map, NOT a collision mesh - useful for out-of-bounds areas like track buildings and
    untouchable tree branches.
    * Sun diffusion through clouds.
    * Mathematical lens flare - it's fake, but it doesn't use any textures so it's not going to colour-band or have any visible pixels.

    I think that's all of it - hopefully I can get the GLSL shaders workings soon and it'll be ready to go to the store.
    It'll be for Windows and Macs, not quite suitable for mobile devices just yet. :)
    Cheers,
    Dave H.
     

    Attached Files:

    DxStd_IgnatPribylov and Farelle like this.
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That looks nice! The whole rendered to quad thing makes me think of post effects or even demoscene world rendering (raymarching and wotnot, doesn't work well with raster by basic nature), would it be something you wouldn't mix up with other assets that affect your scene rendering? Examples being maybe wether it would show up in a SSR post process, or be grabbable for any kind of reflection, would it be altered or could it contribute to the overall illumination influence of a scene (Like in PBR setups where a cubemap of the environment is providing ambient illumination and also a skylight amongst other things)

    It does look very pretty and one of those things where I think about how much i'd like iq's clouds on shadertoy.com to 'just work' in Unity rather than... being a long long way from 'just work'ing. If these do work very nicely with other asset products it would be very attractive, typical example for me would be products that provide time of day and weather systems where clouds like those would be an ideal addition
     
  3. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    Thanks, it creates a squashed sphere-map texture that can be saved and used later. The vector rays along each pixel of the rendered quad are projected onto the sphere-map which is then layered over the top of the realtime sun and sky renderering.
    I can give direct access to it, if you give the shader a camera or a ray direction.
    So you can have pre-rendered clouds with a sun moving behind it and setting etc.
    It is based on the my own shadertoy here:
    https://www.shadertoy.com/view/4dsXWn
    Only with this, the user user has control over lots of parameters.
     
    Last edited: May 20, 2014
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,782
    Lot of atmospheric rendering lately.....geez....don't which one to choose...o_O
     
  5. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    haha the prices of some make some decisions easy
     
  6. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    How have you found the whole process of moving from a shadertoy (and i suppose, demoscene) kind of approach where much is drawn to a quad and calculated procedurally in-shader rather than the typical rendering of a 3D game engine such as Unity? - there's a ton of smart people at shadertoy and some great effects, including your own, which would be very desireable as effects in a game. Nuaj, another cloud system (twice i've mentioned that today now) came from a demoscene background so it's quite a rich source of possibilities. I can imagine it's not straightforward but seems a lot of talent that could be getting some appreciable alternative income as asset store products if an implementable analogue was found for the effect that played nicely with Unity's rendering and i guess the decent proportion of popular Unity asset store augmentations. You might be onto something!
     
  7. Deleted User

    Deleted User

    Guest

    Looks great, so when are you thinking of releasing? Also it would be nice to add in some lightning ;)..
     
  8. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Nah! This should be one cloud product that DOESNT have lightning in it
     
  9. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    It could very easily have lightning, the clouds can be lit up using shaders without re-rendering the sphere map, so it's all possible. I will have to script the sun colour to light the game objects up when it strikes. I will give all the C# code and shaders of course.
     
  10. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    Thanks! I'm not a demo scene person, never have been! :)
    I think there's a few people on Shadertoy that come from the computer game industry anyway.
     
  11. Deleted User

    Deleted User

    Guest

    I hope you charge for it, looks like a good product all in.. Send me a message when you're going to release it, I'm very interested.
     
  12. QuantumTheory

    QuantumTheory

    Joined:
    Jan 19, 2012
    Posts:
    1,081
    Post the millisecond usage displayed in the Unity profiler. FPS counter isn't useful.
     
  13. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    ahh! i guess i tend to automatically label shadertoy related things to demoscene, probably because of the site creators roots, but i guess thats being a bit presumptious. definitely always great to see what someone's come up with next, some feats are amazing, not least from coming right out of your browser
     
  14. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    This looks very good. Look for to see it released.
     
  15. dylanfries

    dylanfries

    Joined:
    Jul 11, 2012
    Posts:
    16
    That looks awesome. Did you generate the Terrain as well?
     
  16. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    Hey thanks. Yes that's my fractal terrain system, it works by creating detailed bump maps on the fly and streaming them in as needed. It runs really fast, it never repeats, and doesn't use textures. It's one of the 'infinite' size landscapes things. Here's an old video of the OpenGL version if you want to see more:-
    (old cloud system, and a bit dark):

    It's part of another project, but I won't be making it an asset though, sorry. :)
     
  17. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'd love to see that kind of procedural texturing and landscape feature forming work along side things like scrawks recent Proland port to unity, its a pretty neat 'entire world' builder originally created by some big guys in figuring out all sorts of interesting things about natural phenomena, uses a really lovely (but a bit heavy) fft ocean generator and wot not - has quite a typical aesthetic though and wonder if it's possible to break it up with methods like this. I'll give a link to the port just so people know what im on about http://scrawkblog.com/page/2/
     
  18. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    How do people get terrain that good looking. Amazing.
     
  19. norby

    norby

    Joined:
    Jul 10, 2006
    Posts:
    277
    wow this is so cool. are you going to sell it
    what would be the price ?
    i am sure you can make a good looking ocean too 😊

    Norby
     
  20. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    You said fractal terrain also.. as in generated using some kind of subdivision technique or something?
     
  21. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hi DaveHoskins, are you still working on this project in Unity? I got something new for this old threads. I'm recently exploring different clouds system for my new sky solution. I was playing around your ShaderToy Weather, and ported it as a skybox to Unity 5 .

    So far the clouds is working well if it generated from procedural noise, but not with the noise texture. I'm not using your weather stuff for now, just wanna try out some basic clouds fractal generation. Also I haven't implement any optimise method, so at the moment it is quite expensive to render. I limited the total loop to 8 for the clouds thickness (cloud density) instead of original 55, otherwise it will make my macbook system into slow motion.
    ShaderToy-Weather.gif

    I don't mind to share this skybox shader here, however it is based your ShaderToy codes I think i might need your permission to share it.
     
    Last edited: Jan 23, 2016
    Martin_H likes this.
  22. Freddy888

    Freddy888

    Joined:
    Sep 13, 2014
    Posts:
    165
  23. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    Hi, the clouds were too slow on general GPUs, and I suspect a rendered billboard approach is probably the best way to go.
    But the terrain stuff should be up on the app store pretty soon! Here - www.rendertonic.com
     
  24. Freddy888

    Freddy888

    Joined:
    Sep 13, 2014
    Posts:
    165
    Hi Dave, good to see you are still working on it. Nice video, last time I heard that song it was The Shamen !

    Will keep an eye on this thread now and your site - I really like the look of it all :)

    Cheers !
     
  25. DaveHoskins

    DaveHoskins

    Joined:
    Sep 9, 2013
    Posts:
    190
    Hello. I just thought I'd say that Terrain Foundation has now been released.
    It's an editor extension, and it creates terrains suitable for any scenario.
    Here's some features:-

    * Four separate parts:
    1. Fractal terrain generation as a Unity editor extension.
    2. Auto splat map generator for texturing.
    3. Random texture tiling, reduces repetition.
    4. Normal map overlay for extra detail.

    * 13 Ground textures with specular and normal maps.
    * Applies to Unity's own terrain system.
    * Control splat maps can be higher resolution than the actual
    mesh, making complex fractal details.
    * GPU and multi-threaded fractal design for speed.
    * A custom material that randomizes texture tiling,
    reduces visual repetition by shifting, flipping and blending
    textures on the fly.
    * Shader 3.0 only needed for editor and random tiling material.
    * Has a quick preview window, for fast location searches.
    * Can be used in standard Unity Terrain rendering.
    Get it from here:-
    https://www.assetstore.unity3d.com/#!/content/48089