Shadow map - how to properly create a render target? (SOLVED)

A spotlight is generally specified using a cone (angle), and doesn’t have a ”near” plane.

1 Like

Ah, true, didn’t imagined it correctly :confused:

But well, if it’s used to create a depth buffer, you generally want to render a bit more than what is visible (but as small as possible to utilise available resolution for the details the most).

In another video depth buffer is anyway slighlty larger than needed area, because it helps to solve issue regarding PCF, where penumbras are changing/flowing with every camera move (a shimmering effect):

(also PCF is nicely explained here):

So that in it, the developer trick solved it by creating bigger depth buffer than main camera’s frustum:

I just imagine in such a case, whether a frustum used for depth buffer is a cone or “truncated pyramid base” (or is there a proper mathematical name for this figure in English? xD)

(I’m bookmarking this topic, it became a cave of knowledge on shadows :D)

Not necessary if you use the render.set_camera function:

1 Like