WorldShadows problem & fix
Posted: Mon May 05, 2025 4:24 pm
Hi everyone,
I've recently purchased PB and began playing around with the Engine3D library. All great, until I started playing around with getting the Shadows working. I have discovered that the WorldShadows function, crashes the application (Windows 11 btw) straight away. I couldn't figure out what was going on until I added the following line into the code before calling 'Parse3DScripts':
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Main", #PB_3DArchive_FileSystem)
...
...
Parse3DScripts()
...
WorldShadows(#PB_Shadow_Additive) ; Use which ever option you desire here
I was unaware that there is a 'Shadow.material' file in here that appears to be required to make the shadow stuff work. There may be additional files as well. You may want to copy the files located in the Main folder, to your own application's source folder and adjust the path accordingly if you are using your own materials etc.
I hope this helps people who came across this issue.
I've recently purchased PB and began playing around with the Engine3D library. All great, until I started playing around with getting the Shadows working. I have discovered that the WorldShadows function, crashes the application (Windows 11 btw) straight away. I couldn't figure out what was going on until I added the following line into the code before calling 'Parse3DScripts':
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Main", #PB_3DArchive_FileSystem)
...
...
Parse3DScripts()
...
WorldShadows(#PB_Shadow_Additive) ; Use which ever option you desire here
I was unaware that there is a 'Shadow.material' file in here that appears to be required to make the shadow stuff work. There may be additional files as well. You may want to copy the files located in the Main folder, to your own application's source folder and adjust the path accordingly if you are using your own materials etc.
I hope this helps people who came across this issue.