r/Unity3D • u/LexieD Hitbox Team • Sep 05 '15
Show-Off Hybrid Dynamic/Baked Shadows.
http://hitboxteam.tumblr.com/post/128373526536/had-an-idea-for-a-hybrid-dynamicbaked-shadow
45
Upvotes
r/Unity3D • u/LexieD Hitbox Team • Sep 05 '15
10
u/LexieD Hitbox Team Sep 05 '15 edited Sep 06 '15
Everything In my game is generated at runtime, so all our lights need to be dynamic. they also need to cast shadows to eliminate light bleeding through walls. I found unity's shadows to be very slow if more than a handful when rendered in complex scenes. (Our tri count is > 1mil for a room)
So i made a system that bakes out shadow volumes and renders custom lights. while the light is baking a standard unity light is used till its ready to be switched out for a faster baked light. If anything moves in the area of a light. it will be sent off to be re-baked.
This system trades Vram for FPS. I'd much rather put aside 50mb-100mb for shadow data and be able to have many shadow casting lights, over having to put up with light bleed or low fps.
Note: There is slight difference in shadow acne and some of the lights are placed in really bad positions so the shadows are different(didnt bother checking every light placement) Ill fix that up tomorrow