Jump to content

Shader Talk


Pryme8
 Share

Recommended Posts

//  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);
}

No-texture version from the comments

 

Link to comment
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.

Link to comment
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.
 

Link to comment
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...

Link to comment
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!

Link to comment
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!

 

preview.jpg

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...