Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How in the world to I get Evolved shadow shaders to work?

Author
Message
kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 2nd Aug 2013 13:14
I've been going at getting the cubic shadow shader to work with my project but I cannot for the life of me get it to work...

Here is the source to the shadow example. Could someone tell me what bits and pieces I need to take from this to get the effect working in my game?



AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
kordman916
18
Years of Service
User Offline
Joined: 5th Oct 2007
Location:
Posted: 4th Aug 2013 06:28
These forums have become a lot less active haven't they?

AMD FX 6300 hex-core processor 3.5 GHZ
16 GB DDR3 ram, Geforce 660 Ti 2GB ram
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 4th Aug 2013 13:47
The things you need would be the shader and the things pertaining to that. That is the cubemap, as well as the additional render camera and the technique swapping in the appropriate order (first set the depth mapping technique, then render the cube map, then set the shadow mapping technique and finally render the scene with that (which will use the previously rendered cubemap).
You also need the sync masking to ensure that you only draw specific cameras; to mask one specific camera you can write 2^cameraID. This is not necessary when using the sync camera or render dynamic cube map functions however.

Finally you must ensure that the shader ("effect") is applied to all the objects you want shadow mapped. This means that you would not apply it to the light sources (such as that flare plane in there, which isn't necessary for the effect to work, but makes it look nicer to actually see something at the "center" of the light source). You also wouldn't apply it to post-processing render quads etc. if you have those, but pretty much everything else.
For the shader to function it is also required that each object that it is applied to has a diffuse (normal colour) map at texture stage 0 and a normal map at stage 1.

I think that should be about it from looking at your snippet anyway.
An easy way to figure these things out is to just remove / add things to the example code and see if your changes will break it


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2026-07-07 00:49:18
Your offset time is: 2026-07-07 00:49:18