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 help in shader

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Aug 2012 20:17
Hi everyone!

How can I make this shader use a specular map instead of just applying the same level of specular over the entire texture?

This is the same shader I posted a while ago when I requested to have emissive maps, now I also need to add specular maps to it. Any help?

There's just no information anywhere on how to get it working, so if someone could also explain why and how to do specular lighting calculations I'd most appreciate it!

The shader:



TheComet

Your mod has been erased by a signature, please reduce him [overall] to no larger than 120 kg please.
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th Aug 2012 19:07
If you have Evolved's AdvancedLighting, you might take a look at Shaders/Mesh/Normalmap.fx

it isn't terribly well documented, but it allows you to use the alpha channel in the normal map file as a specular map.

Photoshop is fiddly about that alpha layer though. If you are using .dds you should be fine, but I never could figure out exactly what settings to use. I got .png working so if you go with .png I'd suggest you replace the default .png exporter with the one from SuperPNG

Login to post a reply

Server time is: 2026-07-21 20:34:15
Your offset time is: 2026-07-21 20:34:15