分享

Texture Input | YafaRay

 Iris_joker 2014-03-14

 









Table of Contents:





Texture Mapping


One of the main points of the old YafRay was the close support of Blender texturing features, and YafaRay keeps this tradition. YafaRay relies on Blender panels to setup texturing parameters. In general, YafaRay supports:



  • Many of the settings in the Blender Texture buttons section (F6)

  • Most of the settings in the 'Texture', 'Map input' and 'Map to' panels in the Blender Material buttons section (F5).

  • Some of the Blender procedural texture types and their respective settings.

  • Multiple texture channels for a material.


For a detailed explanation read on in the next sections.


Image Texture Input


Texture input is done by selecting Image as a Texture Type in the 'Texture' panel and loading the image in the 'Image' panel. You can use more than one texture channel in the 'Texture' panel, each of them doing different jobs. YafaRay supported formats are tga, jpeg, png, exr and hdr. This is an overview of the supported settings in the Texture buttons section (F6), in green color:




  • Rot90: rotates the Image 90 degrees counterclockwise.

  • UseAlpha: Renders the texture alpha channel as transparent (if it exists), white otherwise.

  • CalcAlpha: transform RGB values into amount of transparency, for mapping transparency or translucency in the shinydiffuse material.

  • Extend: the colour of the edge is extended outside the image.

  • Clip: an alpha value of 0.0 is returned outside the image. This allows you to 'paste' a small logo on a large object.

  • Clipcube: outside a cube-shaped area around the image, an alpha value of 0.0 is returned.

  • Repeat: The image is repeated horizontally and vertically as often as set in Xrepeat and Yrepeat

  • Checker: a checkerboard is made. Mortar governs the distance between the checkers.

  • Xrepeat, Yrepeat: sets a repetition multiplier in the corresponding direction.

  • Mix X, Y - Max X, Y: Use these to crop, or choose a portion of the texture.









Note: YafaRay can not load Blender encapsulated textures. If your Blender file has got encapsulated data, you must unpack first (File>External Data>Unpack). YafaRay will load textures from the created 'textures' folder.


During the rendering process, the Blender back console shows up messages when a texture image can't be loaded by YafaRay. Pay attention to them!


If your file is unpacked but YafaRay can't load textures, be sure that the path selected in the 'Image' panel points to the actual location of the file in your HD.



Object Mapping


In the Blender Material buttons section (F5), YafaRay supports only settings in the 'Texture', 'Map input' and 'Map to' panels. Settings in the other panels are irrelevant to YafaRay. In general, YafaRay supports:



  • Multiple texture channels

  • Some of the available coordinates for mapping.

  • Flat, Cube, Tube and Sphere projection.

  • Coodinates offset, scaling and transformation.

  • Texture Modulation modes, depending on material type.

  • Inverse Modulation of modes supported.

  • Complementary modulation settings.

  • Stencil.

  • Blending modes.


Supported settings in each Blender panel are (in green color):
















Texture channels: YafaRay supports multiple texture channels for a material. Blender principles are observed here: each channel can have its own individual mapping settings and the lower channel in the stack has got visibility priority over the upper one. For instance, a decal should be in a lower channel than a texture affecting the whole mesh. Also a Blending mode in a channel affects to channels above in the stack. More info about texture channels here.





  • Global: the texture uses the scene's Global 3D coordinates for mapping.

  • Object: Uses a child Object's texture space as source of coordinates. The Object name must be specified in the text button on the right. Often used with Empty objects.

  • UV: UV coordinates are used for texturing.

  • Orco: the texture uses the object's local space.

  • Win: the texture uses the window coordinates.

  • Flat, Cube, Tube, Sphere: projection modes depending on the overall shape of the object. Use Flat for UV mapping.

  • ofsX, Y, Z: moves the texture.

  • sizeX, Y, Z: scales the texture.

  • X, Y, Z axis: Re-orders the X, Y and Z coordinates.

  • More info about map input here.



The image above is an example of Orco mapping and object coordinates. Notice how the texture adapts to the objects position and size. Besides, each object is using a suitable projection mode, so each surface is perpendicularly mapped.





  • Modulation modes (Col, Nor, Csp, etc.): the texture modulates the material property selected. Modes supported depend on the YafaRay material used (see it in the materials modulation section). Negative toggle-mode is supported. More than one modulation mode can be selected; in this case different material properties will be modulated with the same texture channel. Displacement mapping is only supported through a mesh modifier (more info here).

  • Blending modes: How this channel interacts with other channels above it. Supported modes are mix, add, multiply, substract, screen, difference, darken, lighten. More info here.

  • Stencil: the texture is used as a mask for all following textures. More info here.

  • Neg: produces a negative of the texture.

  • No RBG: Converts a texture into a gradation, the two extremes of the gradation scale being Material main color and color set in Color Swatch.

  • Color Swatch: A sort of a secondary color, to be mixed with Material diffuse color in procedural textures and in the No RBG feature.

  • Dvar: default value for intensity-type textures (mirror, reflection, etc..)

  • Impact sliders (Col, Nor, Var, Disp): the extent to which the texture affects the respective modulation mode.



Stencil


Stencil is a texturing feature that allows for mixing two texture channels in a controlled way, by using an intermediate mask texture. This feature can be used as well to set invisible parts of a texture, by using a stencil channel below. White value in the mask texture renders the above texture channel invisible.












The images above show an example of a stencil setup. On the left there are the textures used and on the right the texture channels arrangement.


The image above shows the 'Map to' panel of the stencil texture channel. Notice that the Col, Stenci and No RGB buttons are enabled.



