Edit - Post Has Been Completely Redone
Hey guys, I’ve been playin with unity for a while a discovered a trick i learned. Faking Global illumination.
How Dose it work?
Its a fairly basic concept, but can be useful. Basically, If we have a primary light (a spot light for an example) its commonly used for flashlights, headlights, streetlights. but outside the range everyone (not everyone) notices something unusual about the spotlight. the answer = theres no bounce outside of the spotlight. a lot of people don’t think its such a big deal if the spot light dose not have a bounce, but it is. now when i say bounce i dont mean the light can just bounce up and down and left to right. a light bounce is an illuminating light. so if i look at my room and see the sunlight illuminating through the window, it illuminates the whole room. thats the best way i can explain a what a bounce looks like and what it dose. now heres an important thing to know when doing these tricks. if a primary light is illuminating lets say concrete. concrete is a rough material, lots of bumps and cracks in the surface. so in reality if the primary light is illuminating the concrete. the light on the concrete will bounce and illuminate the whole scene. cause the surface is so rough the light cant bounce directly. so it shoots every where. and a another thing to remember, in reality. every surface is reflective. even though we cant see it reflect, anything. it is. so the rougher the material. the less it reflects and the less or more the light will bounce.
anyways after such a long time typing lets get started.
FYI - if you can’t see the picture well, do command + (or control + if your on a pc) so the window or forum can scale larger. so go smaller you do the opposite command or control - (im saying this just in case if you dont how to).
Basic Bounce (Main Part)
So Lets Start With a basic scene. nothing advanced, just a simple scene.
as you can see, the scene is very dull and dark. so a scene with no bounces looks like this.
now to fix it, we need to fake it. doing it in realtime would be crazy and too expensive. so you can lightmap the scene.
so we do it by creating a point light and make it hover right above the primary lights illumination point. dont make it too bright or leave it at its default intensity, otherwise it will be too bright.
now dont put the light directly above it, but hovering above the illumination point.
Heres An Example On What We Need To understand and do.
now our scene looks much better now.
you can take it further by adjusting the ambient light in the render settings, or faking global shadows.
Faking Global Shadows
now global shadows in reality are more visible when the sky is Erie ,overcast, or raining, or if the sunlight is blocked by the clouds. when shadows are not visible. global shadows begin to appear. so if an area is darker or farther away from the real illuminating point of the sun. then the scene gets darker.
now to do this, were gonna need to light map out scene if you not have done it yet.
so ambient occlusion is gonna need to do some work.
Setup -
Key: Bolded Text = Important Step Or Info
Ambient occlusion = on (slider all the way to the max or near the max).
Contrast = Leave it default or make the value higher (higher values will make the effect darker).
Max Distance = 5 or 6 ( you can make it go farther, it depends on what you want it to be).
Our Scene Already Looks So Much Better.
Now theres a diffrence between haveing global shadows and not having global shadows. the results are very visible. so as you can see, the shadow has a darkening range from the edge into the road. and the side of the block is more visible.
(fyi it mabye darker for you when looking at this picture, depends on how bright your monitor is)
- Video Tutorial -
comming soon
Conclusion
Our Results are satisfying. (depending on what you did and think).
So we know that every light has a bounce, and every surface is reflective depending on how rough or smooth the material is.
so now we now how to fake global illumination (or bouncing light), static. whats the difference. static is not done in realtime. it is baked into textures or scenes so the cpu dose not have so much work to do. realtime is calculated every single frame, better when using destruction or animating objects but more expensive.
Now Some of you know this trick, yes i know its an old trick but it can be really useful for beginners in unity.
Tips
~ Keep A low intensity on the light so you don’t overexpose the scene.
~ Primary Lights with low intensity usually don’t need bounces, depending if its above 0.2 or lower.
~ When Lightmapping, set the baking mode (or the rendering mode on the lights to baked only so its not interfering with both lightmap and realtime objects. again this depends on you.
I hope you guys enjoyed this tutorial, leave any suggestions or show us your results with the help of this tutorial.
Happy Coding!
~ Frostbite23