Scalar shaders

From Eclat-Digital Ocean 2014 Documentation
Jump to: navigation, search


scalarshader-2014.png

A scalar shader returns a scalar real value as a function of shading parameters (UV coordinates, world-space position and normal, etc...). For instance, it may describe thickness of a coating, or the roughness of a surface.


Scalar shader types

Uniform

This scalar shader returns a constant value, which does not depend shading parameters

Children nodes

none

Parameters

value
real
The constant scalar shader value



Texture

This scalar shader gets its value from a texture at shading UV coordinates. For RGB textures, the green component is used.

An optional correction curve is applied to the raw texture value, similar to a brightness/contrast/gamma adjustment:

  • The value is first applied a gamma curve, controlled by the greypt parameter. The grey value (0.5) is mapped to greypt, hence setting greypt to 0.5 disables this correction
  • Then, the value is scaled by the scale parameter
  • And finally, offset is added to the value

In other words:

  • Black(0) is mapped to the offset parameter
  • White(1) is mapped to offset+scale
  • Grey(0.5) is mapped to offset+scale*greypt

Children nodes

image-2014.png image
Image : The image to use as a texture

Parameters

greypt
real
The non-linear grey point adjustment, between 0.25 and 0.9
scale
real
RGB value scaling, or contrast adjustment
offset
real
RGB value offset, or brightness adjustment
uvscale
real
The UV coordinates scaling factor. Scales the texture spatially over the geometry


See also

Node types