Jump to content

Let there be light...


eps
 Share

Recommended Posts

I think I've got myself in a bit of a problem with light....

 

What I've currently got is this https://playground.babylonjs.com/#SJYUM3

 

What I'd like is something like this - https://playground.babylonjs.com/#IVIPF9 

 

but it seems the wrong way of doing it - I'd like the blocks to be the same material but for the light to darken on the more distant blocks, but then to lighten if they move closer to the camera.

 

Should I be using Spotlight?  Am I using it in the wrong way?

 

Help please!

 

Link to comment
Share on other sites

I got to this....  https://playground.babylonjs.com/#SJYUM3#4  Just to add an extra light and a couple of spheres to give the location and direction of the light involved.

 

Many thanks for this, I'm struggling slightly with the exponent part - I think the distances I need this to apply are quite small - due in part to the massive size of the meshes involved (the cubes are just to illustrate the example).  I think I might have to rebuild my meshes at the size required, but then all my other maths goes out the window...  Hmm...!

 

:)

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