SourceForge.net Logo

CGRU

CGTALK.RU Logo

p_MegaTK



p_MegaTK - universal material shader. The shader was writen for production purposes and have many build-in shading models (such as phong, blinn, ward, wet, fur, reflection, refraction, occlusion and more...)
Shader can split out passes for one render without considerable time overhead (please view tutorial about rendering passes with p_MegaTK). But p_MegaTK is not for passes only, you may use it as your common shader.
cSurface
Main surface(diffuse) color
cOpacity
Opacity texture
Opacity Conversion
Conversion for 'Opacity' texture

'R' (0) - R component from 'Opacity' texture used
'G' (1) - G component from 'Opacity' texture used
'B' (2) - B component from 'Opacity' texture used
'A' (3) - A component from 'Opacity' texture used
'Average' (4) - Average value of RGB from 'Opacity' texture used ((R + G + B)/3)
'Luminosity' (5) - Luminosity value of RGB from 'Opacity' texture used (R*0.299f + G*0.587f + B*0.114f)

Use Constant
Enable Constant model for diffuse. It's just a flat shader. Lighting has no effect to constant shader at all.
Constant shading it's like self-illumination.
Coefficient Constant
Coefficient of 'Constant' model, for example if you want to mix several models together.
Constant Color
Constant Color

Use Simple Diffuse
Enable simple diffuse lambert model
Coefficient Simple Diffuse
Coefficient of 'Simple Diffuse' model, for example if you want to mix several models together.

simpe_diffuse
Coefficient Diffuse = 0.5Coefficient Diffuse = 1.0
Light Category (sd_light_category)
Light Category are used for restriction of influence of light sources on the certain models of illumination.
For example you have a light source that should effect only to blinn specular, but not to diffuse and not to velvet specular. You just enter to 'Light Category' some word like "blinn_spec" and same word to 'Light Category' of you light shader. As result you get this light will be influences only to blinn specular.

Use Fur Diffuse
Enable Fur Diffuse model. Together with Fur Specular it give you Fake Fur shading. This part of shader based on gg_fakefur shader by Gonzalo Garramuno with some modifications. Implementation of Dan Goldman's Fake Fur rendering, a probabilistic lighting model for thin coats of fur over skin. See http://www.cs.washington.edu/homes/dgoldman/fakefur/

