dsman Posted May 23, 2016 Share Posted May 23, 2016 ( Probably this isn't ideal post for babylon.js forum. But will help many learn lighting if some lighting expert can throw some insights. ) There's three.js based application which has very realistic lighting and shadows. I tried so many setup of directional, point, hemispheric lights. But unable to achieve so brightly lit scene and still without burnt areas. There are few things specifically which I would like some expert to throw some clue how to achieve : 1. Soft shadow in corner lines formed at junction of ceiling and wall. 2. Soft glow coming from sunlight passing from window. 3. Soft shadow thrown on walls by objects which are closer to walls. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 23, 2016 Share Posted May 23, 2016 Hello 1. This is SSAO: http://www.babylonjs-playground.com/?24 2. I highly suggest using a precomputed lightmap here (like in Espilit demo: http://www.babylonjs.com/Demos/Espilit/) 3. SSAO as well NasimiAsl and dsman 2 Quote Link to comment Share on other sites More sharing options...
dsman Posted May 23, 2016 Author Share Posted May 23, 2016 Wondering why I couldn't think of Occlusion this while looking at scene. Have came across Ambient Occlusion property of 3D Graphic earlier too. @Deltakosh How to make scene as bright as that ? Looking at the scene, I can't find effect of point light or direction light. The scene is consistently lit up. Its consistent ambient light that's everywhere. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 23, 2016 Share Posted May 23, 2016 @dsman Check out the babylon Hemispheric Light for ambient lightning , you can turn the intensity up and down as it pleases you with yourLightVariable.intensity = 1; (values range from 0.0 to 1.0+). Think of the intensity range as a percentage, 0.01 = 1%, 0.1 = 10%, 1.0 = 100%, 1.5 = 150% http://doc.babylonjs.com/classes/2.4/HemisphericLight Example code: var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 5, 0), scene); light.specular = new BABYLON.Color3(0, 0, 0); light.specularPower = 0; light.diffuse = new BABYLON.Color3(1, 1, 1); light.intensity = 0.75; Quote Link to comment Share on other sites More sharing options...
dsman Posted May 23, 2016 Author Share Posted May 23, 2016 I already have. So many times But it is not producing this kind of result. It can't show depth in the scene . Look at how the wall behind bookshelf and wall next to door doesn't show depth. Quote Link to comment Share on other sites More sharing options...
Kesshi Posted May 23, 2016 Share Posted May 23, 2016 Like Deltakosh already said. For static scenes a precomputed light map will give you the best result and the performance will be good. For dynamic scenes it gets more difficult. I think you need to use a combination of different tricks to fake something. - did you try the SSAO? - for the furnitures you could precompute an ambient occlusion map - you could try to add a point light to you camera, this way the walls in the back will be darker then the ones in the front Quote Link to comment Share on other sites More sharing options...
dsman Posted May 23, 2016 Author Share Posted May 23, 2016 I think SSAO , 2-3 Directional light, 1 Hemispheric light and 1 point light as well as some fixed lightmaps should do it. Will try doing it. Camera is not moving . So attaching point light to camera won't help much. Point light will stay in center basically. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted May 23, 2016 Share Posted May 23, 2016 to achieve that kind of "shadows" / depth you could try one of the options kesshi mentioned, but another. slightly simpler way could be to fix it with textures (mimic the shadows on wall textures), requiring the scene is completely static ofc and nothing else than the camera moves. It also doesn't seem like you have shadow's applied. in your above screenshot^^ they might help slight aswell Quote Link to comment Share on other sites More sharing options...
dsman Posted May 23, 2016 Author Share Posted May 23, 2016 Well shadows has its own issues. It is not producing soft shadows. I will see if I can create PG for it and post it in other post . How can static pre-computed Occlusion map be used? Same as light map ? Set on material.SpecularTexture ? What if we use Babylon runtime SSAO rendering pipeline with 0 refreshrate ? Considering the scene will be static. And nothing will ever move. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted June 14, 2016 Share Posted June 14, 2016 You better bake your lighting on lightmaps. Even in AAA games, SSAO can generate some kind of blurred spots, so it must be use sparingly and certainly not to fake full lighting of a 3d scene Quote Link to comment Share on other sites More sharing options...
dsman Posted June 14, 2016 Author Share Posted June 14, 2016 Yeah. We will use lightmaps and filter out meshes from depth pass to do SSAO selectively. 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.