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.

Code Snippets / [DBP] Multiple shadows example

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 21st Sep 2008 04:06 Edited at: 21st Sep 2008 04:07
Hi.

I was experimenting with shadows tonight. I was hoping to get into shader programming but I was too tired..

So I decided to see what I could do using dbpro built in commands aww:S


Anyway, here is a screenshot:


and here is the code:


Now, this is probably the least effectively imaginable way ever possible. But I don't know stuff like that. Anyway it's fairly easy to add more shadows but I got bored after adding three.. Also I didn't bother to comment stuff out as that takes too much time.

Anyway try it out and see if you can improve on stuff! if you want.

Attachments

Login to view attachments
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 21st Sep 2008 15:34 Edited at: 21st Sep 2008 15:36
Hi.

Moving along, I made it possible to have colored shadows and lights.
Remember that there is only one light in this scene.

Anyway another screenie:


and the new source:



So, anything to comment on? Have you made something better, which hopefully runs faster? This one runs at about 300fps.
I'd be happy to have a look at some other examples.

edit:
oh ya, if you don't have the matrix1 dll your dbpro probably won't recognize the command "Find Free Image()".
Just replace that command call with a function like this:


Attachments

Login to view attachments
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 21st Sep 2008 16:41 Edited at: 21st Sep 2008 16:42
Rendering this scene at 170fps with 3 "lights". And it doesn't really look that good.
Maybe it would help to add some normal mapping too, but that will drop the fps even more, aww:S.


Attachments

Login to view attachments
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 23rd Sep 2008 18:08
Coolness! Tho remember that the built in stencil shadowing in dbp is rediculously slow.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 23rd Sep 2008 19:31
Yea, I noticed that The above scene without shadows runs at around 1500fps for me. With three shadows I get 170fps. Lol.

I wanted to get into shader programming but I don't know anything at all. The only thing I do know is that DBPro must have HLSL shaders (or something).

Will read the dbpro thread: shader for noobs. Or whatever it was called. So I have a place to start at, only need a point in time to start at now.

General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 25th Sep 2008 01:23
Cool. Tbh ive moved on to ogre3d, but i come back to dbp occasionaly, and sometimes for comps.

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 26th Sep 2008 20:57 Edited at: 26th Sep 2008 21:00
lukas i do recomend you to buy the book shaders for game programmers and artists by sebastian st-laurent.
thomson course technology is the publisher.
awesome for newbies to shaders
and i will only point out that shadow shaders are extremely complicated for multiple shadows.
if you want good ones
i suggest you bugg green gandalf or darkcoder to do one for you
they have done som good shaders for dbp
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 26th Sep 2008 23:39
Quote: "shadow shaders are extremely complicated for multiple shadows.
if you want good ones
i suggest you bugg green gandalf or darkcoder to do one for you"

Eh.. if I ever learn how to write shaders and stuff I will keep it a secret to prevent this kind of thing happening to me.
Btw, didn't know darkcoder was into thta kind of thing.

Anyway thanks for the book-tip. But at the moment I am really concentrating on my (newly aquired) job and stuff so I won't be dbpro'ing much other than small snippets like this one for fun.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 27th Sep 2008 00:00
here is one link to some nice shaders by dark coder that he did a while ago
http://forum.thegamecreators.com/?m=forum_view&t=121575&b=1
jeffhuys
18
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 8th Oct 2008 00:41
Already 17 lights, 60 fps.
Hell of a job!



You're the 'th to view this signature!

Login to post a reply

Server time is: 2024-11-22 07:36:58
Your offset time is: 2024-11-22 07:36:58