PDA

View Full Version : Try at simple (skin) shader plugin


Lynx3d
05-16-2003, 09:47 AM
Just felt the urge to write a shader that helps on getting rid of the "copper zombie" like Steven Stahlberg likes to call it
(check this tut of Stahlberg (http://www.optidigit.com/stevens/shadetut.html) to see what my plugin aims for)

here's a quick comparison:

http://www.aspect-design.de/lynx/LW/sss_compare.jpg
(left without and right with shader, rendered with one area light and radiosity)

It simply multiplies the surface color with another color (in this case i used a red) based on the lighting, the darker the more it gets multiplied. I know the image is far from perfect, too saturated and yellowish, have to redo the textures first...

One bad thing: The plugin is slow on complex lighting, although it does a very simple math, but in order to get the illumination without destroying LWs ability to use shading noise reduction it was necessary to basically do the lighting calculations twice (i'm afraid there's no other way currently :( ), the right one took 1.63 times the original rendertime (so 63% longer), but as said it uses area lights and radiosity.

yes, I dare to give it a try (x86-version) (http://www.aspect-design.de/lynx/LW/simple_skin.p)

deemon
05-17-2003, 11:38 AM
Hi,

Could you please consider making an option (or a separate plug-in version) without caring about Shading Noise Reduction for faster rendering?

Thanks!

Lynx3d
05-17-2003, 02:01 PM
Hm that's an idea...updated the link with the new version.

Replacing LWs shading only takes a few percent longer than without shader, BUT, apart from not having shading noise reduction, the illuminate() function called within a shader gives you different results on area lights than LWs renderengine itself.
You can see that on many shaders btw, even those that ship with LW like BRDF :(
The bigger the area lights get the more obvious the wrong behaviour, caused by the fact that you only get a single light vector (an average?) instead of all samples LW computes.

And a warning: I implemented an option to evaluate caustics too, however Lightwave crashes when calculating the caustics, even before starting rendering. Very confusing, but if i first render the scene without the shader once and then with shader it works. (Same behaviour on 6.5b and 7.5...don't know if it's a LW bug, no one answered on the mailing list yet)

Think i will release the source code under the GNU General Public Licence licence...

-edit-
totally forgot to mention those strange "Glare" options...still in work, i try to prevent that the a skin color gets ugly yellowish when lit by a strong light source, the color has no function yet.

deemon
05-17-2003, 03:15 PM
Many thanks Lynx3d! A simple yet very useful shader, not only for skin. Though it did crash LW a couple of times here when I was playing with settings with Viper open.

Lynx3d
05-17-2003, 06:09 PM
hm, haven't thought of VIPER yet actually...
Just played a bit in VIPER, couldn't provoke a crash yet (6.5b that was, still haven't updated...*dumdiedum*...), any hint in what combination that happened?

But i don't think you have to do anything special for VIPER...i hope :)
Used the basic structure from the "specular.c" SDK example from Ernie Wright...

deemon
05-18-2003, 06:21 AM
I was quicky turning Replace Lightwave Shading on/off watching the difference in Viper and at some point LW crashed. Though I'm on LW 7.5c and there's a chance it's nothing to do with your shader and is LW's own glitch, I haven't worked with 7.5c enough to say for sure.