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 / Specular, Normal and Diffuse

Author
Message
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 31st Dec 2009 19:51
I have a diffuse,specular and normal texture. How do I apply them to a sphere in dbpro?

If it hasn't exploded yet, I haven't touched it.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 31st Dec 2009 20:23
set blend mapping on OBJECT, 0, NORMALIMAGE, 3, 24
set blend mapping on OBJECT, 1, SPECULARIMAGE, 3, 26
set blend mapping on OBJECT, 2, DIFFUSEIMAGE, 3, 4

If it comes out a little dark, change the 4 to a 5 on the last line.

These commands and their results will vary depending on the textures as well. So you might have to try a 17 for specular instead of 26.

OR

You can use a shader.

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 31st Dec 2009 21:54 Edited at: 31st Dec 2009 22:22
So is a shader is required to produce this effect or could I use blend mapping?
(I rendered this in Blender)


If it hasn't exploded yet, I haven't touched it.
david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 31st Dec 2009 23:24
Blend mapping will get you the bump and specular effect. But your gonna need a shader to get the shadow.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Jan 2010 20:06
DBPro has some shadowing effects. It's still shader based, but it's internal. You have to use it sparingly though because it can lower the framerate pretty quick.

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 2nd Jan 2010 04:52
Yeah I tried adding the shadowing but it didn't give the result I was hoping for. Is there any way to create the effect seen in the above image just using the stuff that comes with Dbpro?

If it hasn't exploded yet, I haven't touched it.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Jan 2010 20:23
Not really. It's the built-in shadows, or use a shader.

There are some other techniques, but none that really compare to what a shader can do for you.

You can search these forums for "shadow" or "shadow shader" for more details.

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 22nd Mar 2010 22:36
Thanks for that KISTech. I had wondered the same thing myself. I wish there was a manual for this one command (Blend Mapping) thats explained so it makes sense to me

My vehicle looks a lot better now, thanks.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 22nd Mar 2010 23:04
Sure thing.

A lot of how something looks with these commands will depend on your textures. I've had to tweak the brightness and contrast on a lot of textures to get things to show up just right. Once you have that part figured out though, it's not so bad.

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 22nd Mar 2010 23:16
Yeah I did the same thing. Rarely does one image work for all layers.

Login to post a reply

Server time is: 2026-07-26 21:12:10
Your offset time is: 2026-07-26 21:12:10