Jump to content

fragment shader instead of skybox


BruceLane
 Share

Recommended Posts

Yes its possible: http://pixelcodr.com/tutos/trees/trees.html

 

Check this shaders

http://pixelcodr.com/tutos/shooter/game/shaders/

    // Skydome    var skybox = BABYLON.Mesh.CreateSphere("skyBox", 50, 500, scene);    // The sky creation    BABYLON.Engine.ShadersRepository = "shaders/";    var shader = new BABYLON.ShaderMaterial("gradient", scene, "gradient", {});    shader.setFloat("offset", 200);    shader.setColor3("topColor", BABYLON.Color3.FromInts(0, 119, 255));    shader.setColor3("bottomColor", BABYLON.Color3.FromInts(240, 240, 255));    shader.backFaceCulling = false;    skybox.material = shader;

Those aren't mine, credits from Julian: http://pixelcodr.com/aboutme.html

Link to comment
Share on other sites

I was actually looking into building a full day/night/weather sky shader a few weeks ago. There seem to be enough resources on the web, with a lot of it being fairly straight forward and definitely do-able in Babylon.

 

Essentially a basic version just needs to scroll through a few textures based on your time of day and sun position.

 

So if you want something fancy this is always possible. It's not at the top of my list to work on at the moment, but maybe one day if someone doesn't get there first.

Link to comment
Share on other sites

It worked once for me, then broke as well!

I looked at the console, and it was whining about security, so I put the image on imgur and... I think it works now: 

http://playground.babylonjs.com/#9VC8L#3

I slowed down color changing, as well as made the skybox always follow the camera. This makes it so you can't leave the beautiful blue sky. :)

 

I wonder...

Would it be possible to have several layers of skybox? One with gradient, and then several others that fade in and out depending on time of day....

One example would be beautiful stars... such as http://static-3.nexusmods.com/15/images/110/939721-1350318578.jpg

My mind would blow if we could make a sky like this...

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