Universal 1st/3rd pers. AGK Framework( - physics) WIP

Started by Rick Nasher, September 24, 2017, 19:26:37

Previous topic - Next topic

RemiD

for stencil shadows made with shadow volumes, the camera is not positionned at the lightsource position... it depends on the tech used...

Rick Nasher

#61
Quote from: blinkok on December 12, 2018, 23:46:38
Is the code in the first post still the latest?
Good point.  8)  Need to update.
[EDIT: I already had under post# 27 ]

But perhaps bit hard to follow so I'll put it in the first post too, to avoid confusion.



Quote from: RemiD on December 13, 2018, 06:44:45
for stencil shadows made with shadow volumes, the camera is not positionned at the lightsource position... it depends on the tech used...
True. AGK uses a couple of different approaches I believe, depending on the shadow mode.

From the docs:
Quote"SetShadowMappingMode
Description
Turns shadow mapping on or off, by default this is off. Shadows are only generated by the the global directional light, which can be controlled with the SetSunDirection command. Note that this is not guaranteed to be supported on all devices, you can check for the current device by calling GetShadowMappingSupported. There are currently three shadow modes that can be used, mode 1 uses Uniform shadow mapping which has lower but consistent quality. Mode 2 uses Light Space Perspective shadow mapping (LiPSM) which has higher quality in most cases but if the camera is looking in the same direction as the light then it is no better than Uniform shadow mapping. Light Space Perspective also suffers from shadow shimmering as the camera moves whereas Uniform is more stable. Both have about the same performance. Mode 3 uses Cascade shadow mapping which uses multiple shadow maps to maintain high quality near the camera whilst still allowing lower quality shadows in the distance. This method has much lower performance than the previous two methods but results in better quality shadows in all cases.

Note that when using modes 1 and 2, texture stage 7 on all objects receiving shadow is reserved for the shadow map. When using shadow mode 3 (cascade shadows) then texture stages 4, 5, 6, and 7 are reserved for the shadow maps. "
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________