## Recommended Posts

So the 3d noise function is from inigo quilez (volumetric clouds):

##### Share on other sites

ooo I bet I can make that work.

##### Share on other sites
``````//  https://www.shadertoy.com/view/4sfGzS
float iqhash( float n )
{
return fract(sin(n)*43758.5453);
}

float noise( vec3 x )
{
// The noise function returns a value in the range -1.0f -> 1.0f
vec3 p = floor(x);
vec3 f = fract(x);

f       = f*f*(3.0-2.0*f);
float n = p.x + p.y*57.0 + 113.0*p.z;
return mix(mix(mix( iqhash(n+0.0  ), iqhash(n+1.0  ),f.x),
mix( iqhash(n+57.0 ), iqhash(n+58.0 ),f.x),f.y),
mix(mix( iqhash(n+113.0), iqhash(n+114.0),f.x),
mix( iqhash(n+170.0), iqhash(n+171.0),f.x),f.y),f.z);
}``````

##### Share on other sites

http://www.babylonjs.com/cyos/#14WKFU#10

well that does not really produce a scatter map though... so Im confused, I think ill use my noise functions for a lot of the texture sample noise that people do.

##### Share on other sites

float map (in vec3 p, int steps){
vec3 q = p - vec3(0.0,0.1,1.0)*time;
float f;
float dim = dimVal;
float stm = 2.;
float sts = 0.1;
f  = dim*pNoise( q ); q = q*stm;
dim*=0.5;
stm+=sts;
for(int i = 0; i < steps - 1; i++, stm+=sts, dim*=0.5){
f += dim*pNoise( q ); q = q*stm;
}
f += dim*pNoise( q );
return clamp( 1.5 - p.y - 2.0 + 1.75*f, 0.0, 1.0 );
}

and i dont know we he defined 5 different map functions... here they are wrapped into 1.

##### Share on other sites

thats looking great.

##### Share on other sites

That is really volumetric...

##### Share on other sites

your noise function helped a whole lot!

screw mine its way to slow, and it would work only for a single calculation not the amount needed to ray march.

##### Share on other sites

With different step counts:
http://www.babylonjs.com/cyos/#1L6DHU#13

The problem is still the number of samples and where those samples are.

(

This uses 120 steps too. but all steps are in the cloud itself...
http://www.babylonjs.com/cyos/#14WKFU#14
)

Just how to combine a few steps of haze and sky colors and a few steps of cloud volume.

##### Share on other sites

dude I hate the CYOS... I just had the clouds combined with my sky and accidentally hit backspace while not having focus... fASDFHJKLASDFJKASFAFN

Ill have it here again in a min...

##### Share on other sites

How to convert this from equirectangular to free-looking sky?

##### Share on other sites

Ill do it sometime today, Ill make a scene where your sitting on the ground and this is going on above you... maybe set it to some music.

I need to take a deep breath and calm down now... Im so mad I had it done and tried to change one setting to just lose it all... but hey I know how i did it so yeah...

##### Share on other sites

http://www.babylonjs.com/cyos/#14WKFU#18

Whabam...

http://www.babylonjs.com/cyos/#14WKFU#20

Just need to make the clouds darken now when the sun goes down... should not be hard. then transpose all this to above head and build a scene.  we should have something cool!

##### Share on other sites

I think for projecting from ground level it will be smart to separate the shaders...

##### Share on other sites

You mean above-the-clouds and from-the-ground shader?

##### Share on other sites

yeah, unless your in the air they need to be separate.

##### Share on other sites

iqnoise what ?  RIP

##### Share on other sites

a very basic implementation of noise or randomness  that i like
fract sin dot

##### Share on other sites

http://www.babylonjs.com/cyos/#5ZKUC#3
http://www.babylonjs.com/cyos/#5ZKUC#6

Im waiting for my cliff texture to bake out then Ill do the scene that I was talking about.. but till then heres this for you guys to mess with.

I gotta finish up work for a client now so Ill be off for prolly the rest of the day!

Peace!

##### Share on other sites

So here is a preview to the new CYOS that I am working on... Should have most of the core stuff done today and we should start being able to add "nodes" for more robust features... The idea is the script will be complied off a node stack and only the functions you need to make the shader work will be included in the shaders and will hopefully be optimized, so not very human readable but hopefully fast.

Finishing up nodes for common things like attributes,uniforms, varying and their like wise constructors... Simple functions and procedural nodes and conversion nodes to turn like a black and white input into a normal map ect...

Let me know what you guys are thinking its really raw right now and I may eventually do away with using BJS for the shader work, but will have it export specifically for that platform... there is just a lot of BJS stuff I dont need and I could simplify the output with a quick GL program of my own... umm otherwise Ill post updates soon and explain how you can contribute nodes.

Im working on the UI system for the wire links now, but I already kinda have that built into mmmPie and it should not be a problem!

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.