Shadow of the Sun in OpenGL

OpenGL shadow rendering before and after hidden tricks. Left jagged edges, right with a bigger Frustum.

When using OpenGL render for previewing or rendering I have run into a few problems. The size of the shadow of the Sun Lamp is too small and the edges are jagged (pixelated). In the shadow options of the Sun Object Data in the Blender Internal renderer there is little you can change to overcome these problems.

Shadow of the Sun – Blender Internal render

A little trick I found is switching to the Game Engine. In some ways the game engine is limited but you can change hidden options and go back to the Blender Render engine without losing changes you made to these hidden rascals.

Blender Engines

In the Sun Lamp shadow you now miss some but also gain some options. The first noticeable is the Quality option. There is a Size option added and you can change the resolution of the Shadow Buffer. Standard is 512 and on my project I could switch it to 4k (4096) without a problem. Cool, the problem with the jagged edges is resolved. How about the second problem, the size of the shadow? Look at Frustum Size. Change it to what you need to make the size of the shadow bigger. Be aware that there is a limitation to the size; when you make the Frustrum Size bigger the resolution of the shadow goes down because the Shadow is in fact scaled up in size. Now switch back to the Blender Engine to get back all the options needed there.

‘Hidden’ options in the Game Engine

Frustum is a word I never heard of before and if you are like me and want to know more, here is the Frustum Wiki.