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 / Any code for directional light mapping?

Author
Message
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Jun 2014 02:28
First I'd like to declare far and wide that I'm no good with shaders.
Now that that's out of the way, I've found some stuff discussing directional light mapping shaders, but no shader's and no code that I could use.
Evolved has a demo for directional shadow mapping in his advanced lighting project, but it gives me a black screen and no amount of tinkering on my end has helped.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Jun 2014 03:25
Let us start with your system specs... CPU, GPU, RAM, OS

Should be enough to go by for now...



wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Jun 2014 03:31 Edited at: 13th Jun 2014 03:33
I don't think it has to do with my system as I can run everything else he's put out, but;
Intel core 2 duo @2.20GHz
4 GB RAM
Windows 7
GeForce GT 230M w 1GB VRAM

I can see the FPS but nothing else.

Edit - just in case, pixel shader version 4.1
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 13th Jun 2014 03:42 Edited at: 13th Jun 2014 03:51
http://www.geforce.co.uk/hardware/notebook-gpus/geforce-gt-230m/features

Make sure that shader is not using model 5, as your maximum is 4...

EDIT

Also, let everyone know which project you are having an issue with, if you can link it or upload it here, there are a few shaders he has... I think...

wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Jun 2014 04:14
I'm trying to run the Directional light example in his latest advanced lighting download here: http://www.evolved-software.com/advancedlighting/advancedlighting

But I'd be just as happy with any shadow shader that works and can simulate sunlight.
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 13th Jun 2014 15:02 Edited at: 13th Jun 2014 15:02
Regarding black screen - change resolution at start of code to 1024*768, I have same issue and this works for me, someone posted same problem and this "fix" on his site(think it was someone on evolveds gdk or shader board). Also worth remembering evolveds new forums have issues so he makes older projects available for adv lighting which he details in a post under Anouncements along with a link to the older forum
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 13th Jun 2014 17:03
Just a side note; if you are interesting in learning you can run through TheComets shader tutorial. It will not hurt to learn something new, shader programming is not as difficult as it at first appears.

After you get some basic knowledge; get familiar with the shader function library

wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 14th Jun 2014 01:02
James - doesn't work, unfortunately. The only thing that seemed to make a difference was taking out the sync command at the beginning, but then it only flashed for a second and went black again.
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 14th Jun 2014 02:03
Actually its not the display mode but the variables for it, if you alter display mode values directly in command then you will still get black screen, I did not explain very well, my apologies - if you change to these lines instead;

This should work, also bare in mind changing resolution to what you want seperate to sw and sh variables you will get either a black screen or unwanted artifacts in the scene
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 14th Jun 2014 02:23 Edited at: 14th Jun 2014 02:49
Ah man I somehow missed that sw and sh were used in other portions of the code. Thanks, it works now!
I just have to figure how to rip it out to be used without the rest of the advanced lighting stuff..
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 14th Jun 2014 05:59
Speaking of Evolved's new Adv Lighting, I put together a keywords file (highlighting and parameter prompts) which makes the whole thing a heck of a lot easier to use. Stick it in editor/keywords just like with any other plugin. (attached)

wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 14th Jun 2014 07:04
Thanks Ortu, that should help quite a bit!
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 14th Jun 2014 13:41
I missed it at first as well, I didn`t even realize his forums were new. I hadn`t visited in a while and couldn`t figure out why I could sign in but not post, so I read through the anouncements post and found out that way, then i read all of both both forums(thank god they are small!) and came across the "fix" that way. Glad you got it working
Nice one Ortu, don`t know why I`ve never thought of doing that, so simple and very useful, cheers

Login to post a reply

Server time is: 2026-07-05 16:05:43
Your offset time is: 2026-07-05 16:05:43