- Home /
Directional light leaves transparent window dark as it passes directly through it
I'm relatively new in using Unity and have stumbled upon a problem regarding the lighting of "windows" while trying to create a warehouse.
The sun/directional light is supposed to shine from the direction of the dark window at the right wall, yet despite having light projected through it on the ground it does remain dark while I get a shine on the window right near to it, as well as the one on the opposite wall:
This is how it looks from the outside:
The windows are assigned a Transparent/Diffuse Shader and that's a placeholder texture. When this is how it would look in real life and how I'd like it to look in Unity, in fact all windows seem to be "shiny" no matter what direction they are during the day since the sun is so strong, but no matter what Intensity I give the directional light in Unity (to the point that the window on the left becomes entirely transparent/white) the one on the right remains entirely dark:
If I change the direction the sun/directional light by rotating it 180° to shine from behind the window lights up, but the lighting on the ground and the shadows are coming from the wrong direction and the windows on the opposite wall become dark:
Basically, how do I fix this?
And maybe another related question regarding how I could get a slight Bloom/glowing effect over the windows and lamp lights in the warehouse like on the picture above so I don't get such hard edges without it affecting the entire scene and every object in it. Is there a way to apply Bloom or that slight "glow" only to/around specific objects instead of the entire camera rendering out and having to disable Alpha on everything?
Answer by Dex7er · Aug 04, 2014 at 03:26 PM
They are still darker from outside, but setting "Alpha from Grayscale" and "Alpha is Transparent" on the Window Texture at least fixed this issue somewhat and made the windows actually see-through.
Probably a common "Newbie mistake" thinking that just adding a Transparent Shader to a Material will actually give it Transparent properties without the need of an Alpha Texture.
As for the glowing effect, I ended up using a slight Image Effect/Glow over the Main Camera while setting the Alpha for all other Materials but the windows and lamps to 0.
Your answer
Follow this Question
Related Questions
Unity 5 Lens flares 1 Answer
Unity 5: Bloom causes artifacts on Terrain 2 Answers
Directional light leaking into indoor areas 0 Answers
The wall turn completly dark when not facing light. 2 Answers