The final result.








Related articles: Material Modulation.

Blending modes











Blending modes are used to determine how two texture channels are blended into each other. The default blend mode is Mix, which is used to hide the upper channel with whatever is present in the lower channel (remember that in Blender, textures have a higher visibility priority the lower they are in the channels stack). However, as each pixel in a texture has a numerical representation, a large number of mathematical ways to blend two channels is possible.


This feature can be used to add complexity and richness to your texturing works. Supported modes are mix, add, multiply, substract, screen, difference, darken and lighten.




















































We are going to blend two textures from , on the left is the base texture, on the right the blend texture. Please look at them carefully.
Bese texture.Blend texture.

Add


A very basic blending mode. It simply adds pixel values of one channel with the other (a+b). In case of values above 1, white is displayed. This mode is commutative (base and blend channels can be swapped)


Notice how the black values in the blend texture don't affect the base texture, since a+0=a



Subtract


This blend mode simply subtracts pixel values of the base channel with the blend channel (a-b). In case of negative values, black is displayed.


Notice how black values in the blend texture don't affect the base texture since a-0=a, while white values produce a black result.



Multiply


Multiply is a basic blending mode for darkening areas of a texture.

Pixels from both channels are simply multiplied by each other. This returns a darker result than both input parameters, except if one of them equals to 1 (white). Completely white values do not change the base texture at all (and vice versa) - completely black values give a black result.


This mode is commutative (base and blend channels can be swapped)



Screen


Screen is a basic blend mode for lightening areas of a texture.


It is the opposite of 'multiply' mode. It returns a brighter result than both input parameters in most cases, except if one of them equals 0 (black). Completely black values in the blend channel do not change the base at all (and vice versa) - completely white gives a white result.


This mode is commutative, channels can be swapped.



Difference


Subtracts either the blend texture from the base texture or the base texture from the blend texture, depending on which is brighter, to get always a positive result. Blending with black produces no change as a-0=a. Blending with white inverts the picture (1-a).


This kind of blending produces a lot of variation. This mode is commutative as well.



Divide


This mode simply divides pixel values of the base texture with the blend texture (a/b). The darker the blend texture is, the lighter the result. However, remember that it is not a linear function, so the result easily reaches the upper limit with regular factors, since a/0=∞.



Darken


Pixels from both channels are compared to each other, the darkest one is taken.



Lighten


Pixels from both channels are compared to each other, the lightest one is taken.


Related articles: Material Modulation.

Procedural Textures










A procedural texture is a computer generated image produced by an algorithm, intended to create a realistic representation of natural elements such as wood, marble, granite, metal, stone, and others.


Procedurals can be used as a color texture or as an intensity texture in any of the mapping options available. Colors in a procedural texture are defined by two controls: Color Swatch in the Blender 'Map to' panel (F5) and material diffuse color in the YafaRay settings interface.


Procedural textures supported in the texture panel are: cloud, marble, wood, voronoi, musgrave and distorted noise. Besides, there is an additional "RGB-cube" procedural type only available by XML editing.





Noise Basis


Noise Basis, which is a setting available for most procedural types, governs the structural appearance of the procedural texture. YafaRay supports all the Noise Basis types available in Blender, which are:



These are the settings supported in each procedural type:



















































Clouds


Useful for soft bump mapping of irregular surfaces.




  • Soft  / Hard noise: Noise strength.

  • Noise Size: sets scaling for noise.

  • NoiseDepth: Depth of calculation, the higher the more detail for noise.

  • Noise Basis: basis used for turbulence, all modes supported



Marble


Useful for marble. ;)




  • Sharpness (soft, sharp, sharper): Noise definition.

  • Soft  / Hard noise: Noise strength.

  • Shape (sin, saw, tri): band type.

  • Noise Size: sets scaling for noise.

  • Noise Depth: Depth of calculation, the higher the more detail for noise.

  • Turbulence: amount of turbulence for bands.

  • Noise Basis: basis used for turbulence, all modes supported.



Wood


Useful for basic bands and noise with a structure.


 

 



  • Bands / BandNoise: the procedural is arranged in bands.

  • Rings / RingNoise: the procedural is arranged in rings.

  • Shape (sin, saw, tri): band type.

  • Soft / Hard Noise: Noise strength.

  • Noise Size: sets scaling for noise.

  • Turbulence: amount of turbulence for bands or rings.

  • Noise Basis: basis used for turbulence, all modes supported.



Musgrave


Very flexible. Useful for  terrain and rock surfaces. The Intensity Scale control is useful to localise the result.




  • Musgrave type: all modes supported except for Hetero Terrain.

  • H: contrast between consecutive layers, for detail.

  • Lacunarity: gap between layers.

  • Octaves: layers of noise used.

  • Intensity Scale: overall intensity of texture.

  • Noise Size: sets scaling for noise.

  • Noise Basis: basis used for turbulence, all modes supported.



Voronoi


Voronoi is a procedural type with a cellular look. Very flexible. Useful for organic surfaces.




  • Cell type (int, col1, col2, col3): color of the cells.

  • Distance Metric: shape of the cells, all types supported.

  • Intensity Scale: overall intensity of texture.

  • Size: cell size.

  • Weight (W1, W2, W3, W4): defines distances between each cell.



Distorted Noise


Complex and versatile.




  • Distance Amount: amount of distortion.

  • Noise Size: sets scaling for noise.

  • Distortion Noise: basis used for distortion, all modes supported.

  • Noise Basis: noise to distort, all modes supported.



Related articles:




You can find some examples of different procedural combinations here.


 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多