I'm teaching myself XSI for all it's worth and have dabbled with C++ programming in the past.
That's how I decided to try compile an MR shader from the source.
I got the code for the Cook-Torrance shader from writingshaders.com
And so I managed to port the example to VC++, compile the spdl and it works.
Problem is the material is a lot lighter than the included Simple Cook-Torrance shader.
So I figured it's an XSI specific problem that Ambient color has to be calculated
using the scene Ambience color before returning.
So far I managed to get the Ambience color to work from both the shader spdl color box
and alternatively from the Ambience color box. So I have access to both colours from the dll.
What I wanted to ask is?
What calculation do you make with the two values before returning the Ambient colour from the shader?
That's all I wanted to ask.
Nanomation seems to have a nice XSI shader writing tutorial and run into the very same problem
>> LINK (http://www.nanomation.co.uk/Programming-102.html) <<
You should see that the shader behaves pretty much like the built-in XSI phong shader. You may notice that the wrapmaterial is quite a bit lighter than the XSI shader if you use exactly the same values. This is because XSI scales all its ambient values by a global multiplier (set in Render>Modify>Ambience). We would have to add some extra code to take advantage of this, but it's beyond the scope of this tutorial.
Just wondering if someone would be so kind as to shed some further light on
how to compile shaders for XSI and deal with the Ambient/Ambience calculation properly?