How to achieve Cascaded Shadow Mapping on Terrains in Blitz3D
👉 BlitzCoder will be building a new platform and other plans to preserve and continue the Blitz legacy.
To be able to achieve this goal, we need your support by becoming a Patreon Paid Member 👈
Tweet blitz3d tutorials
This is on top of my head and still proof of concept, so not yet tested performance wise and also what the outcome would look like.
To address the fog effect on shadows over distance, perhaps using a gradual texture alpha value applied on each texture.
- Take the Shadow Terrain Code provided by jfkEO here:
https://www.blitzcoder.org/forum/topic.php?id=544
- Now instead of using mesh hugging collisions which takes up more cpu power or fps, use the Move Object Shadow Along Terrain code by Weibo here:
https://www.blitzcoder.org/forum/topic.php?id=1139
- Create the next camera and apply the code combination above with some modifications for each cascade or split as illustrated below.
- With each camera positioned correctly achieving the layout below.
- The texture resolution will be of the same size for efficiency even farther away from the player or main cam.
- Rinse and repeat on succeeding cameras.The recommended is 3 - 4 splits as shown..
Further Reading:
https://dev.theomader.com/cascaded-shadow-mapping-1/
My version of decals on terrains which I have used grid checking to make sure the shadow position relative to the player is accurate..
That looks very accurate , I remember using the Terrain Decal code from the forums forever ago to do Shadow maps on the terrain.
It worked But was hard to keep the light offset because it did get very inaccurate even if just using Straight down the Shadows
kinda moved towards the camera the closer you got to objects. It was okay for canopy shadows but thats about it.
Also tried to use that code to make Terrain mega textures. read 1024x1024 from a huge say 16kx16k loaded image and map around the Player
using the Decal.
It did work and was fast, just realized i would need like a 64k x 64k image to get close to pixel level. No tools could output that res that I had. lol
and imagine painting that by hand..hah
Sam
Cheers Zmatrix. Yes, this is still a bit of a challenge and interesting to dive into at the same time.
Also tried to use that code to make Terrain mega textures. read 1024x1024 from a huge say 16kx16k loaded image and map around the Player using the Decal.It did work and was fast, just realized i would need like a 64k x 64k image to get close to pixel level. No tools could output that res that I had. lol and imagine painting that by hand..hah
That is one huge texture! perhaps breaking it into smaller tiles if possible..
Welcome back.
Thanks RonTek
Well it was back when Rage was announced. I heard the term mega texture and without knowing what it really was decided to do it..LOL
Sam
Yes, megatextures also reminds me of the Rage engine. I think nowadays they do streaming or procedural texture.
Reply To Topic (minimum 10 characters)
Please log in to reply