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 / Problems trying to implement cascaded shadow mapping

Author
Message
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 3rd Nov 2013 19:49 Edited at: 3rd Nov 2013 19:50
This is a continuation of this post. However, since the topic has kind of changed I thought it would be better to start a new thread that better reflects the current state of things.

After reading pretty much everything I could find (and that I could understand, mind you, some of those texts are really far out there to the point where I have no idea if it even is about shadow mapping or even graphic applications a few pages in) on the subject I came up with an idea of how one should be able to implement cascaded shadow mapping.
I may of course be wrong, but I've rewritten this code (originally in DarkGDK) several times and looked it through many times more - as far as I can tell this really should work.
I've attached a DBPro project that demonstrates the problems as well as shows what I'm doing.
Since I apparently can't seem to solve this myself I would be very grateful if someone with better math skills / general knowledge of this type of problem would take a look at it and share their ideas about what might be wrong, general improvements (I know some parts could be written in a more efficient way, but that would be less readable so I opted for the latter since I'm trying to dinf issues with this) etc.


In order to compile the attached project you will also need to replace your Compiler\plugins\DBProBasic3DDebug.dll file with the one included in the attached archive. It contains a customly added function set effect constant matrix array that lets you set a float4x4 array constant in a shader. I would have added this function to its own plugin instead, but I couldn't find any way to access shader data from outside that core library. It is just a straight recompile of the source found on the official google code repository with added functions set effect constant matrix array and set effect constant vector array.
Here's the code for those functions if you prefer to add them yourself in case you've already modded your DBProBasic3DDebug.dll file:



Well... good luck!


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

Attachments

Login to view attachments
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Nov 2013 01:22
Finally got it to start to behave somewhat



"Why do programmers get Halloween and Christmas mixed up?"
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2013 00:26
@Rudolpho

hi

I was looking for a solution to the problem I was having with the "DBProBasic3DDebug.dll"

I did the switch that definitely works

I would not want to look at the graphics after I had a few of what ever lol

your close to what you want ;o) :oP

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2013 03:48
@Rudolpho

umm check out

http://forum.thegamecreators.com/?m=forum_view&t=208552

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2013 03:55
one more link

http://www.thegamecreators.com/?m=view_product&id=2023
Dark Lights

to move side ways - is to move forward
Since a Strait line gets thin fast
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Dec 2013 11:07
Wow, yes that RPG sure seems to have it working.
I'll read it through more properly later on but doesn't seem like he's sharing any source for the lighting system though.

About DarkLights, I already have that one, but it is a offline light mapping solution which just generates prebaked light maps; what I want is dynamic, to, just like granarout, implement a day-night cycle with realistic shadow movements as well as dynamic normal and specular mapping.


"Why do programmers get Halloween and Christmas mixed up?"
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2013 15:22
@Rudolpho

also he is using the Dark GDK so that would have to be converted over

I know some time ago I had found the day/night cycle in the forum
some ware

I will try and hunt that down for you

too bad your version of "DBProBasic3DDebug.dll"
dose not fix one example "3d Graphics" ;o(

perhaps you could get the "DBProBasic3DDebug.dll"
fixed so it dose work ? ;o)

download it and check it out perhaps you can get the missing command the example for built

to move side ways - is to move forward
Since a Strait line gets thin fast

Attachments

Login to view attachments
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2013 15:24
I got anther link for you to check out

http://forum.thegamecreators.com/?m=forum_view&t=82473&b=6

to move side ways - is to move forward
Since a Strait line gets thin fast
Rudolpho
19
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Dec 2013 16:41
I'm using DarkGDK too, just posted this here because the DBPro forum has approximately ten times as many active contributors as the GDK one. So my DBPro code presented here and in the other post is actually ported from DarkGDK to begin with

Quote: "perhaps you could get the "DBProBasic3DDebug.dll"
fixed so it dose work ? ;o)"

I think that the set object keyframe function may have been taken out since it doesn't appear in the help or keyword files.

Anyway, there is a "?SetFrameEx@@YAXHM@Z" exported by DBProBasic3DDebug.dll so I changed its stringtable entry to that. Your project then compiles, but it closes instantly. Since my spanish is... well, not very good I didn't bother trying to find the reason for it but maybe you can. The altered dll is attached to this post.


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

Attachments

Login to view attachments
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2013 18:44
@Rudolpho

ya there are more users of DBP than GDK
and for people who do use GDK it's not that hard to convert idea over

it's weird that i do not see that command used in the example

one more link that fits in with the idea

http://forum.thegamecreators.com/?m=forum_view&t=208719&b=6

I've been looking in what I have
I know some ware there was 2 light example that had the shadow effect
well i think it did but it's been a couple of years since I've seen
either example

thanks
but unforchantly when i build the exe
it just flickers like it's going to run and then it ends

so it looks the example i posted is broken

i know i have a bug or two in my system so I will have
to get that worked out before I can make any exe that people can use

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
15
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 15th Dec 2013 12:27
@Rudolpho

by any chance do you have the old "Darkbasic" installed ?

I bi leave there is an example in there that has to do with this problem

I will keep looking to what other example that are out there ;o)

to move side ways - is to move forward
Since a Strait line gets thin fast

Login to post a reply

Server time is: 2025-05-15 06:49:40
Your offset time is: 2025-05-15 06:49:40