Anisotropic Reflective Shader

Started by dandelO, December 12, 2010, 12:55:28 PM

Previous topic - Next topic

dandelO

*All attachements removed and updated in my 'version 2' post below. Thanks for all the downloads of the original file!
V.2 is far superior in terms of control and ease of usability.*


Here's the shader that I was messing about with in this thread then.

The nodes are pretty simple;
[attachimg=#]
I included a transparency shader, incase it is needed for glass as well, just swap the input to the 'final inputs shader'(at the bottom) as it's needed(good idea, Henry. ;)).

To see the effect better, open up the settings for 'displacement shader' and move the small shader preview window around with the left mouse button;
[attachimg=#]

The functions and the displacement shader make repetitive 1/4mm lines across the surface. You can change the direction of the repeat by using a different one of the 'convert scalar' nodes. Default is set up to 'Z to scalar'. This means that if you look north/south, the lines will run horizontally. If you're looking east/west, use 'X to scalar'. For vertical surfaces, use 'Y to scalar'.

A couple of things to know;

A good detail level in the renderer is required because reflections are extremely optimised in TG2. Render detail '1' will give only '0.25' reflection detail. A render detail of '4' would be required for full quality reflections. Keep in mind that if you do that, render times will sky-rocket AND final GI detail will also be multiplied. If you use detail '4' with GI relative detail of '2', this will, in turn, become a GI relative detail of '8'. Take care!

High AA will help but it won't solve any problems relating to reflection detail. Free version users should use AA=3 with non-adaptive sampling for best effect.

The current scales work best at about eye-level. My tests in the other thread were about 1/4m above the ground, I've edited it since to work best from a 2m pov from the surface it's used on.

It will work best from a glancing angle to that surface. The narrower the angle - the less the affect is visible.
This preview has a camera 'X rotation' of '9' degrees. Lowering the angle will lower the effect/raising it will heighten it.
[attachimg=#]

You can adjust the index of refraction, reflectivity, colour, etc. I've left the reflective shader at nearly default settings, with the exception of 'specular roughness', which is reduced, on Matt's advice.

I don't believe it will work on raytraced objects because no actual displacement is applied to them, only bump. Matt's RTO description states that;
QuoteDisplacements applied to these objects are not seen by the ray tracer, but the displacement information is interpreted as bump to affect shading.
I don't know how that should be interpreted with this reflective shader as it relies on tiny displacements, I haven't tested this yet. Will do later.

That's about it, use it in the same way as you would any other reflective shader, that is, input/output between the desired shader to be made reflective and the desired object surface or, as child layer of a surface layer to have more control over distribution/constraints.

Have fun!

[attachimg=#]

Volker Harun

This is one of those goodies that should not be missed and got ignored ,-)

dandelO

*EDIT; Replaced the clipfile in this post. There were asterisks and copyright symbol in the 'Instructions' note node which were creating problems when opening the file. This is fixed.*

I've updated this shader after my attention was brought back to it recently. It's now much more user-friendly(function nodes stripped down and hidden(as some are no longer required and none now need to be edited), clearer labelling of editable features and a brief 'Instructions' note node added on the new easy-edit controls.
_______________________________

The controls now simply look like this;
[attachimg=#]
All functions are now hidden and need no further editing.
Before, it was essential to use the function nodes to change axes by unplugging/replugging, according to what was required of your scene.

Double click the node 'Instructions' to open up the... instructions, for the new controls. ;)

Instructions text is as follows;
Quote*SCALE - ROTATION*
Use this node to reorder the direction and size of the function. The default direction of the function runs horizontaly, East/West. (Functions inside this node, if required).

*INTENSITY*
Use this node to apply more displacement to the surface you're using it on. Keep values extremely small. i.e. Type in small values manually, the slider *shouldn't* be used.

DEFAULT SCALES AND INTENSITY = '0.00025'
_____________________________________________

The default 'Shader' input is set to 'Reflective'.
Alternatively, you can set this to 'Transparent(Slow)', if required. *2x slower*
_____________________________________________

© - dandelO - 2011.

A preview of the 'reflective' option;
[attachimg=#]

A preview of the 'transparent(slow)' option.
[attachimg=#]

The transparent preview shows the plane surface 1m above the default planet surface.
_____________________________________________

Thanks for the 114 downloads of v.1 of this shader! :)
I've removed that one now and have replaced it with this new version.


dandelOl3bnab

Kadri

#3

DandelO, it gives an error at loading "parse error at line 156:not well-formed(invalid token)" here.
The nodes are not linked and there is no Instructions node.

I use the 64 bit TG2 not sure if there is a difference in this way... Do you use an Alpha build or so?

dandelO

Sorry, Kadri. I just realised this as well and have replaced the clipfile.
See the edit at the top of my above post. ^^

Martin.


dandelO

No prob's, my mistake.
I never realised that odd characters couldn't be used in the text field of the note node. Although, I should have, I've fixed my own .tgd's that I've saved with the same problem when I've renamed nodes before, and I've read about it countless times here too. DOINK!
Typical dandelO mistake!

Anyone else who grabbed the file when I posted it last night before editing, please re-download this new one, if you find that you get the warning message that Kadri posted above. All is well with the one that is there now. :-[

AndyWelder

"Ik rotzooi maar wat aan" Karel Appel

dandelO


bobbystahr

Quote from: dandelO on August 21, 2011, 05:07:22 PM
You're very welcome, Andy. :)
No idea how I missed the thread but thanks Martin...this will be most handy.. ...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

choronr

Thank you Martin. Not sure where I'll use this one ...we'll see.