Jump to content

Shader Conversion


nittrus
 Share

Recommended Posts

Would anyone like to convert this http://shaderfrog.com/app/view/904 to a BabylonJS useable format, I know nothing about shaders at this time and would like to use this one since it is freely available to use. It exports to Three.js format which appears to be allot similar to BabylonJS, if it is simple could someone explain what is needed, if it is not so simple would you care to help out. If there is a fee, please let me know!

Also, it would be AWESOME to see someone make an exporter for BabylonJS for ShaderFrog, just an idea! :)
In the meantime I think it's time to learn a bit about shaders.. looks very mathy..

Link to comment
Share on other sites

1 hour ago, NasimiAsl said:

Cool, I'm trying to figure out how to make the background colour match my sky or become transparent only having the white bits, other than that the first one you showed me is working great. It seems to me the background colour is also multiple mixed shades of blue, darker around the edges or maybe a light source near the center is uneven over the whole area?

Link to comment
Share on other sites

 

   
   float ns1 = noise(vPosition.xyz*0.1 /* scale of big cloud noise */+vec3(vUv.x,vUv.y,0.) + vec3(time*0.08 /* speed of big cloud move */ ) );
   float ns2 = noise(vPosition.xyz*1. /* scale of small cloud noise */+vec3(vUv.x,vUv.y,0.) + vec3(time*0.13 /* speed of small cloud noise */) )*0.5+0.5 ;
    float ns3 =  min(1.,max(0.,pow( ns1*ns2 ,1.5)*3.)) ;
    gl_FragColor = vec4(vec3(0.2,0.4,.8  /* background color */)*(1.-ns3)+vec3(1.,1.,1./*  cloud color */) *ns3 , 1.0);

 

http://www.babylonjs.com/cyos/#2ACSTF#6

 

make your sample in PG and your sky mesh for make edge 

Link to comment
Share on other sites

11 hours ago, NasimiAsl said:

 

   
   float ns1 = noise(vPosition.xyz*0.1 /* scale of big cloud noise */+vec3(vUv.x,vUv.y,0.) + vec3(time*0.08 /* speed of big cloud move */ ) );
   float ns2 = noise(vPosition.xyz*1. /* scale of small cloud noise */+vec3(vUv.x,vUv.y,0.) + vec3(time*0.13 /* speed of small cloud noise */) )*0.5+0.5 ;
    float ns3 =  min(1.,max(0.,pow( ns1*ns2 ,1.5)*3.)) ;
    gl_FragColor = vec4(vec3(0.2,0.4,.8  /* background color */)*(1.-ns3)+vec3(1.,1.,1./*  cloud color */) *ns3 , 1.0);

 

http://www.babylonjs.com/cyos/#2ACSTF#6

 

make your sample in PG and your sky mesh for make edge 

Thanks, you're very helpful.

Side note, when I change the scale of the big cloud from 0.1 to 0.01 it makes it bigger but there is straight edges that float through the material, I wounder if I must change the time with it or something..

Edit: nope it does that before I made changes, guess that is normal for that shader and I just didn't notice it, but I can live with that!

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...