4
\$\begingroup\$

I have read this tutorial: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/

I wonder, is this the current best technique for generating shadows in an arbitrary 3D scene? Is it the way current modern games implements directional light shadows or are they using some other better way of calculating shadows on the fly?

What I mean is if you know your geometry so good that you know exactly every impact a shadow can have on an objects colors, it must be better to use that information instead of rendering a Shadow map?

For example, if we have a 3D grid world with all perfect cubes at perfect offset (think minecraft) and the directional light if exactly 45 degree in all dimensions, that leave us with a situation where a cube closer to the light will also cast shadow on the entire cubes at position offset -1, -1, -1 from that cube, and so on. The shadows always go diagonal and put other equally sized cubes sides in 1 of three states: all shadow, all light or 50% in shadow.

If we know our geometry so good, then using that information must be much faster than rendering shadow maps right? Even when most of such calculation is done on the CPU instead of the GPU.

\$\endgroup\$

closed as primarily opinion-based by Sean Middleditch, Seth Battin, Jari Komppa, Anko, MrCranky Apr 22 '14 at 10:09

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ There are many ways to generate shadows; just shadow mapping has many variations, plus there are entirely different techniques which are older than shadow mapping but still used in some circumstances. Which is "best" depends on what you're trying to accomplish, not what some other games chose to use. \$\endgroup\$ – Sean Middleditch Apr 12 '14 at 0:26
  • \$\begingroup\$ My situation is a 3D voxel grid where the 3D environment is currently all cubes (think minecraft, and you get the idea). Since I in advance know all cubes positions and they are all equally sized, is there any known technique to bake the shadowing information into a VBO before sending it to the GPU and is it a good idea? My question is not really about cube world, but any 3D scene where we everything is placed at equally offset positions and all the geometry is really simple. Can we have benefits from doing the shadow calculations on the CPU instead of the GPU and are modern games doing that? \$\endgroup\$ – GlamCasvaluir Apr 12 '14 at 9:18