Author Topic: Anisotropic Reflective Shader  (Read 7111 times)

Offline dandelO

  • Member
  • *
  • Posts: 2401
Anisotropic Reflective Shader
« on: December 12, 2010, 04:55:28 PM »
*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;
[ Attachment Invalid Or Does Not Exist ]
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;
[ Attachment Invalid Or Does Not Exist ]

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.
[ Attachment Invalid Or Does Not Exist ]

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;
Quote
Displacements 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!

[ Attachment Invalid Or Does Not Exist ]
« Last Edit: August 15, 2011, 02:23:54 AM by dandelO »

Offline Volker Harun

  • Member
  • *
  • Posts: 1490
  • Let there be Rock!
    • NWDA-Net
Re: Anisotropic Reflective Shader
« Reply #1 on: March 04, 2011, 01:40:20 PM »
This is one of those goodies that should not be missed and got ignored ,-)

Offline dandelO

  • Member
  • *
  • Posts: 2401
Re: Anisotropic Reflective Shader - v.2 - UPDATED 15/8/2011
« Reply #2 on: August 15, 2011, 02:20:10 AM »
*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;
32889-0
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;
32891-1

A preview of the 'transparent(slow)' option.
32893-2

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
« Last Edit: June 25, 2012, 01:09:03 PM by dandelO »

Offline Kadri

  • Member
  • *
  • Posts: 8502
Re: Anisotropic Reflective Shader
« Reply #3 on: August 15, 2011, 03:36:02 AM »

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?
« Last Edit: August 15, 2011, 03:45:23 AM by Kadri »

Offline dandelO

  • Member
  • *
  • Posts: 2401
Re: Anisotropic Reflective Shader
« Reply #4 on: August 15, 2011, 03:51:42 AM »
Sorry, Kadri. I just realised this as well and have replaced the clipfile.
See the edit at the top of my above post. ^^

Martin.

Offline Kadri

  • Member
  • *
  • Posts: 8502
Re: Anisotropic Reflective Shader
« Reply #5 on: August 15, 2011, 04:46:46 AM »

Thanks , Martin  :)

Offline dandelO

  • Member
  • *
  • Posts: 2401
Re: Anisotropic Reflective Shader
« Reply #6 on: August 15, 2011, 08:16:26 PM »
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. :-[

Offline AndyWelder

  • Member
  • *
  • Posts: 516
  • Niet zeuren, gewoon doen!
Re: Anisotropic Reflective Shader
« Reply #7 on: August 20, 2011, 05:23:05 PM »
Thank you, dandelO!
"Ik rotzooi maar wat aan" Karel Appel

Offline dandelO

  • Member
  • *
  • Posts: 2401
Re: Anisotropic Reflective Shader
« Reply #8 on: August 21, 2011, 09:07:22 PM »
You're very welcome, Andy. :)

Offline bobbystahr

  • Member
  • *
  • Posts: 10428
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Anisotropic Reflective Shader
« Reply #9 on: August 30, 2011, 07:25:36 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

Offline choronr

  • Member
  • *
  • Posts: 4582
Re: Anisotropic Reflective Shader
« Reply #10 on: September 20, 2011, 01:26:23 AM »
Thank you Martin. Not sure where I'll use this one ...we'll see.

 

anything