• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
ChenA

Horizon:zero Dawn Cloud System

63 posts in this topic

What is the performance you guys are getting out of your result?

Ray marching seems quite expensive still, is that right?
0

Share this post


Link to post
Share on other sites

What is the performance you guys are getting out of your result?

Ray marching seems quite expensive still, is that right?

Super expensive :)

In the Zero Dawn presentation, they mention that they only calculate 1/16th of the rays every frame, and temporally re-project the rest of them using results from previous frames.

That's equivalent to only rendering at 480x270 per frame for a 1080p output, and it still takes them a few milliseconds.

2

Share this post


Link to post
Share on other sites

 

What is the performance you guys are getting out of your result?

Ray marching seems quite expensive still, is that right?

Super expensive :)

In the Zero Dawn presentation, they mention that they only calculate 1/16th of the rays every frame, and temporally re-project the rest of them using results from previous frames.

That's equivalent to only rendering at 480x270 per frame for a 1080p output, and it still takes them a few milliseconds.

 

 

Optimizing for when you even start marching, with some sort of ultra simple proxy like signed distance fields/2d cloud coverage map/etc. should also help a lot. But temporal reprojection and supersampling are basically required.

0

Share this post


Link to post
Share on other sites

 

 

What is the performance you guys are getting out of your result?

Ray marching seems quite expensive still, is that right?

Super expensive :)

In the Zero Dawn presentation, they mention that they only calculate 1/16th of the rays every frame, and temporally re-project the rest of them using results from previous frames.

That's equivalent to only rendering at 480x270 per frame for a 1080p output, and it still takes them a few milliseconds.

 

 

Optimizing for when you even start marching, with some sort of ultra simple proxy like signed distance fields/2d cloud coverage map/etc. should also help a lot. But temporal reprojection and supersampling are basically required.

 

 

when coverage = 0 don't calculate light?

0

Share this post


Link to post
Share on other sites

Yep it is expensive, around 1.4-2.1ms on a gtx970 @1/16th FullHD resolution.

Optimisations so far, early out on high opacity, no expensive calclation on coverage  == 0 , and no full quality light-samples on opacity > 60%

and a carefully tweaked scale. Thought on a signed distance field aswell, but that eliminates the nice property of realtime coverage/shape changes

0

Share this post


Link to post
Share on other sites

ryokeen, how to use weather type and height to adjust the coverage?

thanks.

 

i try some method, watch from top, the result is not too bad.

[sharedmedia=gallery:images:7604]

but watch from the bottom, the result is bad.

[sharedmedia=gallery:images:7605]
0

Share this post


Link to post
Share on other sites

With the height from the weatherdata i compute the fade_in/fade_out values very similiar to how they do it in the article.

 

Then somewhere i have

lCoverage = 1.0-cloudType.r*fade_out*fade_in;

Where clodeType is the weatherdata at the current sample position. Try just the same you did for the cloudtops at a smaller heightscale for the bottom, that should help a lot.

Also i scale the final cloud value by fade_in to make it a bit smoother

0

Share this post


Link to post
Share on other sites

Ryokeen,

 

I get enough detail when watch from top:

[sharedmedia=gallery:images:7619]
 
but when watch from bottom, the detail get fuzzy:
[sharedmedia=gallery:images:7620]
 
i think the reason is the edge of cloud is not very steep.
can you post a screenshot from the top view?
thanks.

 

0

Share this post


Link to post
Share on other sites

ChenA , can you post your code so that we can see what your doing?

thanks.

 

1.weather texture, i use the horizon zero dawn's default weather texture, mapping method use plane projection.

[sharedmedia=gallery:images:7621]
 
2.density composite algorithm use gpu pro 7 algorithm with some modify.
gpu pro 7 algorithm:
// Fractional value for sample position in the cloud layer .
float GetHeightFractionForPoint ( float3 inPosition , float2 inCloudMinMax )
{
    // Get global fractional position in cloud zone .
    float height_fraction = (inPosition.z ? inCloudMinMax.x ) / ( inCloudMinMax.y ? inCloudMinMax.x ) ;
    return saturate ( height_fraction ) ;
}

// Utility function that maps a value from one range to another .
float Remap ( float original_value , float original_min , float original_max , float new_min , float new_max )
{
    return new_min + ( ( ( original_value ? original_min) / ( original_max ? original_min ) ) ? ( new_max ? new_min ) );
}

