Jump to content

How will lighting effect through multiple windows in a closed room?


Recommended Posts

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?


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?


Edited by mfprogrammer
added demo and findings to it
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.   :D  That's my favorite way. 

Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

haha.  I'm too noob to have an answer to that.


Know about reflection probes... and all that stuff?


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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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?


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