mfprogrammer Posted April 2, 2018 Share Posted April 2, 2018 (edited) I am trying to build a closed attic with multiple roof windows. I will have the windows configurable in the attic. And a directional light (the sun) pointing to it. I would like to know if I add more windows, will the room be brighter? Can we see the difference of light brightening the room based on the number of windows? Not only the shadow falling on the floor, but I am looking for the complete room brightness based on the number of windows. Can this effect be seen with the standard material in babylon? Thanks. [EDIT] Here is a demo of what I have tried. http://www.babylonjs-playground.com/#4GBWI5#36 The shadow area remains the same with no difference based on the number of holes. So, does that mean babylonjs cannot render the above situation like what I have described in the standard material? If not, is it possible with PBR material? Thanks. Edited April 2, 2018 by mfprogrammer added demo and findings to it Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 2, 2018 Share Posted April 2, 2018 Hi there, MF! Sorry for the slow replies. No answers from me, sorry. I'm just showing a playground example... http://playground.babylonjs.com/#UUXLX#35 Camera is inside of a cylinder... with 'windows' cut into the walls... and full shadows ON (walls and floor)... while the cylinder is slowly rotating around the camera... while the shadowGenerator's yellow directionalLight is phasing .intensity. (phew, what a mouthful). Lines 55-61 ... changing those '8.25' numbers... adjusts the window/slot widths. Ok, ready for a little "sneak"? http://playground.babylonjs.com/#UUXLX#36 Notice the room's overall (ambient) brightness (the area of the shadows)... increases when the yellow directionalLight increases intensity. Look at line 225. I increase/decrease the .intensity of light2, a hemisphericLight... 1/8 as much... as the yellow directionalLight. YOU, my friend... could do the same. The more windows, the more you increase the room's ambient light. Sure, the directional/shadow light doesn't REALLY make the room any brighter, no matter how wide or how many windows. But... you can fake it. Light2.intensity = .1 * numberOfWindows. There ya go. The more windows, the brighter the room, yet shadows working normally, up to the point of washout from too much room ambient/scatter light. I dunno if anything can be learned from this, but it is a decent testing playground. kbye. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 2, 2018 Share Posted April 2, 2018 Hello, unfortunately adding more windows will not add more lighting per pixel because babylon.js does not support global illumination. We only support direct lighting (and some kind of indirect with SSAO but it is a trick) In your case I suggest doing something like what Wingnut mentioned Quote Link to comment Share on other sites More sharing options...
mfprogrammer Posted April 2, 2018 Author Share Posted April 2, 2018 @Wingnut , your solution is the classic 'if you can't make it, fake it'. I really appreciate the way you approached the problem and building the demos for me. I tried something like that by adding some more directional lights, but I didn't think about the intensity of the light(need to get a bit more wiser :P). Thanks a ton to lead me in the right direction. @Deltakosh , thanks for making it clear. Since I am a newbie, can you please tell me what SSAO means and how it could work in that approach? (just for me to understand) Thanks again for your time guys. Quote Link to comment Share on other sites More sharing options...
inteja Posted April 2, 2018 Share Posted April 2, 2018 SSAO documentation https://doc.babylonjs.com/how_to/using_the_ssao_rendering_pipeline And https://en.wikipedia.org/wiki/Screen_space_ambient_occlusion Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 2, 2018 Share Posted April 2, 2018 Terminology is one of the "bigger" parts of learning webGL. Remember... when we would use 3 x 5 recipe cards... or "flash cards"... to learn terms? Words written on one side, meanings written on the back. Perhaps someone will create The BabylonJS Flash Card Set... level 1, level 2, and level 3. Let the playground "flash" cardPlanes at us, and flip them over to show meanings, too. Heavy GUI textblock work. But but but... hmm. What database-o-terms/defs? Who chooses what should be included? Who gets admin/maintenance responsibilities? Related-to "The Great Glossary Project" that we once talked about in Tutorial Talk thread. Hmm. (Wingy nods to Inteja). Yep. Step #1, web search. Then forum search. Then docs search. Lastly, stand outside Deltakosh's house at 3AM and yell your questions into a megaphone. That's my favorite way. mfprogrammer 1 Quote Link to comment Share on other sites More sharing options...
mfprogrammer Posted April 3, 2018 Author Share Posted April 3, 2018 Hahaha..I'm sure we will get restraining orders as a new functionality even on forums then...:P Wingnut 1 Quote Link to comment Share on other sites More sharing options...
mfprogrammer Posted April 3, 2018 Author Share Posted April 3, 2018 @Wingnut , when do you actually use PBR materials? When I look at the PBR demos, they look just stunning. Can i use PBR materials for this implementation? I have had a look at the materials and I see that the hdr texture is assigned to the meshes/materials. This HDR material is made up of a file called environment.dss when I look at that, it looks like the complete surrounding. What happens when I build a house using PBR material but do not have a .dds file? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 3, 2018 Share Posted April 3, 2018 haha. I'm too noob to have an answer to that. https://www.babylonjs-playground.com/#1HQPOD#25 Know about reflection probes... and all that stuff? http://doc.babylonjs.com/playground/?code=pbrMaterial&page=18 18 pages of PBR playgrounds. Gruesome. Been to the PBR docs? http://doc.babylonjs.com/how_to/physically_based_rendering_master Stay tuned... others surely know more than I... about this. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 3, 2018 Share Posted April 3, 2018 If you don't have an environment DDS you are losing most of the interest of PBR (as it is essentially based on what we call Image Based Lighting: all the light comes from the environment) Quote Link to comment Share on other sites More sharing options...
mfprogrammer Posted April 4, 2018 Author Share Posted April 4, 2018 Ok. that's good to know. If I build a configurable house, there is no way to define a DDS file since the house is built runtime by the user and the user is allowed to go into the different rooms etc. with his camera. Hence, every room is going to have a different environment. Can we create DDS files on the fly based on the surroundings? Quote Link to comment Share on other sites More sharing options...
Guest Posted April 4, 2018 Share Posted April 4, 2018 yes sir: http://doc.babylonjs.com/how_to/how_to_use_reflection_probes Quote Link to comment Share on other sites More sharing options...
mfprogrammer Posted April 5, 2018 Author Share Posted April 5, 2018 Thanks, guys. This was really helpful. 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.