db&w documentation wiki

finest software | finest docs

User Tools

Site Tools


tools:random_image_mapper

Random Image Mapper

This node is based on the 3DS Max Random Bitmap OSL shader.
Developed by Zap Andersson, Copyright 2018 Autodesk Inc, All rights reserved. Licensed under Apache 2.0 license.

The node places one image within a 0..1 range of UV values, similar to UDIM tiles.

This node requires a projection node to be connected to the projection input.

Controls

Background Colour / Blend Mode / Opacity

The three controls define how the texture is composited. They are identical to the controls found in the native texturing nodes.

Image List

This control displays a list of all images used by the node. The top most images has the lowest index (0).

The images should have embedded alpha if required, ideally their RGB should be pre-multiplied by alpha.

Selecting an image will display it in the preview control.

All other interactions are via two pop-up menus. One is launched by double clicking on an image entry, the other by right clicking anywhere on the control:

LMB double-click menu

This allows you to change the select image to another loaded image, load a new image and select it or change it to (none) - which will treat the list entry as being black with no alpha when rendering.

RMB Menu

This menu can be launch by right clicking anywhere on the list control. Some of the options will only be available if an image is selected in the list.

Move Up

If an image is selected - and isn't the first image in the list already - it will move up by one entry in the list.

Move Down

If an image is selected - and isn't the last image in the list already - it will move down by one entry in the list.

Add Image...

This will add a new image to the list. If an image is selected, the new image will be added below the selected image, otherwise at the end of the list.

Load Image(s)...

This allows the user to load multiple images from disk. These will be added below the currently selected image or at the end of the list.

Images that are loaded into LightWave 3D already will not be loaded again.

Remove Image

This removes the currently selected image from the list.

Clear all Images

This clears the list of images.

Images (tab)

Overlap

The node places one image within a 0..1 range of UV values, similar to UDIM tiles. Normally, it also only checks for images within the current tile to see if it has to be placed and rendered or not. Overlap extends the “search” area. If you notice images being cut off, increase this value.

Higher values will lead to much longer rendering times. Anything above a value of 5 or so will be extremely slow.
Basically: If images are cut off at their border, increase this value. Otherwise: Don't. ;)

Reference Width (Pixels)

This defines which image width in Pixels should be considered as being the width of a UV tile at a scale of 100%. If this values is not 0, the the images will also be mapped in a proportional size to each other. If this settings is 0, every image will be as large as the corresponding UV tile at a scale of 100%.

Pixel Blending / Use MipMaps / MipMap Strength

These controls correspond to the identical controls in the native image sampler or image texturing nodes.

Bump Strength

The strength of the bump mapping.

Placement (tab)

Random Seed

The placement of the images as well as the variations defined below are computed using pseudo-random noise. The noise is based on this seed number. A different seed produces different results.

For example, if you're texturing instances and would like each of them to have a different distribution, you could use the instance ID as a random seed using the nodal input.

Create New Seed

This doesn't do anything at the moment. Eventually it will replace the *Random Seed* with a new random number.

Noise Frequency

The randomness of the placement of the images as well as their rotation, scale, etc. is based on a noise function. This setting changes the scale of that noise. Larger values make it more chaotic, smaller values less so, which will lead to images next to each other using more similar settings.

Probability

The probability a bitmap will show up.

Variation

The randomness of the variation in the Probability.

Scale

The scale of the Variation randomness.

Position (tab)

This controls how much the position of every image may deviate from the middle of the UV tile, on the horizontal ( X ) as well as the vertical (Y) axis. 0 will always place the image at the centre, 0.5 allows it to be placed anywhere from -0.5 to 0.5 from the centre (which covers the whole UV tile).

Rotation (tab)

Base

This rotates all placed images. If Randomize is active, it's the minimum rotation.

Randomize

Enabling this allows for randomized rotations.

Max

This is the maximum rotation if Randomize is enabled. The random rotations will be in the range from Base to this value.

Steps

A value larger than 1 will only allow for random rotations in discreet steps.

For example, if Base is 0°, Max is 360° and Steps is 4, the result of the random rotation will be 0°, 90°, 180° or 270°.

Scale (tab)

Base

This scales all placed images. If Randomize is active, it's the minimum scale.

Randomize

Enabling this allows for randomized scale.

Max

This is the maximum scale if Randomize is enabled. The random scale will be in the range from Base to this value.

HSV (tab)

This tab allows you to modify the Hue, Saturation and Value (Brightness) of the placed image.

Base

This changes the colour of all placed images. If Randomize is active, it's the minimum HSV value.

Randomize

Enabling this allows for randomized HSV variations.

Max

This is the maximum HSV value if Randomize is enabled. The random colouring will be in the range from Base to this value.

Alpha (tab)

Base

This changes the transparency of all placed images. If Randomize is active, it's the minimum transparency.

Randomize

Enabling this allows for randomized transparency.

Max

This is the maximum transparency value if Randomize is enabled. The random transparency will be in the range from Base to this value.

Node Connections

Inputs

The inputs correspond to the controls with the same name. Please remember that the inputs change the values per (surface) spot that is evaluated.

Outputs

Colour

This is the final composite of the random images over the background colour.

RGB

This is just the colour of the random images. If no image is visible at a spot, it will be black.

Luma

This is the luminosity of the RGB output.

Alpha

The transparency of the random images, taking their respective alpha channels into account.

Bump

A bump map computed from the luminosity of the images.

Tile Value

This is a random value between black and white (0 .. 1.0) for each tile, taking the alpha channel of the mapped images into account.


This is the plugin of the month for February 2019, made possible by the finest patrons on Patreon.

tools/random_image_mapper.txt · Last modified: 2019/03/02 18:24 by lightwolf