Page 1 of 1

Self Shadows

Posted: Wed Apr 17, 2019 11:51 pm
by spike0314
Hi all
I haven't used purebasic in while and never used the 3D side of it. So I was wonder how self shadowing is done using a texture map not stencils.

Or is it possible to use stencil shadows with alpha objects like trees?

Thanks.

Re: Self Shadows

Posted: Thu Apr 18, 2019 12:21 am
by Samuel
Hello,

Purebasic's texture shadows don't use any depth information which means self shadowing is not possible. It works by rendering the caster entity shadows onto a texture and then applying them to the receiver entities. It's an older fixed function technique, but it supports a wider range of hardware.
More modern approaches use shaders which allow depth textures for calculating self shadowing, but for now they are not usable in Purebasic.

Stencil shadows rely on the entities' geometry so they won't work properly with alpha.

Re: Self Shadows

Posted: Thu Apr 18, 2019 4:22 am
by spike0314
So a custom shadow shader is out the question aswell?

If that's the case is there any 3d engine libraries that are still supported by there creator worth using?

Thanks.

Re: Self Shadows

Posted: Thu Apr 18, 2019 8:37 am
by Samuel
Yes, currently Purebasic's 3D library doesn't allow us any way to use shadow shaders.

If your goal is modern techniques then you'll probably have some trouble with the 3D libraries around here.

Re: Self Shadows

Posted: Thu Apr 18, 2019 11:05 am
by spike0314
Ok cheers I thought I would give it ago considering I own a copy but I shell move on.