MR Shaders in XSI

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  11 November 2009
MR Shaders in XSI

Hi there,

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

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 <<

Quote: 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?
| Spectacular | Uplift Challenge | Twitter Home |

Thanks to ImageShack for Free Image Hosting

Last edited by Spin99 : 11 November 2009 at 12:01 PM.
  11 November 2009
I havent played with MR shaders but i would imagine that Ambiant light simply multiplies with material ambiant color, as diffuse color multiplies with diffuse lighting.
  11 November 2009
Yes that worked like a charm thank you very much

So I got my home compiled Simple Cook-Torrance shader now.
I think the next step will be passing the radiance parameter to it.
Maybe that's another day.

Here's a screenie
| Spectacular | Uplift Challenge | Twitter Home |

Thanks to ImageShack for Free Image Hosting

Last edited by Spin99 : 11 November 2009 at 12:12 PM.
  11 November 2009
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:22 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.