float SampleCloudDensity ( float3 p , float3 weather_data )
{
    // Read the low?frequency Perlin?Worley and Worley noises.
    float4 low_frequency_noises = tex3Dlod ( Cloud3DNoiseTextureA , Cloud3DNoiseSamplerA , float4 ( p , mip_level) ).rgba;

    // Build an FBM out of the low frequency Worley noises
    // that can be used to add detail to the low?frequency
    // Perlin?Worley noise.
    float low_freq_FBM = ( low_frequency_noises.g ? 0.625 )
    + ( low_frequency_noises.b ? 0.25 )
    + ( low_frequency_noises.a ? 0.125 );

    // define the base cloud shape by dilating it with the
    // low?frequency FBM made of Worley noise.
    float base_cloud = Remap ( low_frequency_noises.r , ?( 1.0 ? low_freq_FBM ) , 1 .0 , 0 .0 , 1 .0 );

    // Get the density?height gradient using the density height
    // function explained in Section 4.3.2.
    float density_height_gradient = GetDensityHeightGradientForPoint ( p , weather_data );
    
    // Apply the height function to the base cloud shape.
    base_cloud ?= density_height_gradient ;

    // Cloud coverage is stored in weather data’s red channel.
    float cloud_coverage = weather_data.r;
    
    // Use remap to apply the cloud coverage attribute.
    float base_cloud_with_coverage = Remap ( base_cloud , cloud_coverage, 1. 0 , 0. 0 , 1.0);

    // Multiply the result by the cloud coverage attribute so
    // that smaller clouds are lighter and more aesthetically
    // pleasing.
    base_cloud_with_coverage ?= cloud_coverage;


    // Add some turbulence to bottoms of clouds.
    p.xy += curl_noise.xy ? ( 1 . 0 ? height_fraction );

    // Sample high?frequency noises.
    float3 high_frequency_noises = tex3Dlod ( Cloud3DNoiseTextureB , Cloud3DNoiseSamplerB , float4 ( p ? 0.1 , mip_level) ).rgb;

    // Build?high frequency Worley noise FBM.
    float high_freq_FBM = ( high_frequency_noises.r ? 0.625 )
    + ( high_frequency_noises.g ? 0.25 )
    + ( high_frequency_noises.b ? 0.125 );

    // Get the height fraction for use with blending noise types
    // over height.
    float height_fraction = GetHeightFractionForPoint ( p , inCloudMinMax );

    // Transition from wispy shapes to billowy shapes over height.
    float high_freq_noise_modifier = mix ( high_freq_FBM ,
    1 .0 ? high_freq_FBM , saturate ( height_fraction ? 10.0 ) );

    // Erode the base cloud shape with the distorted
    // high?frequency Worley noises.
    float final_cloud = Remap ( base_cloud_with_coverage ,
    high_freq_noise_modifier ? 0.2 , 1.0 , 0.0 , 1.0 );


    return final_cloud;
}

 

 

modify:

a.worley noise

//float base_cloud = Remap(low_frequency_noises.r, ?(1.0f - low_freq_FBM), 1.0 , 0.0 , 1.0);

//i think this remap's effect is increase base_cloud value, get more cauliflower shapes,
//and the noisetexture1 gba is the inverted worley, so shoud use -(low_freq_FBM)
float base_cloud = Remap(low_frequency_noises.r, ?(low_freq_FBM)*scale, 1.0 , 0.0 , 1.0);

b.empty sky regions

//i add a remap to get empty sky regions, threshold control the empty sky regions, 
//maxValue control smoothness
base_cloud = Remap(base_cloud, threshold, maxValue, 0.0f, 1.0f);

//the gpu pro 7 don't use this, but i don't know how they get empty sky regions.
//they just use first remap and multiply heightGradient to get the base noise cloud shapes
//i use these two operation can't get empty sky regions

the gpu pro 7 base noise cloud shapes:

[sharedmedia=gallery:images:7622]
it has steep edge.
 
 
c.coverage
//float base_cloud_with_coverage = Remap(base_cloud, cloud_coverage, 1.0, 0.0, 1.0);

//it seems the gpu pro7 use coverage to control the cloud's thinkness, more coverage,
more thick, so i use the below:
float base_cloud_with_coverage = Remap(base_cloud, saturate((height * scale) / cloud_coverage), 1.0, 0.0, 1.0);


 

 

d.the heightGradient

float4 cloudGradient1 = float4(0, 0.07, 0.08, 0.15);
float4 cloudGradient2 = float4(0, 0.2, 0.42, 0.6);
float4 cloudGradient3 = float4(0, 0.08, 0.75, 1);

