PDA

View Full Version : Quick Incidence with Image question



raw-m
08-27-2010, 09:57 AM
Hi all, got a quick one.

I've go a simple Gradient used as an Incidence with the Colour piped directly into the Reflection input. An invert of the same output is fed into the Diffuse. So far, lovely!

I have an image that I want to add variation to the Reflection/Diffuse but I'm struggling to find where to put it in the chain.

I've tried the Gradient and Image Colour channels into a Mixer but it doesn't look right. Perhaps I'm not using the correct Blending mode. Can someone help?

Sensei
08-31-2010, 07:18 AM
I am not quite sure what you're expecting to get.

Can you send scene?

Diffuse and Reflection are scalar, means accept floating values between 0.0...1.0 (in regular usage, in special tricks, any value is okay). Putting color there, will be equal to extracting color red channel.

So, how your image is looking like? Is it colorful, or gray? Or white-black?
The last one b-w, has just pixels 0,0,0 and 1,1,1, so you can just multiply vectors (color output from image and output from gradient, as long as it's gray too) using Math > Vector > Multiply node.

raw-m
08-31-2010, 07:58 AM
Thanks for answering Sensei, useful info about the color channels!

I've attached what I think I'm after! Basically, the Fresnel part of it is all good but I want to break it up a little using this greyscaled image so there's an inconsistency to the reflection at extreme angles. It could be that I don't need it here at all and it needs to go into the Specular or Bump channel....

I'm still very much at the "discovery" phase in the node world but starting to find my feet and enjoy it more - but there is always those little frustrating niggles....

Sensei
08-31-2010, 08:11 AM
Reflection scalar input is controlling how much of Reflection Shading color is added to final color. So it's basically C++ equation: final_color += reflection_shading_color * reflection;
And that's it.

If you put f.e. Const > Color node to Reflection Shading, set some yellow or whatever extreme color, and adjust Reflection scalar above 0.0, you will see that yellow is starting to appear. At 1.0, it'll be at maximum set in Const > Color node.

However if you put one of Shaders > Reflection nodes, you will get real reflection but processed by node (instead of regular ray-tracing), and you can modify it. f.e. use tint color. If used together with Gradient Incidence you can have different tint color depending on incidence angle.

If you want to have different reflection angles depending on incidence angle, you should use gradient incidence scalar as power of one of procedural textures, but instead of using color, use Bump vector and plug it in Surface Bump. This way directly visible from camera surface will reflect perfectly, but at nearly 90 degree, will be really screwed.

raw-m
09-01-2010, 05:08 AM
Thanks for info. Not entirely sure I'm following your first paragraph, do you mean "final_color = reflection_shading_color * reflection"? I get confused that colour contains 3 values (r,g,b) and how it all adds up to give a final result.

I haven't looked much at the Shaders end of nodes yet so will research further.

Sensei
09-01-2010, 05:25 AM
Thanks for info. Not entirely sure I'm following your first paragraph, do you mean "final_color = reflection_shading_color * reflection"? I get confused that colour contains 3 values (r,g,b) and how it all adds up to give a final result.


It was equivalent to:

final_color_red += reflection_shading_color_red * reflection;
final_color_green += reflection_shading_color_green * reflection;
final_color_blue += reflection_shading_color_blue * reflection;

raw-m
09-03-2010, 01:26 AM
Hi Sensi, Sorry for the staggered response.

Do you have a real-world example of this in action? Might help me visualise it a bit clearer. I've been playing around with the shaders and the results I'm getting are so much better!