WorldShadows problem & fix

Share your advanced PureBasic knowledge/code with the community.
APEXnow
New User
New User
Posts: 3
Joined: Mon May 05, 2025 4:14 pm

WorldShadows problem & fix

Post by APEXnow »

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.
User avatar
jacdelad
Addict
Addict
Posts: 2006
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: WorldShadows problem & fix

Post by jacdelad »

On the other hand you could read the very first sentence of the help of Parse3DScripts:
Parses all the .materials OGRE scripts found in the paths set with Add3DArchive().
https://www.purebasic.com/documentation ... ripts.html
...so I guess people are already aware of this. :wink:
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
APEXnow
New User
New User
Posts: 3
Joined: Mon May 05, 2025 4:14 pm

Re: WorldShadows problem & fix

Post by APEXnow »

I'm just trying to help! No need for the sarcasm. This information would never have been known if I wasn't using Scripts.
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: WorldShadows problem & fix

Post by miso »

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.
Fred
Administrator
Administrator
Posts: 18199
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: WorldShadows problem & fix

Post by Fred »

I agree it's not obvious, I will add a note in the doc.
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 386
Joined: Thu Jul 09, 2015 9:07 am

Re: WorldShadows problem & fix

Post by pf shadoko »

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
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: WorldShadows problem & fix

Post by miso »

Sounds good. I think the community can manage this until 6.30 ;)
APEXnow
New User
New User
Posts: 3
Joined: Mon May 05, 2025 4:14 pm

Re: WorldShadows problem & fix

Post by APEXnow »

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
I appreciate the heads up and I'll check for an update. I'm currently on 6.20 still.
User avatar
minimy
Enthusiast
Enthusiast
Posts: 613
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: WorldShadows problem & fix

Post by minimy »

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
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: WorldShadows problem & fix

Post by miso »

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.
Post Reply