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.
WorldShadows problem & fix
Re: WorldShadows problem & fix
On the other hand you could read the very first sentence of the help of Parse3DScripts:
...so I guess people are already aware of this.
https://www.purebasic.com/documentation ... ripts.htmlParses all the .materials OGRE scripts found in the paths set with Add3DArchive().
...so I guess people are already aware of this.

Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: WorldShadows problem & fix
I'm just trying to help! No need for the sarcasm. This information would never have been known if I wasn't using Scripts.
Re: WorldShadows problem & fix
I don't think it was offending, please don't take it seriously. Anyway, welcome to the forums, and feel free if you have any questions, or got something to show/tell. (the feature you pointed out is not so obvious, others also ran into it (including me))
Last edited by miso on Tue May 06, 2025 12:31 pm, edited 1 time in total.
Re: WorldShadows problem & fix
I agree it's not obvious, I will add a note in the doc.
- pf shadoko
- Enthusiast
- Posts: 386
- Joined: Thu Jul 09, 2015 9:07 am
Re: WorldShadows problem & fix
shadow management is, in my opinion, the biggest weakness of 3d PureBasic (along with physics)
especially since PB 6.20
I advise you to leave this aside for the moment.
PB 6.30 should correct this problem
in the meantime, I've included in PB 6.21 the ability to manage "modern" shadows
it's a bit of a DIY job, but it's much better
especially since PB 6.20
I advise you to leave this aside for the moment.
PB 6.30 should correct this problem
in the meantime, I've included in PB 6.21 the ability to manage "modern" shadows
it's a bit of a DIY job, but it's much better
Re: WorldShadows problem & fix
Sounds good. I think the community can manage this until 6.30 

Re: WorldShadows problem & fix
I appreciate the heads up and I'll check for an update. I'm currently on 6.20 still.pf shadoko wrote: Tue May 06, 2025 5:40 pm shadow management is, in my opinion, the biggest weakness of 3d PureBasic (along with physics)
especially since PB 6.20
I advise you to leave this aside for the moment.
PB 6.30 should correct this problem
in the meantime, I've included in PB 6.21 the ability to manage "modern" shadows
it's a bit of a DIY job, but it's much better
Re: WorldShadows problem & fix
Sorry a question about shadows. When use texture shadows, If I have understood correctly, need add a layer to the material for the shadow?. I read this in ogre forum.
If translation=Error: reply="Sorry, Im Spanish": Endif
Re: WorldShadows problem & fix
At the moment PB handles that internally as far as I can tell. It should have a lot of secret shennanigans like depth camera and depthmap texture etc, but it's hidden.
The 3d example Light.pb uses texture shadows.
The 3d example Light.pb uses texture shadows.