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 / Evolved's relief mapping multiple lights?

Author
Message
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 2nd Sep 2012 04:41
I'm kind of playing around with Evolved's relief mapping shader. I always assumed it supported multiple lights, but if it does I can't figure out how to do it, would I need to modify the shader file itself to do this (not that I could, mind you)?

http://mattsmith.carbonmade.com/
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 2nd Sep 2012 05:13 Edited at: 2nd Sep 2012 05:41
Nevermind, I figured it out. I found the same shader in the multipass lighting demo's that has it built in.

EDIT
Crap I didn't get it after all.
Heres the shader I'm working with, any help would be appreciated.
Off to bed now before I tear out my hair.


http://mattsmith.carbonmade.com/
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 3rd Sep 2012 00:17
Hello, wattywatts

The internet I've been using at home won't allow me to log on to any of my accounts. Therefore, I had to venture to the local McDonalds to upload this for you.

The shader in your snippet is only using one light. This shader can use multiple lights by averaging the position, color and distances of the lights used and passing this information to the shader (very nasty thought). Luckily, Evolved has provided the MultiPass Lighting version of this shader. The MutiPass Lighting Relief Mapping Shader support up to six lights and a spotlight (flashlight) depending on what technique you use.

Attached is a well-commented small demo using the MultiPass Shader that hopefully should make everything clear.

Hope it helps.

WickedX
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 3rd Sep 2012 01:15
Thanks a lot for posting and trekking to McDonalds to do so!
Unfortunately I'm getting an error with the code, both the exe and the db files tell me the vector doesn't exist at line 86. I'll see if I can figure it out though. Thanks!

http://mattsmith.carbonmade.com/
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 3rd Sep 2012 02:21
For this post I'm using my wife's iPhone (what a pain). For the demo I used DBPro version 1.074. Just tested the code in all version from 1.074 up. The only version that gives me that error is 1.077RC7. RC7 is the only version of 1.077 I've tried. Just another reason I don't use it (don't know what's gonna work.

WickedX
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 3rd Sep 2012 03:41
Yeah I upgraded to RC7 because the old versions weren't working on a friends computer.

http://mattsmith.carbonmade.com/
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 4th Sep 2012 17:01
The error is being triggered because you have changed the display mode after creating the vectors. Simply move the vector creation commands to a place which is after the set display mode command and the problem goes away.
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 5th Sep 2012 02:08
Ah you're right! Thanks both of you.

http://mattsmith.carbonmade.com/
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Sep 2012 14:59
Quote: "The error is being triggered because you have changed the display mode after creating the vectors. Simply move the vector creation commands to a place which is after the set display mode command and the problem goes away."


It seems that an upgrade at some point introduced that feature with vectors. Several of my old demos won't work till I make that change. No doubt there was a good reason for the change. A bit baffling.
david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 6th Sep 2012 21:45
Yes it seems "baffling" because I can see know real reason why the vectors would be removed by the dispaly change. perhaps they are using a display status to control when the system gets initalized. Makes sense in a way. Otherwise I can't think of a single reason why it would be done that way. Considering the only resources that have to be reloaded on a display change are ones that are associated with video memory.
Dar13
18
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 8th Sep 2012 23:58
Their reasoning might've been that it would be a good idea to free all the DX memory, but that would only make sense if the D3DXVECTOR is dependent on the D3D device(which it isn't, IIRC as it's just a struct).

Login to post a reply

Server time is: 2026-07-08 06:45:16
Your offset time is: 2026-07-08 06:45:16