DylanD Posted July 13, 2018 Share Posted July 13, 2018 Hello everyone, hope you day is going well. I was wondering if there was a way I could set up a light that had a black colour in an already lit scene, to make pseudo shadows like this: So heres a playground of an object bobbing in an out of the light, but I'm hoping to make it not white like but like a black light, or pseudo shadow. Notice how the point light does nothing when I make its colour black... Any Ideas how I could do this? I would rather not use a shadow generator... but if forced I will Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2018 Share Posted July 13, 2018 You have multiple options: - Use the shadowOnlyMaterial that you can apply on top of the mesh: http://doc.babylonjs.com/extensions/shadowonly - Simulate the shadow with a texture that you set in the ambientTexture channel Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 13, 2018 Author Share Posted July 13, 2018 9 minutes ago, Deltakosh said: You have multiple options: - Use the shadowOnlyMaterial that you can apply on top of the mesh: http://doc.babylonjs.com/extensions/shadowonly - Simulate the shadow with a texture that you set in the ambientTexture channel Oh I completely forgot about ambient stuff! that should work I will try it out and get back to you! Thanks! Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 13, 2018 Author Share Posted July 13, 2018 Both of these options seem to only work if I'm not using a material on my mesh, any other ideas? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2018 Share Posted July 13, 2018 They should work can you repro on the PG? Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 13, 2018 Author Share Posted July 13, 2018 10 minutes ago, Deltakosh said: They should work can you repro on the PG? https://www.babylonjs-playground.com/#LJPRIN#11 no black sides Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2018 Share Posted July 13, 2018 Ambient color is additive: https://www.babylonjs-playground.com/#LJPRIN#12 But ambient texture is multiplicative DylanD 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 13, 2018 Author Share Posted July 13, 2018 1 minute ago, Deltakosh said: Ambient color is additive: https://www.babylonjs-playground.com/#LJPRIN#12 But ambient texture is multiplicative wouldn't I need a texture for ambient texture? Also thanks, I didn't know that . Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2018 Share Posted July 13, 2018 yes you will need a texture. If you want, you can also leverage the material.lightmapTexture (which can be additive or multiplicative depending on material.useLightmapAsShadowmap) Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 13, 2018 Author Share Posted July 13, 2018 hmm in not using a texture but I guess I could just make the material a texture or something, I mean its just a solid colour it must be ezpz. I will look more into using ambient texture. Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted July 13, 2018 Share Posted July 13, 2018 my pleasure! DylanD 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.