Jump to content

how to make a realistic attic with sunlight through the windows


Recommended Posts

Hi Guys, 

I am new to Babylon. Just started with it and was wondering if something like this possible and if yes, how do I go about it?

This is what I can build using the Standard material. 



My client is looking for something more realistic in the following.
1. Sunlight in the attic
2. Reflections after the sunlight in the attic

I am looking around if this is possible.

I have seen the PBR material in Babylon. I see that the HDR texture is given to every material in the demo (which is actually the surrounding/skybox). That reflection is seen on all the materials and hence, looks realistic.
I am referring to this demo https://www.babylonjs.com/demos/pbr/

I am wondering if I can use PBR material for walls, the floor in the room and add a directional light through the window.
Is what I am thinking about possible? Please correct me if I am wrong.


I am looking to build something like this. Will PBR material help to reach somewhere here or even close to it?


Link to comment
Share on other sites

Hi MFP, welcome to the forum.

You MIGHT have "reflections" and "shadows" a bit confused.  The sunlight-through-openings is done with BabylonJS shadows.

All in all, YES, the effect you show in the pictures... is quite possible.


In the above playground demo... a directional light is low-orbiting around a roofless cabin.  Much like the light effects in your pictures, we can also see the directionalLight in the playground...  shining thru the gaps in the shadow-casting cabin logs.

The cabin floor receives shadows/highlights nicely, but notice that they are also cast upon the walls.  So... shadow casters can also be shadow receivers, and casters can even cast shadows upon themselves.  Fun!

Feel free to make edits and more saves of that playground... have some fun.  You can't overwrite/wreck anything in our playground... it's a good place to learn and play.  If you discover something you want to share with us, use the playground SAVE feature, and then paste the new URL into this thread.  We can talk about it.

I hope this helps.  Highlights/shadows are created with lights and shadowGenerators.  Reflection textures are somewhat different, as far as I know. 

Others may comment soon... so stay tuned.

Link to comment
Share on other sites

Hi Wingut, thanks for getting back.

I see what you have done there. The shadows do pan out well. 
The material you used to build the cabin and the floor are Standard material. Can I use PBR material to build a cabin?
The reason I am looking for it is, every material when in contact with sunlight turns out to look bright and also reflect light to a certain extent.

On PBR material, the directional light looks realistic.
What i see is that the PBR materials have the reflection and refraction set to hdrTexture

 glass.reflectionTexture = hdrTexture;
 glass.refractionTexture = hdrTexture;

This helps them to reflect in a realistic way.  They are made using a .dds file.

Now when a closed room is made, there won't be a .dds file different for every room. Will the wood in PBR material still reflect and refract? What can be massed as the hdr texture to it?

Is my approach to this right? Or am I missing something?


Link to comment
Share on other sites

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