Shadow buffer size in game setting

In my game I have one lamp-sun and when I want nice shadow, then I set shadow buffer size to 8000 - my main computer can handle it, but my notebook need to 60fps reduce buffer size to 2000.
And I want create a script (I tried and failed) what can toggle or set shadow buffer size in runtime.
Please, if you can upload a blender file here instead of just a script, because only scripts often failed me and at least this will ensure functionality.

pretty sure you cant. you can try having two lamps and adding the right one, but i doubt that will work due to lighting limits and issues.

btw, shadows are a texture, so a power of two is the most efficient on the gpu. 1024, 2048, 4096, 8192 etc

EDIT: if you are using the new upbge 0.3.x eevee builds, then you can likely use bpy to change it. proceed with caution.

1 Like

I tried having two lamps and adding one before, but it not working. I using normal Blender 2.79, because UPBGE makes a few minor mistakes, that I don’t understand their essence.

Maybe I solved it through 2 lamps with both required shadow sizes. Depending on the desired shadow quality, I dim the light that creates the second shadow.

that will only be more costly. even lights at 0 or on a hidden layer still get processed.

just optimize for the least common denominator. you can also have a constraint on the sun to make it follow the player to reduce the needed resolution.

Ever tried baking the shadows for the static environment and only allow shadows for the dynamic objects such as the: Player, Enemies, Moving crates, etc.

1 Like