float LerpGradient(float cloudType)
{
    float a = 1.0f - saturate(cloudType / 0.5f);
    float b = 1.0f - abs(cloudType - 0.5f) * 2.0f;
    float c = saturate(cloudType - 0.5f) * 2.0f;

    return cloudGradient1 * a + cloudGradient2 * b + cloudGradient3 * c;
}

float CalculateGradient(float a, float4 gradient)
{
    return smoothstep(gradient.x, gradient.y, a) - smoothstep(gradient.z, gradient.w, a);
}


heightGradient = CalculateGradient(height, LerpGradient(cloudType);

gpu pro 7 said that:

A value of 0.0 indicates stratus, 0.5 indicates stratocumulus, and 1.0 indicates cumulus clouds.

but see this picture

[sharedmedia=gallery:images:7623]
it seems that 1.0f is cumulonimbus.
Edited by ChenA
1

Share this post


Link to post
Share on other sites

@ChenA I'm not sure how they even got the shape working. I get at best some very diffuse unshapeable cloud areas with their Remap approach. That's why i'm still sticking to my own way.
For the top view, i have to change the shader a bit for that to work, since i optimized the cloud layer to be always above the camera. Makes more sense in Earth Special Forces (players there don't get that high). Will do that when i have time on weekend

0

Share this post


Link to post
Share on other sites

recently  i read the gpu pro 7 article <>, i want to implement a volumetric cloud system myself.
Recently I read you thread, and it really made me want to implement a volumetric cloud system myself! :D 

 

This is running at 0.2fps, using brute-force code (no textures). Now I have to optimize it using all the knowledge in this thread. Thanks for the inspiration!

clouds.png

0

Share this post


Link to post
Share on other sites

Hehe yeah, this thread inspired me too. Couldn't force myself to rework my rendering system into something more flexible and after a week I'm done with a nice way to render such effects easily so I will also have a try. Stay tuned for questions coming from me soon :P

0

Share this post


Link to post
Share on other sites

 

recently  i read the gpu pro 7 article <>, i want to implement a volumetric cloud system myself.
Recently I read you thread, and it really made me want to implement a volumetric cloud system myself! :D 

 

This is running at 0.2fps, using brute-force code (no textures). Now I have to optimize it using all the knowledge in this thread. Thanks for the inspiration!

clouds.png

 

 

Well it certainly looks pretty, so that goal is accomplished! And by all means, grab DICE's take on this stuff here: http://blog.selfshadow.com/publications/s2016-shading-course/

 

Nothing dramatically changed, but some nice findings none the less.

 

Edit- Also, thinking about this, Naughty Dog had a nice hack with Uncharted called "mip fog". Which was just the skydome mip-mapped and applied as a kind of "fog texture" lerping between high mips for distant objects to low res for closer objects. It's a hacky way to do scattering and get your "fog" to seemlessly blending into your sky, and I'm sure you could come up with a way to do custom mips that hews closer to physical scattering.

 

But with volumetric clouds you need a way for close in scattering (below the cloud layers) to match the scattering from indirect light, which would be dominated by the skydome outdoors. So you could do the same thing here, grab a progressive/time sliced cubemap of the skydome (X by X pixel tiles per frame, lerp between previous tile to new tile over time to avoid worst artefacts at tile edges?) and then you could mip the skydome cubemap easy enough to do the same thing.

Edited by Frenetic Pony
1

Share this post


Link to post
Share on other sites

 

@Hodgman you planning on sharing an application with your findings ?

Sure. The quick prototype that that picture is from is a shadertoy :D 
https://www.shadertoy.com/view/Mt33zj The code is terrible and terribly inefficient though!
 
I started by stealing this atmospheric scattering shader by valentingalea (which is based on this article), stealing some noise functions from iq, and adding a cloud layer based on what I could remember from reading this thread.

 

 

the shadertoy is not very convenient, i create a prototype use unity.

the cloud shape is not very pleasing.

we can implement it together.

 

https://drive.google.com/file/d/0B-yvHJqS3C4PSWhNa0pWUDFNVkE/view?usp=sharing

1

Share this post


Link to post
Share on other sites

Recently this weekend i implemented the volumetric clouds as described in the gpupro7 book, vary much similar to what you guys have been showing here in this thread, however im having trouble with generating the noise textures... 

Looking at your project ChenA I think your noise textures are also incorrect?

0

Share this post


Link to post
Share on other sites

Recently this weekend i implemented the volumetric clouds as described in the gpupro7 book, vary much similar to what you guys have been showing here in this thread, however im having trouble with generating the noise textures... 

Looking at your project ChenA I think your noise textures are also incorrect?

 

i think the #35's noise texture is very simlar to gpu pro 7's noise texture.

you mean the perlin-worley noise?can you give a detail description of the incorrect?

 

base noise:
[sharedmedia=gallery:images:7682]
 
detail noise:
[sharedmedia=gallery:images:7683]
 

up is my noise, bottom is gpu pro 7 noise.

 

can you post a screenshot of your result?

thanks.

Edited by ChenA
0

Share this post


Link to post
Share on other sites

Hi Everyone. Andrew Schneider here.

 

It is really exciting to see all of this progress in our narrow field of realtime volumetric cloudscapes. A lot of our approach to cloud modeling relies on the noise textures, indeed. The examples above look very close to our cloud model - and better in some respects. Awesome.

 

We purposefully left code like sphere intersection out of the GPU pro article because it can be found easily. Graphics Gems (1998) P. 388, for example. The weather texture is also something we didn't elaborate on because it is just the result of combining several types of scrolling noise. We even hand paint some. 

 

Hey Andrew, loved the gpu pro article, any plans to put together a small demo?

0

Share this post


Link to post
Share on other sites

You can also find both the complete source code from Bitsquid here:

http://bitsquid.blogspot.com/2016/07/volumetric-clouds.html

 

Or a more working version that you can try on Unity here:

http://kode80.com/blog/2016/04/11/kode80-clouds-for-unity3d/index.html

 

The unity package contains everything, from source code to editing the weather maps.

 

These could be a good peek into this technique!

And again, thanks to Andrew that shared his (their) tech with us!

2

Share this post


Link to post
Share on other sites

Sorry for the late reply. We are hard at work on Horizon. 

 

I am looking into the best way to answer a lot of the questions that we have been getting over the past year or so. I need to discuss this with my colleages.

 

Please stand by until after you see Horizon on the shelves. 

 

Best,

 

Andrew

0

Share this post


Link to post
Share on other sites

Hi Everyone. Andrew Schneider here.
 
It is really exciting to see all of this progress in our narrow field of realtime volumetric cloudscapes. A lot of our approach to cloud modeling relies on the noise textures, indeed. The examples above look very close to our cloud model - and better in some respects. Awesome.
 
We purposefully left code like sphere intersection out of the GPU pro article because it can be found easily. Graphics Gems (1998) P. 388, for example. The weather texture is also something we didn't elaborate on because it is just the result of combining several types of scrolling noise. We even hand paint some.

I implemented clouds in Final Fantasy XV at Square Enix based on your papers, with slight modifications.
In fact, I was working on that when a few from your studio visited us in Tokyo (perhaps you were among them?). I had the basics of your clouds going on my monitor when your guys walked by, but no one took the time to point out that my clouds were based off your work.
Oh well! Look for them in Final Fantasy XV!


L. Spiro
0

Share this post


Link to post
Share on other sites

 

Hi Everyone. Andrew Schneider here.
 
It is really exciting to see all of this progress in our narrow field of realtime volumetric cloudscapes. A lot of our approach to cloud modeling relies on the noise textures, indeed. The examples above look very close to our cloud model - and better in some respects. Awesome.
 
We purposefully left code like sphere intersection out of the GPU pro article because it can be found easily. Graphics Gems (1998) P. 388, for example. The weather texture is also something we didn't elaborate on because it is just the result of combining several types of scrolling noise. We even hand paint some.

I implemented clouds in Final Fantasy XV at Square Enix based on your papers, with slight modifications.
In fact, I was working on that when a few from your studio visited us in Tokyo (perhaps you were among them?). I had the basics of your clouds going on my monitor when your guys walked by, but no one took the time to point out that my clouds were based off your work.
Oh well! Look for them in Final Fantasy XV!


L. Spiro

 

 

Feel free to contribute any tips or improvements! this is quickly becoming the go to place for cloud rendering. The sky's look particularity nice in XV!

 

 

Sorry for the late reply. We are hard at work on Horizon. 

 

I am looking into the best way to answer a lot of the questions that we have been getting over the past year or so. I need to discuss this with my colleages.

 

Please stand by until after you see Horizon on the shelves. 

 

Best,

 

Andrew

No rush, Horizon looks absolutely gorgeous. Look forward to seeing whatever you come up with post Horizon release.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now