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.

Dark GDK / DarkLights

Author
Message
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 27th Jul 2009 20:36 Edited at: 27th Jul 2009 20:38
Hi! I have a few questions about DarkLights. Are the shadows that DarkLights make real-time or are they made from a lightmapping tool (If they are real-time, do they then bring down the fps a lot). Also does DarkLights increase the amount of real-time lights that are possible?

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 27th Jul 2009 23:55
Darklight is a lightmapper.... it allows you to map the lights, the time it takes depends on the complexity of the scene you arel ightmapping.

Generally, its not fast enough to be used in real time.

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 28th Jul 2009 00:09
Oh that's all it is? Ugh, anyone know of any libraries or something for fast real time shadows?

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 28th Jul 2009 00:43
If you want shadows I think that shaders would be your easiest option, beside DarkGDK's inbuilt stencil shadows(which arent as bad as everybody says if they are used properly, not perfect, but not that bad)

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 28th Jul 2009 00:50
Ok thanks! And when you say stencil shadows are you talking about dbSetShadowShadingOn ()? Because that's terrible on my computer. No matter how simple an object it still lags.

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 28th Jul 2009 01:10
Yep thats the command, they reason the its laggy on your pc may be because you as asking it to use the shader, by calling :

dbSetShadowShadingOn(int ID, int iMesh, int iRange, int iUseShader);

(if that command is missing frmo your header, just add the forward decleration as above and it will work)

If you want it to use the shader thoughm you NEED to make sure that "stencilshadow.fx" is in your projects root folder. You can find that .fx file and the other GDK built in ones in the DarkGDK directory somewhere(I copied them from the samples on my PC but they may be in other places aswell, they dont have their own folder though)

If you call that command to set shadow shading on and you dont have the shader file, or you tell it not to use the shader, it will attempt to use "software shadows" which are slower and generally lower quality than hardware driven ones.

To speed it up, try adding a render target and using a syncmask system to only sync the camera that is rendering, Ill put together a demo of using the stencil shadows and post it back here for you if you like I have a couple of little tests laying around here from playing with those shadows.

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 28th Jul 2009 01:15
Thanks for all the information! I'll be trying to get it working now but a demo would be fantastic!

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 28th Jul 2009 01:42
No worries

Here is some code that requires no media(other than the stencilshadow.fx file to be present in the project folder)

It shows 3 real-time stencil shadows, cast using ONE light and render targets, with the light being re-positioned between syncs.

Let me state that this code isnt mine. I originally pulled it in DarkBasic Pro form from the snippets database(or somewhere in these forums)

It uses a sprite as its render target, which as you will see isnt the best way of doing it( a textured 3D object would be better ), but this way is simple and it works to demonstrate the technique.



and here is a compiled and running EXE so you can see what it does(I threw the stencilshadow.fx file in the archive aswell incase you cant find it)

If it ain't broke.... DONT FIX IT !!!

Attachments

Login to view attachments
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 28th Jul 2009 01:57
Thanks! Now I'm gonna study the code a bit and try to get it to work in my game

Use Google first... it's not rocket surgery!

Login to post a reply

Server time is: 2024-10-01 08:45:36
Your offset time is: 2024-10-01 08:45:36