Sorry if my question is too noob, but here’s the situation. I have an auto runner type of game with a couple of directional lights with soft shadows enabled. Currently all shadows for all objects are being calculated in realtime. And I want only the main character and probably a background walls to be included into calculation of shadows. How do I optimize the scene so that static objects are not included in calculations at runtime? What is the best way to optimize lights in general? Any hints, links to documentation or videos would be much appreciated!
No ideas? ![]()
Lighting is a deep subject. Have you read the manual’s relevant sections? It goes into detail about the different types, baking, etc.
Ok, I’ll check. Thanks!
I’m working on shaders lately, which dips into this topic because you don’t really know what you game will look like until you put the shader code on a material that’s also under the same lights your actual game is.
-Lighting panel
-Directional light
-Quality settings
All of these play a role…
Global Illumination is a texture with static baked lights, “Realtime GI” is, in layman’s terms, the same thing but from different angles and the system interpolates somehow. Baking Realtime GI is a fairly advanced technique and can be very expensive to render, it basically solves your “night and day with thousands of structural shadows” problem. As far as I know both of these techniques only work for one directional light.
GI also gives the computer a chance to bake a costly bounced lighting simulation, making for great ambiance.
The major drawback is that these do need to be static elements.
Mixed mode is where you run both.
You can make a good looking scene with just real time lights. Remember, GI is a technique invented to solve a problem and achieve a certain aesthetic, it gives you more design options; but you should look into why it exists and ask yourself if your scene has those problems.
If you don’t like the look of your shadows, it could be the cascade settings (LOD for shadows), biases(begin/end offset at object edges), or scale of the objects being shaded and the distances involved. The default shadow distance is only I think 150, try turning it up to 1000.
JayMounes thanks a lot for the wide answer man! Yeah I got it now. But I was actually wondering about the workflow itself
And what I need should be very basic thing - the easier - the better. I have platforms spawning and coming at my player character which stays in the same position basically. So I was wondering how do I set up my 2 directional lights so that they don’t cast unneeded shadows on the objects that are on those constantly coming platforms.
Hi
I have a suggestion please consult me.
I thought maybe it could to bake shadow of tree into texture in blender then save it as PNG with alpha channel and import as sprite in project and attached it to the tree prefab as a child .
Is this method good for optimization on mobile when we have forest or a hug number of trees ?
Note to picture below that the palm shadow is a sprite.