fur_diffuse
Fur DiffuseFur Diffuse + Fur Specular
Coefficient Fur Diffuse
Coefficient of 'Fur Diffuse' model, for example if you want to mix several models together.
Angle
Angle for rotating of U and V axises of anisotropic affect
Skin Color
Hair Density
Backward Scattering
Forward Scattering
Hair Over Hair Shadow
Shadow Attenuation
Start Shadow Cos
End Shadow Cos
Hair Length
Hair Base Radius
Light Category (fd_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Phong
Enable Phong Specular
phong specular
Phong Specular
Coefficient Phong
Coefficient of 'Phong Specular' model, for example if you want to mix several specular models together.
Specular
Phong specular color
Exponent
Controls the width of the specular highlight. Smaller values increase the size
Light Category (p_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Blinn
Enable Blinn Specular. Classic Blinn specular model based on Pixar Renderman Blinn shader.
blinn specular
Blinn Specular
Coefficient Blinn
Coefficient of 'Blinn Specular' model, for example if you want to mix several specular models together.
Specular
Blinn specular color
Eccentricity
Controls the spread of the specular highlight
Specular Roll Off
Controls the intensity profile of the specular highlight
Light Category (b_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Velvet
Enable Velvet Specular. This part of shader based on gg_velvet shader by Gonzalo Garramuno. Originally written by Stephen H. Westin, Ford Motor Company this version written by Miguel Garcao (mgarcao@netcabo.pt)
velvet specular
Velvet Specular
Coefficient Velvet
Coefficient of 'Velvet Specular' model, for example if you want to mix several specular models together.
Sheen Color
Sheen Color (like specular color). Color of retroreflective lobe and horizon scattering
Backscatter
Scattering near the horizon, regardless of incident direction
Edginess
Roughtness
Shininess of fabric (controls retro-reflection only)
Light Category (v_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Wet
Enable Wet Specular. Wet specular model for creating wet specular or emulate sharp reflection.
blinn specular
Wet Specular
Coefficient Wet
Coefficient of 'Wet Specular' model, for example if you want to mix several specular models together.
Specular
Wet specular color
Roughness
Controls the spread of the specular highlight
Sharpness
Sharpness of specular
Light Category (we_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Ward
Enable Ward(Anisotropic) Specular.
ward specular
Ward Specular
Coefficient Ward
Coefficient of 'Ward Specular' model, for example if you want to mix several specular models together.
Glossy
Ward specular color.
Shiny U
Controls the width of the specular highlight for U direction. Smaller values increase the size. Parameter works like Phong Exponent
Shiny V
Controls the width of the specular highlight for V direction. Smaller values increase the size. Parameter works like Phong Exponent
Use Surface Deriv
Use surface derivative. If enabled used U and V from NURBS surface direction. If polygon object used you should generate UV derivatives from maping with shader like "Deriver" by by Daniel "thebigMuh" Rind, elsewise anisotropic will not work. In any case NURBS object more better for anisotropic effect.
Maybe I'll support automatic generation of UV derivateves on polygon objects in future versions...
UV
If you don't use 'Surface Deriv' you should specify direction for anisotropic specular manually with mib_texture_rotate and mib_texture_vector shaders.
Connect U and V of mib_texture_rotate texture shader to U and V value of p_MegaTK, then connect mib_texture_vector to 'Input' parameter of mib_texture_rotate.
This options works on NURBS and Polygon object too.
Light Category (w_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Fur Specular
Enable Fur Specular model. It's second part of fake fur shading model (see Fur Diffuse).
fur specularfur specular1
Fur Specular + Diffuse Specular

Coefficient Fur Specular
Angle
Angle for rotating of U and V axises of anisotropic affect
Specular1 Color
Specular1 Exponent
Specular2 Color
Specular2 Exponent
Tangent Breakup Amt
Light Category (f_light_category)
See previous description of 'Light Category'(sd_light_category)

Use Indirect Illumination
Enable recieve Indirect Illumination (GI, Caustics and Final Gathering)
Irradiance Color
Color of Indirect Illumination, for example if you want tint or decrease Indirect Illumination effect. This value will be multiplied to Indirect Illumination.
Indirect Saturation
Saturation of Indirect Illumination effect. This simple mean of overcome Color Bleeding.
Path Indirect Diffuse
This option enable computing Path Indirect Diffuse like in path_material shader instead of Final Gather, Global Illumination and Caustics. Path Indirect Diffuse works like Final Gather, but without interpolation(blur). It give more accurate result, but need more samples and time. Good case using this option if you have only one or some objects in scene that need Indirect Illumination.
path indirect diffuse path indirect diffuse1
path indirect diffuse2 path indirect diffuse3
Path Indirect Diffuse

Path Indir. Diffuse Samples
Number of samples for Path Indirect Diffuse. Set more value for this parameter if you need more accurate and smoothed result.
Path Indir. Diffuse Depth
Max Depth(indirect reflections or bounces) for Path Indirect Diffuse. In most case it should be 1-3.
Ignore Bump
If enabled p_MegaTK ignore bump(onlly bump connected directly to 'Input Normal', not any external) during computing Final Gather. This option speedup render and remove final gather flicking on animation.

Warning! mental ray 3.5 and newer versions in 'auto' final gather mode always ignore bump. 'Ignore Bump' option will take effect only in '3.4' or 'strict3.4' mode(radius controled) or mental ray 3.4

Use Ambient
Enable Ambient effect.
Coefficient Ambient
Coefficient Ambient value
Ambient Color
Ambient Color value

Use Occlusion
Enable Occlusion effect. This part of shader based on shader based on "Dirtmap" shader by Daniel "thebigMuh" Rind with some modifications.
occlusion occlusion1
Pure Occlusion

Base Color
Base(Bright) Color used if no occluding objects found
Dirt Color
Dirt(Dark) Color used if occluding objects found. Dirt Color gets overlaid on the Base Color
Ray Spead
Angle Spread of occlusion rays. The spread parameter sets the half-angle of the opening above the point that gets sampled. A value of 90 produces a hemisphere, while 0 results in completely sharp normal-reflections, and 180 samples a complete sphere (with about 50% of the samples normally hitting the mesh directly below the sample point).
Samples
Sets the number of samples that get cast for each point. If you set this to 0, you effectively disable computing occlusion, always be used Custom Occlusion value.
Near Clip
Sets the minimum range of a ray. For each ray that gets cast, if the distance to the first hit is below the Near Falloff distance, full dirt color gets applied.
Far Clip
Sets the maximum range of a ray. Every ray that doesn't hit an obstacle in less than the distance defined by Far Falloff causes full base color to be applied.
Falloff Gain
This controls the falloff that gets applied if a ray hits an object in a distance between the near and far falloff. At 1, a linear falloff gets applied, while at 0.5 it is square (effectively reducing dirt density), and at 2 it is square-root (effectively increasing dirt density). Note that this gets applied per ray, and therefore might not yield the amount of change you want. To dramatically increase the dirt strength, either lower the dirt color to a value with negative luminance, or use a color correct node with negative gamma to modify the result value.
Gamma
Gamma correction for occlusion. For example if you render your image with gamma 2.2 and want that your occlusion looks like with gamma 1.0 set occlusion Gamma to 1/2.2 = 0.45
Basis Vector
This lets you specify an arbitrary vector that gets used to send samples in. This serves as the base for the cone that samples get shot in. The angle of the opening of that cone can be modified via the spread parameter.
Basis Blend
This controls the amount of mixing that occurs between the standard vector that gets used (the interpolated surface normal), and the basis vector. At 0, the surface normal is used, and at 1, only the basis vector gets used.
Opacity Mode
This option controls how to use opacity during computing occlusion effect.

'Opaque' (0) - full opaque, any object transparency or shaders ignored
'Material Shader' (1) - material shader called for computing opacity by alpha component of returned result
'Shadow Shader' (2) - shadow shader called for computing opacity (if material have shadow shader connected). This mode may be a little bit faster than 'Material Shader'. Current limitation of this mode is that only first trasparent object taked into account (this limitation may be removed in next version of shaders_p)

occlusion without opacity occlusion with opacity
Occlusion without opacity('Opaque' mode) and with opacity

Trace Environment
Toggles if the base/dirt colors are output directly, or if they get multiplied with the environment color first. To get any visible results, you should first apply some kind of color or texture to the environment. Relatively open areas of the mesh, that aren't occluded, return the unmodified environment color, and "dirty" areas return black, therefore pulling ambience in those areas towards zero.
Invisible For Secondary Illumination
If On the shader will not do any sampling when hit by any secondary illumination rays, no matter if GI or Caustic photons, or Final Gather rays. Use this to greatly speed up Final Gathering in scenes where you are using occlusion. The visual difference is normally not noticable, the speed difference can be huge.
Invisible For Reflect
If On the shader will not do any sampling when hit by reflection rays. It mean that occlusion will not be visible in reflection. Use this to speed up reflection, for example if you don't see any difference in reflections.
Invisible For Refract
If On the shader will not do any sampling when hit by refraction rays. It mean that occlusion will not be visible in refraction. Use this to speed up refraction, for example if you don't see any difference in refractions.
Compute Bent Normals
A bent normal is a vector that points in the average unoccluded direction above a point. If you have a completely unoccluded surface, this will be equal to the surface normal (if you use enough samples), or the basis vector if it is in use. Bent Normals pass used for Compositing effects.
Bent Space
Vector Space that bent Normals be returned.

'World / Internal'(0)
'Object'(1)
'Camera'(2)
Effect to Diffuse
Amount of effect Occluison to Diffuse component (sometimes called Dirt). If 0 - no effect, if 1 - full effect and Occlusion multiplied to Diffuse.
Effect to Specular
Amount of effect Occluison to Specilar component If 0 - no effect, if 1 - full effect and Occlusion multiplied to Specular.
Effect to Indirect Illumination
Amount of effect Occluison to Indirect Illumination component If 0 - no effect, if 1 - full effect and Occlusion multiplied to Indirect Illumination. For example if you want sharp or detail your indirect illumination.
Effect to Ambient
Amount of effect Occluison to Ambient component (called Ambient Occlusion). If 0 - no effect, if 1 - full effect and Occlusion multiplied to Ambient.
Custom Occlusion
If "Internal" occlusion not suit you, you may use any occlusion shader you want, for example mib_amb_occlusion, just connect it to this slot. But don't forget to set 'Samples' to 0 in p_MegaTK internal occlusion(for disable it) to avoid computing occlusion effect twice.

Use Reflection
Enable computing reflection.
Coefficient Reflection
Coefficient of Reflection.
Reflection
Reflection Color.
Shiny
Shiny Reflection or reflection bluring. If 'Shiny' = 0 no bluring, ideal specular reflection. If 'Shiny' > 0 produce blured reflection, less value of 'Shiny' produce more strong bluring.
Anisotropic Reflection
Enable Anisotropic Reflection effect. Anisotropic Reflection works only on nurbs objects.
Shiny U
Shiny value for U direction.
Shiny V
Shiny value for V direction.
Samples
Samples for blured reflection. More value produce more smooth result. Less value produce more noise result, but more fast. If no bluring reflection used always compute only one sample.
Fresnel
Amount of Fresnel mask. Fresnel shape computed on basis of 'IOR in' and 'IOR out' value.
fresnel effect
Coefficient Reflection = 1 Fresnel = 1Coefficient Reflection = 1 Fresnel = 0.5Coefficient Reflection = 1 Fresnel = 0

Reflection Falloff Start
Distance where reflection begin falloff(attenuate) to environment color. Falloff is linear. If 'Falloff Start' and 'Falloff Stop' equal to 0 no reflection falloff used.
Reflection Falloff Stop
Distance where reflection stop falloff(attenuate) to environment color. After this distance no reflection computed.
Reduce this value for optimize rendering of large scenes with reflection.
Falloff to Color
Falloff to 'Reflection Falloff Color' instead of environment color.
Reflection Falloff Color
Color for reflection falloff if 'Falloff to Color' enabled.
Diffuse Minus Reflection
Amount of Reflection value will be subtracted from Diffuse. If 'Diffuse Minus Reflection' = 0 no subtract computed. If 'Diffuse Minus Reflection' = 1 whole reflection will be substracted from Diffuse.

Use Refraction
Enable computing refraction.
Coefficient Refraction
Coefficient of Refraction.
Refraction
Refraction Color.
Shiny
Shiny Refraction or refraction bluring. If 'Shiny' = 0 no bluring, ideal specular refraction. If 'Shiny' > 0 produce blured refraction, less value of 'Shiny' produce more strong bluring.
Anisotropic Refraction
Enable Anisotropic Refraction effect. Anisotropic Refraction works only on nurbs objects.
Shiny U
Shiny value for U direction.
Shiny V
Shiny value for V direction.
Samples
Samples for blured refraction. More value produce more smooth result. Less value produce more noise result, but more fast. If no bluring refraction used always compute only one sample.
IOR in
'IOR in' - Index of Refraction of the dielectric material for entering object.
Absorption In
'Absorption In' is the "persistence" coefficient which corresponds to the fraction of light which is left after traversing one unit of material. Thus 0.9 means that 10% of the light is absorbed per unit length of the material. Lengths are measured in world coordinates. This color used if ray enter to surface.
IOR out
'IOR out' - Index of Refraction of the dielectric material for outside object. For example ray may hit water surface with IOR 1.333(IOR in) from air with IOR 1.0(IOR out).
Absorption Out
'Absorption In' is the "persistence" coefficient which corresponds to the fraction of light which is left after traversing one unit of material. Thus 0.9 means that 10% of the light is absorbed per unit length of the material. Lengths are measured in world coordinates. This color used if ray out of surface.
Fresnel
Amount of Fresnel mask. Fresnel shape computed on basis of 'IOR in' and 'IOR out' value.
Refraction Falloff Start
Distance where refraction begin falloff(attenuate) to environment color. Falloff is linear. If 'Falloff Start' and 'Falloff Stop' equal to 0 no refraction falloff used.
Refraction Falloff Stop
Distance where refraction stop falloff(attenuate) to environment color. After this distance no refraction computed.
Reduce this value for optimize rendering of large scenes with refraction.
Falloff to Color
Falloff to 'Refraction Falloff Color' instead of environment color.
Refraction Falloff Color
Color for refraction falloff if 'Falloff to Color' enabled.
Diffuse Minus Refraction
Amount of Refraction value will be subtracted from Diffuse. If 'Diffuse Minus Refraction' = 0 no subtract computed. If 'Diffuse Minus Refraction' = 1 whole refraction will be substracted from Diffuse.

Russian Roulette Optimization
Use Russian Roulette Optimization for Reflect/Refract. If enabled and current trace depth > 3 computed only reflection or only refraction ray depending on fresnel mask.
Samples Decrease Factor
'Samples Decrease Factor' divide Reflection and Refraction Samples to 2 for every one value. For example if you have 16 samples for reflection and 'Samples Decrease Factor' = 1 in first reflection or refraction samples will be divided to 2 and result reflection samples will be 8. If 'Samples Decrease Factor' = 2 in first reflection or refraction samples will be 4. And if 'Samples Decrease Factor' = 3 samples will be 2. Set 'Samples Decrease Factor' to more value for fast rendering.
Reflection Depth
If more than 0 that this value override 'Reflection Depth' in render options for current shader.
Refraction Depth
If more than 0 that this value override 'Refraction Depth' in render options for current shader.

Use Incandescence
Use Incandescence produce effect like self illumination. Incandescence color will be added to shader.
Coefficient Incandescence
Coefficient of Incandescence color.
Incandescence
Incandescence color.

Use Input Normal
Use Input Normal from node like maya's bump2d(bump3d) or 3dsmax's Bump for generating bump effect.
Add to Original Normal
Add Input Normal to original normal(max default value on). If this option disabled normal will be replaced with Input Normal(maya default value off).
Input Normal
Connect to Input Normal your bump node.

Use SpecialC1
Enable SpecialC1 channel. SpecialC channels not visibale in common(beuaty) pass. You may use SpecilaC channels for any other passes you want, for example for rendering additional masks. You may also connect any shaders you want(shader should return color) to SpecialC channels for spliting it to separate pass. SpecialC pass have no alpha channel only rgb.

Use Z
Enable computing Z pass. p_MegaTK can compute it own Z pass with trasparency, reflection and refraction.
Near Clip Plane
Z value near than 'Near Clip Plane' will be cliped. You should compute and set this value for your scene, depending on your scene size and camera position.
Far Clip Plane
Z value far than 'Far Clip Plane' will be cliped. You should compute and set this value for your scene, depending on your scene size and camera position.
Opacity Z
Enable computing Z with opacity.
Reflection Z
Enable computing Z with reflection.
Refraction Z
Enable computing Z with Refraction.
Use Float Point Z
If this option disabled z will be normalized to 0-1 range. If enabled z will be float point value.
Invert Z
Inverting Z.

Mode
Mode and Light Array is common mental ray mechanism for lightlinking. Mode controls the meaning of the light list: all, inclusive, or exclusive.





SourceForge.net Project

CGRU

Раздел на форуме CGTALK.RU