Thanks Matt for sharing this technique.
I guess anything that goes into the diffuse input should go in the
incandescence color input as well, to really achieve the effect we're
looking for.
Cheers
Bernard
On Dec 1, 2007 7:40 AM, Matt Lind <speye_21(at)hotmail.com> wrote:
> After thinking a bit, I remembered to look in the "duh" file.
>
> You can compute the ambient effect using existing nodes in the rendertree.
> The setup is as follows:
>
> 1) Activate incandescence on your material shader with desired color. The
> associated intensity parameter will drive the effect.
>
> 2) Get a vector share shader. Apply an expression to the input parameter so
> it's driven by the global position of an object in the scene - doesn't have
> to be a light.
>
> 3) Get a vector_state shader. Set the operation to "intersection point".
> This is the coordinate of the point on the surface currently being rendered.
>
> 4) Get a vector-scalar node from the Math shaders. Connect the two vector
> shaders to the inputs of the vector-scalar shader. Set operation to
> "distance between v2 and v1".
>
> 5) Connect output of vector-scalar shader to input of a change_range shader.
> Set the old start and end parameters to your min/max range for the ambient
> effect. So, if old range start / end are 3 and 10 respectively, then any
> shading point within 3 units of the designated ambient light object will
> receive 100% incandescence. Any shading point more than 10 units away will
> not receive any incandescence at all. Anything inbetween will receive
> incandescence at reduced intensity with linear falloff. Set the new range
> start to 1 and new range end to 0 because we want to inverse the falloff and
> keep the result within a legal range.
>
> 6) Connect the output of the change_range to the incandescence intensity
> parameter on your material shader.
>
> 7) Preview the effect in the render region. voila!
>
> Since the computations are mostly to determine intensity, you can apply this
> as an override to all objects in the scene while each can have it's own
> incandescence color. They'll just share the same intensity.
>
>
> Matt
>
> --------------------------
> Matt Lind
> Animator / Technical Director
> Softimage certified instructor:
> Softimage|3D
> Softimage|XSI
> Matt.Lind(at)Mantom.net
>
>
> Date : Sat, 1 Dec 2007 10:43:30 +0100
> To : XSI(at)Softimage.COM
> From : pingo van der brinkloev <pingo(at)pingofilm.dk>
> Subject : Re: ambient lightsource
>
> Bernard you nailed it. It's very useful!
>
>
> Matt, I think you're right that it has to be done to the shader. That would
> probably also be quite clever, since then maybe one could do it with all
> kinds of stuff (nulls, meshes, curves?).
> also sounds right to me about the incandescence.
> U have some good suggestions about writing a shader, if only I could do that
> life would be a bit easier for me.
>
>
> So a scalar node for the shadertree that measures light intensity or even
> distance from a point.
> MAN could i use that!!!!!!!
> (this is normally the time when someone quietly notifies me that it's
> present in the blablabla folder and it's called the MI distance shader
> TADAAA)
>
>
> I am trying to wrap my brain about this, but to be honest I think it's
> straight up nuts that the feature isn't just there.
> I'm SO tired of using days to figure out how to do simple stuff in XSI.
> Simple stuff that is a click of a button in other apps.
> And now I have to be a shader writer and learn c+ and python etc, etc. It's
> all fun, but also VERY time consuming.
>
>
>
>
> c ya
>
>
> pingo
>
>
> but how to write one???
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi