Jump to content

Full light for specularTexture


Recommended Posts

Hi everyone.


I have a doubt, need to illuminate a specularTexture but for the effect I am looking for the light must be absolute (everywhere) and I can´t achieve it with hemispheric lights:

var light1 = new BABYLON.HemisphericLight("hemi1", new BABYLON.Vector3(0, 1, 0), scene);   light1.intensity = 1;var light2 = new BABYLON.HemisphericLight("hemi2", new BABYLON.Vector3(0, -1, 0), scene);   light2.intensity = 1; 

Because only this illuminate a couple of small areas.


What can I do?


Thanks and regards.

Link to comment
Share on other sites

Hi guys.


  Light2 is not normally necessary.  Yours is shining at the ground -y.  Most people would use light1.groundColor = new BABYLON.Color3(.5, .5, .5);  That shines some color upward from the ground.  This is how you light the bottom of mesh... with a hemispheric light.


Your light1 is perfect.  It is aimed straight up, bouncing its light off the scene's hemisphere (atmosphere)... lighting up everywhere... all sides of all mesh. (But not their bottoms. That's done with light1.groundColor, as shown above.) 


Light1 should work.  Experiment with light1.range, too, for something to try.  Holler if you still have problems.  One hemi normally has the power to light-up the entire solar system, so... if it won't, something is broke.  :)  Please create a playground that illustrates the issue, if possible.


A specularTexture?  A texture used in the place where a light would normally reflect off-of a mesh material?  That's an interesting thing to try to "illuminate".  Maybe you would want an emissiveTexture or opacityTexture? 


SpecularTexture?  Man, that's some mad scientist thinkin', there.  :)  Lighting a specularTexture...  it even hurts my mind to TYPE that.  heh


Possibly, use the same texture in emissiveTexture... as you do in specularTexture.  Now adjust mesh.material.emissiveTexture.level = ??.  It MIGHT work as a brightness knob for your specularTexture.  ALL textures have levels. 


Also, StandardMaterials have .specularPower  I'm not sure if .specularPower will affect a specularTexture, but maybe.  Playgrounds, playgrounds, playgrounds.  :)  Teach us what you discover, please.

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.

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.


  • Recently Browsing   0 members

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