Skip to content
07-848 2005

Application SDK

UVWGens

In this chapter, we'll cover important utilities about texturing - UVW coordinate generators, or, for short, UVWGens. Generally, the UVW data is stored in the geometry, in GeomStaticMesh::map_channels. It has the following format:

Last updated 9 April 2026

Introduction

In this chapter, we'll cover important utilities about texturing - UVW coordinate generators, or, for short, UVWGens. Generally, the UVW data is stored in the geometry, in GeomStaticMesh::map_channels. It has the following format:

Python

C++

C#.NET

Node.js

UVWGenChannel

Modifier for UVW data coming from the geometry source. The main parameter is uvw_channel - the index of the mapping channel data to use (i.e. GeomStaticMesh::map_channels). The default is 1, as in 3dsMax, where indexing starts from 1, but in your application, this may be 0 or something else. If you set an index of -1, V-Ray will take the first available channel. This plugin also has transform, wrap, and crop parameters, as well as the option to get UVW data from another UVWGen plugin.

Parameters

  • uvw_transform - Initial transformation on the uvw coordinates, before mirror, crop etc
  • uvw_transform_tex - Same as uvw_transform, but receives a texture with transformations.
  • tex_transform - Final transformation on the resulting uvw coordinates, after mirror, crop etc
  • nsamples - Number of uvw transform samples
  • wrap_u/v/w - 0 - no wrapping, 1 - wrap, 2 - mirror tile
  • crop_u/v/w - 1 to crop in the u/v/w-direction
  • coverage - Coverage
  • uvw_coords - The uvw coordinates for the specified channel at the current shading point
  • wrap_mode - Wrap mode (0 - wrap on 0.5 boundary; 1 - wrap on integer boundary)
  • duvw_scale - Additional scale factor for the texture derivatives
  • uvw_channel - Described above
  • uvwgen - Optional UVWGen from which the initial uvw coordinates will be taken, instead of the surface point
  • use_double_sided_mode - If this is true then we will use uvw_channel for front-side and uvw_channel + 1 for back-side contexts. This is primarily for V-Ray for SketchUp.

Examples

With the help of TexUVW we can visualize the different UVW spaces we can create using the UVW generators. Here's the code we use:

Python

C++

C#.NET

Node.js

UVWGenEnvironment

Used to map spherical, cube, etc., textures on the environment color slot or on dome lights.

Parameters

  • uvw_matrix - Transformation of the input directions
  • uvw_transform - Transformation of the resulting UVW coordinates
  • mapping_type - One of "angular", "cubic", "spherical", "mirror_ball", "screen", "max_spherical", "spherical_vray", "max_cylindrical" or "max_shrink_wrap"
  • wrap_u/v/w - 0 - no wrapping, 1 - wrap, 2 - mirror tile
  • crop_u/v/w - 1 to crop in the u/v/w-direction
  • duvw_scale - Additional scale factor for the texture derivatives
  • ground_on -
  • ground_position - Normal vector of the ground plane
  • ground_radius - Radius of the ground circle

Example

In this example, we'll create a textured dome light with spherical mapping of the UVWGen:

Python

C++

C#.NET

Node.js

UVWGenExplicit

Define explicit UVW data from a texture.

Parameters

  • u - the U input of floats
  • v - the V input of floats
  • w - the W input of floats
  • uvw - input as UVW texture

UVWGenMayaPlace2dTexture

Similar to UVWGenChannel, but with more options.

Parameters

  • uvw_channel_tex - Used when more than one mesh has UV linking specified for this 2d placement. If present will override uvw_channel.
  • uvwgen - Optional UVWGen from which the initial uvw coordinates will be taken, instead of the surface point
  • nsamples - The number of parameter samples to take for motion blur. 0 means the global value. 1 means motion blur should be disabled for this plugin.
  • uv_set_name - The name of the uv channel that should be used.

UVWGenObject

This generator transforms world-space coordinates into object space.

Parameters

  • uvw_transform - Initial transformation on the uvw coordinates
  • duvw_scale - Additional scale factor for the texture derivatives

UVWGenPlanarWorld

This generator returns the UVW coordinates in world space.

Parameters

  • uvw_transform - Initial transformation on the uvw coordinates, before mirror, crop etc
  • uvw_transform_tex - TextureTransform
  • tex_transform - Final transformation on the resulting uvw coordinates, after mirror, crop etc
  • nsamples - Number of uvw transform samples
  • wrap_u/v/w - 0 - no wrapping, 1 - wrap, 2 - mirror tile
  • crop_u/v/w - 1 to crop in the u/v/w-direction
  • coverage - Coverage
  • uvw_coords - The uvw coordinates for the specified channel at the current shading point
  • wrap_mode - Wrap mode (0 - wrap on 0.5 boundary; 1 - wrap on integer boundary
  • duvw_scale - Additional scale factor for the texture derivatives