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 / set object specular - help please

Author
Message
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2010 18:07
Just occasionally I get stuck on something really simple.

I just can't seem to get the



commands to work.

I've done a search and various people have experienced similar problems in the past (including me ). One or two people give advice on how to get them to work but none of the suggestions seem to work - and no-one seems to have posted simple working code.

It would be very helpful if someone could post a simple demo of a textured DBPro sphere responding to red specular light using the native DBPro commands (and state which upgrade they're using).

Please!
MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 23rd Sep 2010 18:18
theres an example in code snippets that shows activating specular light on a Sphere, but not a textured one, dont know if its of any use to you

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

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2010 19:27
I'm afraid that snippet doesn't convince me - I can't see anything that is obviously the effect of specular lighting when I run it.

When I try something similar with one light and one sphere the specular commands do nothing.

A simpler - and working - example would be more convincing.
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 23rd Sep 2010 19:51 Edited at: 23rd Sep 2010 19:57
Here is a simple example with a white specular colour and a pulsing exponent:


Edit: oops! Didn't read everything... I'm using the DBPro 7.4 and it works as expected (including with textured objects). The problem may be that you are trying to display a red specular coming from a red light, on a white object, which has absolutely no effect (red+red=red, and red+white = white) unless you're using HDR.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2010 20:39
Quote: "The problem may be that you are trying to display a red specular coming from a red light, on a white object, which has absolutely no effect (red+red=red, and red+white = white)"


That isn't quite true, surely. On parts of the model angled somewhat away from the light the diffuse component will be grey so when you add the specular component you should see reddish grey not white.

In fact your demo works exactly that way if you reverse the roles of red and white.

The only important difference between what you've done and what I'd tried earlier is that I was using a directional light.

Could someone show me how to get those specular commands working with a directional light such as the default light? They should of course.
Daniel wright 2311
User Banned
Posted: 23rd Sep 2010 20:48
The problem with thease commands are they just do not work on some modles, I just use shaders on the modles and it never fails. even if its just specular and not bump or normal maps I still will use a shader instead.It also depend on how you are using your lights in your leval. how bright they are and it also depends on what colors you are using with in your textures. every time I use a multicolored texture thease commands do not work, and they hardly work with just one bace color. So trully, shaders are your friend.

my signature keeps being erased by a mod So this is my new signature.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2010 20:54
I agree - but the built-in commands should still work as intended as not everyone wants to have to learn another language and they shouldn't need to for simple things like this.
Math89
22
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 23rd Sep 2010 20:59
I guess it just doesn't work with directional lights. (which is obviously weird)
Daniel wright 2311
User Banned
Posted: 23rd Sep 2010 21:10
well, It is a little funny how with shaders every thing works and with out they dont, even with just the regular bump command, set bump mapping on is horrible in its self but with a shader no problems. I think they worked more on shader support then with the basic commands them selves.. they should do a little more work on it In my opinion. I WOULD, But that is just me,,lol

my signature keeps being erased by a mod So this is my new signature.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Sep 2010 21:23
Quote: "I guess it just doesn't work with directional lights. (which is obviously weird) "


Thanks for confirming that. BUG REPORT/FEATURE REQUEST coming up!!
Mr Bigger
21
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 24th Sep 2010 05:54
We where over this some 4 years ago.

http://forum.thegamecreators.com/?m=forum_view&t=88900&b=15

It's ok i'm getting old too.


AMD 2600+/1GB ram/GeForce 6600oc 256MB/W2KPro/DBPro 6.6.b
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Sep 2010 12:32
Mr Bigger

Thanks for that. I needed a good laugh.

I somehow managed not to see that in my search yesterday.

And my memory seems to be failing too.

Perhaps if these things got fixed we wouldn't need to rely on our memories so much.

Login to post a reply

Server time is: 2026-07-24 23:12:45
Your offset time is: 2026-07-24 23:12:45