Help with a Shader

elizawokelizawok Posts: 0
edited October 2012 in Carrara Discussion

A quick (or not so quick) question: Is there any way to access the level of illumination using a shader? I realize that Shadow Glow (in the DCG's Shaders Plus collection) turns the Glow channel on or off depending on the lighting, but it only works on the glow channel of its subshader. Is there a more general way to produce a grey scale indicating how much light is falling on a given point? For example, to use in a mixer or color gradient?

Hopefully there will be an easy/obvious answer... *crosses fingers*

Wok

Post edited by elizawok on

Comments

  • Mark DesMaraisMark DesMarais Posts: 0
    edited December 1969

    My Lit shader does something like this.

    http://www.des-web.net/html/lit.html

    There are a couple of samples here- http://www.des-web.net/html/samples.html

    There are some limits as to what it can do, but maybe it will do the job for you.

    Markd

  • elizawokelizawok Posts: 0
    edited December 1969

    Thanks Mark! I looked at the Lit shader when I was doing my own research for this question, but it didn't seem to be quite what I wanted. It's a lot closer than anything else I've seen however. (I've been looking for an excuse to pick up your Shoestring Shader pack; perhaps the image I have in mind will be the final impetus to do so!) I do have a few questions for you about both the Lit shader and the Shoestring Shader pack:

    1.) How hard would it be to let the shader return a grayscale value, indicating the degree of illumination?
    2.) How does the shader respond to negative lighting? Does it simply throw away the sign?
    3.) As far as I can tell the shaders are currently in alpha for Carrara 8. Do you have an idea of when they might be into beta or (preferably) finished?

    Thank you very much for your help with this!

    Wok

  • Mark DesMaraisMark DesMarais Posts: 0
    edited December 1969

    Hi Wok-

    1 Have to check, but I think it does this already.
    2 Have to try this too- not sure that negative lights existed when I wrote it.
    3 They are finished, I've just been too lazy to promote them. There is one slightly newer build that includes a more detailed install message for when people don't have privs on, but that's it.

    BTW, you can try them out before buying, and see if it does what you want.. . .

    Markd

  • Mark DesMaraisMark DesMarais Posts: 0
    edited December 1969

    1) Ok, it does this, but not in response to the BRIGHTNESS, just the range and cone falloffs. Looks like I started to add the brightness into the eqn, but never did... not sure why.
    2) Does not currently react. How would you expect it to react?

  • elizawokelizawok Posts: 0
    edited December 1969

    Sorry for my tardiness in replying; I finally got to go on vacation on the condition that computers stayed home. Thanks for checking into this for me; I think I should just install the trial, and see how it works for the image I have in mind. The only issue I was anticipating would possibly come from soft shadows; I was hoping for a soft transition from the lit effect to the dark effect. (I may be able to fake that using glow, however.)

    As for negative lights, honestly I had no idea how they should react. (I may have had some thought about how it might be a suitable workaround, but I have no idea what I was thinking now... vacation time has wiped my brain!) I haven't quite figured out how to best use negative lighting yet, anyway. Anyway, let me try out the Lit shader as currently written, and if it's not quite what I had in mind I'll (hopefully) have a clearer idea of what I want!

    Thanks again,

    Wok

  • TheKDTheKD Posts: 2,666
    edited December 1969

    You could try faking it, putting glow in the glow channel, then a lightbulb inside what is supposed to be glowing, and putting it to the intensity and color you need. You will have to add the glowing figure to the exclude list in the light bulb. That's all I could come up with for now.

  • elizawokelizawok Posts: 0
    edited December 1969

    Ok, now I remember why I wasn't sure if Lit would work for what I had in mind. Lit works very well with respect to the light itself, but it does not take into account any shadows except those cast by the object itself. That may have been where I'd been going mentally with the negative lights -- If I could set up some combination of lighting and negative lighting that would give the shadows I wanted, then using Lit to produce the shading effect...

    Hmm, I'm thinking now that my best bet may be to render it in multiple passes, and just go with post work...

    Thanks for helping me think through all of that! ;-)

    Wok

  • Mark DesMaraisMark DesMarais Posts: 0
    edited December 1969

    Yeah, it isn't a ray tracer! ;-)

    Good luck

    markd

Sign In or Register to comment.