shader

A shader describes how an object will be painted. Currently, the only shader I know about is the "generic" shader, which applies a basic color to an object.

To create a more complex texture, you can attach a texture by using a modulator. This is done by adding one or more modulators following the attributes section of the shader.


shader.generic

Create a generic shader.

   <shader type="generic" name = "name">
	<attributes>
        	<color r="255" g="255" b="255" />
		<specular r="1" g="1" b="1" />
		<reflected  r="1" g="1" b="1" />
		<hard value="20" />
		<transmitted r="1" g="1" b="1" />
		<IOR value="10" />
		<min_refle value="0.2" />
	</attributes>
       
       ... the optional modulator block ...
       
       <modulator texname="texture name" mode="mode" size="scale" >
           <color value="color" />
       </modulator>
   </shader> 

color: 0.0-1.0 OR 0-255 to express rgb works
The base color of the shader.
specular: rgb
The specular component color of the shader.
reflection: rgb
The reflective component color of the shader.
hard: 0-??
The hardness of the specular highlight. Lower values result in fuzzy hilites, higher values sharpen the result.
transmitted: rgb
Effects how much light passes through the surface.
IOR: 0.0 to 50.0 ???
Index of refraction, the amount that light refracts (bends) when it moves through the object. This works with the transmited parameter, which determines how transparent the object is, and color.
min_refle
"defines the minimum amount of reflection" - eeshlo. The net effect this has is that lower values have very little impact. As you increase the value, the brightness of objects reflected increases.


shader.modulator

Modulators are used to attach texture to shaders. They should only appear in shaders following the texture block. They are not required for a scene to render.

   <modulator  texname = "texture name"
       mode = "mode"
       size = "size">
       <color r="red" g="green" b="blue" />
       <specular = "amount of shine" />        
       <transmited = "amount of transparency" />
       <hard = "size of specular hotspot" />
   </modulator> 

texname: texture name
The name of the texture being applied.
mode: mix|mul|div|add|sub
This tells how the texture will be modulated. Supported modes seem to be "mix", "mul", "div", "add", "sub". This option is required.
size: default: 1
Amount to scale the image. A value of "1" means the image will be tiled once. This option can be omitted. sizex, sizey, and sizez are also accepted for fine tuning the image.
specular: n
Causes the texture for this modulator to be treated as a specular map. This allows the use of a texture to control specularity over an object. Higher values increase the overall effect of this texture on the object.
transmission: n
Used to influence the alpha transparency.
hard: n
Size of the "hotspot" for specular effects. Higher values decrease the size, making the hotspot sharper or more "intense".


shader.clouds

Generate a "cloudy" texture. In order to get a successful render, you have to set up a "shader chain". I am unclear on why this is. Supposedly you can control the two colors used to create the clouds, but none of the examples I found of this actually worked in yafray 006.

	<shader type="clouds" name="A_cloud" size="2.000" depth="4">
		<attributes>
		</attributes>
	</shader>

	<shader type="float2color" name="B_cloud" input="A_cloud">
		<attributes>
		</attributes>
	</shader>

	<shader type="phong" name="clouds">
		<attributes>
			<color value="B_cloud"/>
		</attributes>
	</shader>

depth: 1 to 15
Set the depth of the cloud calculation. Lower values result in very fuzzy indistinct blobs, higher values give much more detail.
size: number
Sets the tiling of the produced clouds. Lower numbers result in indistinct blobs, higher values make very dense "busy" textures.