0
\$\begingroup\$

In my engine I have the possibility to switch from isometric or first person camera, with a far/close camera point of view. In isometric mode the camera point of view can also be in either the -X or +X/-Z or +Z directions. These parameters are defined in the walking areas the player is allowed to go. All this to make the view the most pleasant and practical in a given part of my little world.

As I render dynamic shadows I have hardcoded some manual settings to optimize the use of the shadow texture to have the highest resolution possible for each camera setting. Note that for first person camera I'm using now cascaded shadows whereas I'm using a regular single shadowmap for isometric shadows.

I use an orthographicoffcenterLH DX11 matrix function for the shadow projection. The window parameter are adjusted for resolution based on the camera distance and the near/far for clipping.

The shadow view matrix is made from a lookatLH function with the At vector based on the actual position of the player modulated by the direction the player looks at depending on the camera mode while the Eye vector is calculated from the At vector with a distance factor depending on a the far/close parameter in the current walking area.

These manual settings make the tuning of this resolution optimization a waste of time and I need to find a proper way to do this in a more automatic way based on the Eye/At vectors. In particular on how to find the best window parameters fro the orthographic matrix.

\$\endgroup\$

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.