DGL https://delphigl.com/forum/ |
|
ARB Shadows https://delphigl.com/forum/viewtopic.php?f=19&t=3349 |
Seite 1 von 1 |
Autor: | noeska [ So Okt 10, 2004 18:31 ] | ||
Betreff des Beitrags: | ARB Shadows | ||
On a look for an alternative for stencil shadows i found: http://www.paulsprojects.net/tutorials/smt/smt.html I tried making an imlementation of it to delphi. Somehow i do not get the same result as the original demo? (shadows make me go ![]() I post the result so far here in the hope someone will spot my mistake ![]() EDIT: new file uploaded...
|
Autor: | Sascha Willems [ So Okt 10, 2004 18:33 ] |
Betreff des Beitrags: | |
Better forget about normal shadow maps and try to get shadow volumes working. Shadow maps have too many drawbacks to be really usefull in most scenes. The worst thing about them is getting the values for polygon offset right, cause they are different for all scenes. There are techniques like perspective shadow maps that decrease the drawbacks of that technique for general use, but those techniques are really hard to learn/implement. |
Autor: | noeska [ Mo Okt 11, 2004 11:27 ] |
Betreff des Beitrags: | |
The error must be somewhere in the matrix calculation and order of matrix values, but i cannot seem find the problem. Sascha Willems: The advantage of doing shadows this way is that it is hardware accelerated. There is no need to calculate geomtry on the cpu. (have a look at the tutorial). |
Autor: | Sascha Willems [ Mo Okt 11, 2004 11:34 ] |
Betreff des Beitrags: | |
I know that. I have a working sample on that on my homepage (including source, so you may look at taht), but as I said it's no general purpose technique, as you always have to tweak the values for glPolygonOffset depending on how your scene looks like, or you'll get nasty artefacts. But what makes things even worse is the fact that these values not only differ from scene to scene, they also may differ from gfx-card to gfx-card. On top of that, you need depending on the scene mostly a huge texture for the shadow map, and the bigger the part of the scene gets thats shadowed by the shadow map, the worse aliasing gets. That's because the huger the scene get's, the huger the part that's covered by one texel of the shadow map. And last but not least : Filtering for shadow maps is different on different cards. Where NVidia cards do a nice filter, so that the edges of shadow maps look almost smooth, ATI cards don't do filtering at all (cause they can't of a hardware limitation). This means that your result looks totally different on NVidia compared to ATI. So to make it short : If you want shadow maps for general purpose, use perspective shadow maps. But I suggest you go with shadow volumes. |
Autor: | LarsMiddendorf [ Mo Okt 11, 2004 11:45 ] |
Betreff des Beitrags: | |
Shadows from shadow maps are ugly and suffer from aliasing. You have to render six views for a pointlight. That's slow because of the switch to the pbuffer context. You can copy from backbuffer, but that forces you to render all the lights before the scene and to store 6 highres shadowmaps pre light. The only chance to get acceptable results is filtering in a fragment program. The problem with Radeon cards is, that the max. length of a fp is very limited and they don't even support texture filtering on shadow maps. You can emulate this filtering but it costs you 4 texture accesses and 10-20 arithmetric instructions. Applying a 8x8 random blur filter to the unfiltered shadow in screen space looks also very good, but it's too slow to be usefull today. The problem is, that the shadow is pass is usually only one pass during the rendering of a complex scene. I added soft shadows to Sascha's Demo for testing. The edge detecting on CPU is not really a problem. You don't need millions of polygons if you use complex shaders and with z-correct bumpmapping the stencil shadows are also z-correct automatically. Polygon Offset is not necessary if you render the backfaces only. |
Autor: | Mars [ Mo Okt 11, 2004 19:13 ] |
Betreff des Beitrags: | |
BTW if you don't need self shadowing for objects, it's entirely sufficient to use a simplified mesh for stencil shadow generation (just have a closer look at the shadows in Morrowind ![]() |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |