Jump to content

Setting a gradient background


Rajkumar
 Share

Recommended Posts

Hi again @Rajkumar, how ya been?  I hope well.  After a quick forum search for 'gradient', I found that our local hero @Temechon introduced us to a gradient shader, and used it in a few demos...  http://www.html5gamedevs.com/topic/8160-gradient-shader

In some of the demos in that thread, the URL to the cloud picture ( http://www.babylonjs.com/Scenes/Clouds/cloud.png )... is failing to load-in.  You might see checkerboard clouds instead.  Not sure why that is happening, and it's not pertinent to the issue.

Another way to background-up, is the use of a background "layer", and texture it with a gradient image. 

http://www.babylonjs-playground.com/#27QHMX#1

Lines 206-208 do the dirty deed... on this exquisite Spherical Harmonics demo by @jerome

We may see yet another layering system soon, in the arrival of @Nockawa's new Canvas2D system.  Likely, it has the power to use JS to generate dynamic gradients without shaders, as well as having the power to do TONS more.  But I think it is a GPU-based system, which makes it... umm... shader-related?  I dunno.  I haven't had the enjoyment of experimenting with it, much, yet.

Hope this helps.  Be well!

 

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