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 <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line"># map_channels describe the UVW coordinates used to map a texture to the geometry surface.</span><span data-v-c2b1f83f="" class="line">geometry.map_channels = [</span><span data-v-c2b1f83f="" class="line"> [</span><span data-v-c2b1f83f="" class="line"> # channel index</span><span data-v-c2b1f83f="" class="line"> 1,</span><span data-v-c2b1f83f="" class="line"> # List of UVW coordinates.</span><span data-v-c2b1f83f="" class="line"> # The W coordinate has to be set (0.0 in this case) even when performing 2D texturing.</span><span data-v-c2b1f83f="" class="line"> vray.VectorList(</span><span data-v-c2b1f83f="" class="line"> vray.Vector(0.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> vray.Vector(0.0, 1.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> vray.Vector(1.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> vray.Vector(1.0, 1.0, 0.0)</span><span data-v-c2b1f83f="" class="line"> ),</span><span data-v-c2b1f83f="" class="line"> # List of indices from the UVW list. </span><span data-v-c2b1f83f="" class="line"> # Each three consecutive indices are used for a single triangle.</span><span data-v-c2b1f83f="" class="line"> # They correspond directly to the vertex indices in the 'faces' array.</span><span data-v-c2b1f83f="" class="line"> vray.IntList(</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2</span><span data-v-c2b1f83f="" class="line"> )</span><span data-v-c2b1f83f="" class="line"> ]</span><span data-v-c2b1f83f="" class="line">]</span></code>
C++ <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// The W coordinate has to be set (0.0 in this case) even when performing 2D texturing.</span><span data-v-c2b1f83f="" class="line">Vector uvwCoords[] = {</span><span data-v-c2b1f83f="" class="line"> Vector(0.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> Vector(0.0, 1.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> Vector(1.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> Vector(1.0, 1.0, 0.0)</span><span data-v-c2b1f83f="" class="line">};</span><span data-v-c2b1f83f="" class="line">// Each three consecutive indices are used for one triangle. </span><span data-v-c2b1f83f="" class="line">// They correspond directly to the vertex indices in the 'faces' array.</span><span data-v-c2b1f83f="" class="line">int uvwIndices[] = {</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2</span><span data-v-c2b1f83f="" class="line">};</span><span data-v-c2b1f83f="" class="line">ValueList list;</span><span data-v-c2b1f83f="" class="line">list.push_back(Value(1)); // channel index</span><span data-v-c2b1f83f="" class="line">list.push_back(Value(uvwCoords)); // list of UVW coordinates</span><span data-v-c2b1f83f="" class="line">list.push_back(Value(uvwIndices)); // list of indices from the UVW list</span><span data-v-c2b1f83f="" class="line">// map_channels describe the UVW coordinates used to map a texture to the geometry surface</span><span data-v-c2b1f83f="" class="line">ValueList channels;</span><span data-v-c2b1f83f="" class="line">channels.push_back(Value(list));</span><span data-v-c2b1f83f="" class="line">geometry.set_map_channels(channels);</span></code>
C#.NET <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">List<object> channels = new List<object>();</span><span data-v-c2b1f83f="" class="line">channels.Add(new List<object> {</span><span data-v-c2b1f83f="" class="line"> // Channel index.</span><span data-v-c2b1f83f="" class="line"> 1,</span><span data-v-c2b1f83f="" class="line"> // List of UVW coordinates.</span><span data-v-c2b1f83f="" class="line"> // The W coordinate has to be set (0.0 in this case) even when performing 2D texturing.</span><span data-v-c2b1f83f="" class="line"> new Vector[] {</span><span data-v-c2b1f83f="" class="line"> new Vector(0.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> new Vector(0.0, 1.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> new Vector(1.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> new Vector(1.0, 1.0, 0.0)</span><span data-v-c2b1f83f="" class="line"> },</span><span data-v-c2b1f83f="" class="line"> // List of indices from the UVW list. </span><span data-v-c2b1f83f="" class="line"> // Each three consecutive indices are used for one triangle.</span><span data-v-c2b1f83f="" class="line"> // They correspond directly to the vertex indices in the 'faces' array.</span><span data-v-c2b1f83f="" class="line"> new int[] {</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2</span><span data-v-c2b1f83f="" class="line"> }</span><span data-v-c2b1f83f="" class="line">});</span><span data-v-c2b1f83f="" class="line">// MapChannels describe the UVW coordinates used to map a texture to the geometry surface.</span><span data-v-c2b1f83f="" class="line">geometry.MapChannels = channels;</span></code>
Node.js <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// The W coordinate has to be set (0.0 in this case) even when performing 2D texturing. </span><span data-v-c2b1f83f="" class="line">var uvwCoords = vray.VectorList(</span><span data-v-c2b1f83f="" class="line"> vray.Vector(0.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> vray.Vector(0.0, 1.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> vray.Vector(1.0, 0.0, 0.0),</span><span data-v-c2b1f83f="" class="line"> vray.Vector(1.0, 1.0, 0.0)</span><span data-v-c2b1f83f="" class="line">);</span><span data-v-c2b1f83f="" class="line">// Each three consecutive indices are used for one triangle. </span><span data-v-c2b1f83f="" class="line">// They correspond directly to the vertex indices in the 'faces' array.</span><span data-v-c2b1f83f="" class="line">var uvwIndices = vray.IntList(</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2,</span><span data-v-c2b1f83f="" class="line"> 2, 0, 1,</span><span data-v-c2b1f83f="" class="line"> 1, 3, 2</span><span data-v-c2b1f83f="" class="line">); </span><span data-v-c2b1f83f="" class="line">var map_channel = vray.List();</span><span data-v-c2b1f83f="" class="line">map_channel.push(1); // channel index</span><span data-v-c2b1f83f="" class="line">map_channel.push(uvwCoords); // list of UVW coordinates</span><span data-v-c2b1f83f="" class="line">map_channel.push(uvwIndices); // list of indices from the UVW list</span><span data-v-c2b1f83f="" class="line">// map_channels describe the UVW coordinates used to map a texture to the geometry surface.</span><span data-v-c2b1f83f="" class="line">var channels = vray.List();</span><span data-v-c2b1f83f="" class="line">channels.push(map_channel);</span><span data-v-c2b1f83f="" class="line">geometry.map_channels = channels;</span></code>
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 <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line"># Create a new UVWGenChannel</span><span data-v-c2b1f83f="" class="line">UVWGen = renderer.classes.UVWGenChannel()</span><span data-v-c2b1f83f="" class="line"> </span><span data-v-c2b1f83f="" class="line"># Create a new TexUVW. It allows displaying of UVW space as RGB</span><span data-v-c2b1f83f="" class="line">uvwTex = renderer.classes.TexUVW()</span><span data-v-c2b1f83f="" class="line">uvwTex.uvwgen = UVWGen</span></code>
C++ <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// Create a new UVWGenChannel</span><span data-v-c2b1f83f="" class="line">UVWGenChannel UVWGen = renderer.newPlugin<UVWGenChannel>();</span><span data-v-c2b1f83f="" class="line"> </span><span data-v-c2b1f83f="" class="line">// Create a new TexUVW. It allows displaying of UVW space as RGB</span><span data-v-c2b1f83f="" class="line">TexUVW uvwTex = renderer.newPlugin<TexUVW>();</span><span data-v-c2b1f83f="" class="line">uvwTex.set_uvwgen(UVWGen);</span></code>
C#.NET <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// Create a new UVWGenChannel</span><span data-v-c2b1f83f="" class="line">UVWGenChannel UVWGen = renderer.NewPlugin<UVWGenChannel>();</span><span data-v-c2b1f83f="" class="line"> </span><span data-v-c2b1f83f="" class="line">// Create a new TexUVW. It allows displaying of UVW space as RGB</span><span data-v-c2b1f83f="" class="line">TexUVW uvwTex = renderer.NewPlugin<TexUVW>();</span><span data-v-c2b1f83f="" class="line">uvwTex.Uvwgen = UVWGen;</span></code>
Node.js <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// Create a new UVWGenChannel</span><span data-v-c2b1f83f="" class="line">var UVWGen = renderer.classes.UVWGenChannel();</span><span data-v-c2b1f83f="" class="line"> </span><span data-v-c2b1f83f="" class="line">// Create a new TexUVW. It allows displaying of UVW space as RGB</span><span data-v-c2b1f83f="" class="line">var uvwTex = renderer.classes.TexUVW();</span><span data-v-c2b1f83f="" class="line">uvwTex.uvwgen = UVWGen;</span></code>
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 <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line"># The UVWGenEnvironment allows spherical, cube, etc. textures to be mapped on the environment color slot or dome lights.</span><span data-v-c2b1f83f="" class="line">uvwgen = renderer.classes.UVWGenEnvironment()</span><span data-v-c2b1f83f="" class="line"># Specify the type and shape of the texture.</span><span data-v-c2b1f83f="" class="line">uvwgen.mapping_type = 'spherical'</span><span data-v-c2b1f83f="" class="line"># Specify transformation of the input directions.</span><span data-v-c2b1f83f="" class="line">uvwgen.uvw_matrix = vray.Matrix( vray.Vector(1, 0, 0), vray.Vector(0, 0, 1), vray.Vector(0, -1, 0))</span><span data-v-c2b1f83f="" class="line">uvwgen.ground_on = 1</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">bitmap = renderer.classes.BitmapBuffer()</span><span data-v-c2b1f83f="" class="line"># unlike JPG files, HDR files are linear</span><span data-v-c2b1f83f="" class="line">bitmap.transfer_function = 0</span><span data-v-c2b1f83f="" class="line">bitmap.file = os.path.join(SCENE_PATH, 'assets', 'Sea_D.hdr')</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">texture = renderer.classes.TexBitmap()</span><span data-v-c2b1f83f="" class="line"># Specify UVW generator for the texture.</span><span data-v-c2b1f83f="" class="line">texture.uvwgen = uvwgen</span><span data-v-c2b1f83f="" class="line"># Specify the bitmap that the texture will be using.</span><span data-v-c2b1f83f="" class="line">texture.bitmap = bitmap</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">light = renderer.classes.LightDome()</span><span data-v-c2b1f83f="" class="line"># Switches between a hemispherical or (full) spherical shape of the light.</span><span data-v-c2b1f83f="" class="line"># Possible values are: True (Sphere), False (Hemisphere)</span><span data-v-c2b1f83f="" class="line">light.dome_spherical = True</span><span data-v-c2b1f83f="" class="line"># Specify the light texture.</span><span data-v-c2b1f83f="" class="line">light.dome_tex = texture</span><span data-v-c2b1f83f="" class="line"># Enable the use of a light texture.</span><span data-v-c2b1f83f="" class="line"># If "use_dome_tex = False" the 'color' of the light will be used instead.</span><span data-v-c2b1f83f="" class="line">light.use_dome_tex = True</span></code>
C++ <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// The UVWGenEnvironment allows spherical, cube, etc. textures to be mapped on the environment color slot or dome lights.</span><span data-v-c2b1f83f="" class="line">UVWGenEnvironment uvwgen = renderer.newPlugin<UVWGenEnvironment>();</span><span data-v-c2b1f83f="" class="line">// Specify the type and shape of the texture.</span><span data-v-c2b1f83f="" class="line">uvwgen.set_mapping_type("spherical");</span><span data-v-c2b1f83f="" class="line">// Specify transformation of the input directions.</span><span data-v-c2b1f83f="" class="line">uvwgen.set_uvw_matrix( Matrix( Vector(1.0, 0.0, 0.0), Vector(0.0, 0.0, 1.0), Vector(0.0, -1.0, 0.0)));</span><span data-v-c2b1f83f="" class="line">uvwgen.set_ground_on(1);</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">BitmapBuffer bitmap = renderer.newPlugin<BitmapBuffer>();</span><span data-v-c2b1f83f="" class="line">// unlike JPG files, HDR files are linear</span><span data-v-c2b1f83f="" class="line">bitmap.set_transfer_function(0);</span><span data-v-c2b1f83f="" class="line">bitmap.set_file("assets" PATH_DELIMITER "Sea_D.hdr");</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">TexBitmap texture = renderer.newPlugin<TexBitmap>();</span><span data-v-c2b1f83f="" class="line">// Specify UVW generator for the texture.</span><span data-v-c2b1f83f="" class="line">texture.set_uvwgen(uvwgen);</span><span data-v-c2b1f83f="" class="line">// Specify the bitmap that the texture will be using.</span><span data-v-c2b1f83f="" class="line">texture.set_bitmap(bitmap);</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">LightDome light = renderer.newPlugin<LightDome>();</span><span data-v-c2b1f83f="" class="line">// Switches between a hemispherical or (full) spherical shape of the light.</span><span data-v-c2b1f83f="" class="line">// Possible values are: true (Sphere), false (Hemisphere) - default</span><span data-v-c2b1f83f="" class="line">light.set_dome_spherical(true);</span><span data-v-c2b1f83f="" class="line">// Specify the light texture.</span><span data-v-c2b1f83f="" class="line">light.set_dome_tex(texture);</span><span data-v-c2b1f83f="" class="line">// Enable the use of a light texture.</span><span data-v-c2b1f83f="" class="line">// If "use_dome_tex = false" the 'color' of the light will be used instead.</span><span data-v-c2b1f83f="" class="line">light.set_use_dome_tex(true);</span></code>
C#.NET <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// The UVWGenEnvironment allows spherical, cube, etc. textures to be mapped on the environment color slot or dome lights.</span><span data-v-c2b1f83f="" class="line">UVWGenEnvironment uvwgen = renderer.NewPlugin<UVWGenEnvironment>();</span><span data-v-c2b1f83f="" class="line">// Specify the type and shape of the texture.</span><span data-v-c2b1f83f="" class="line">uvwgen.MappingType = "spherical";</span><span data-v-c2b1f83f="" class="line">// Specify transformation of the input directions.</span><span data-v-c2b1f83f="" class="line">uvwgen.UvwMatrix = new Matrix( new Vector(1, 0, 0), new Vector(0, 0, 1), new Vector(0, -1, 0));</span><span data-v-c2b1f83f="" class="line">uvwgen.GroundOn = 1;</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">BitmapBuffer bitmap = renderer.NewPlugin<BitmapBuffer>();</span><span data-v-c2b1f83f="" class="line">// unlike JPG files, HDR files are linear</span><span data-v-c2b1f83f="" class="line">bitmap.TransferFunction = 0;</span><span data-v-c2b1f83f="" class="line">bitmap.File = Path.Combine("assets", "Sea_D.hdr");</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">TexBitmap texture = renderer.NewPlugin<TexBitmap>();</span><span data-v-c2b1f83f="" class="line">// Specify UVW generator for the texture.</span><span data-v-c2b1f83f="" class="line">texture.Uvwgen = uvwgen;</span><span data-v-c2b1f83f="" class="line">// Specify the bitmap that the texture will be using.</span><span data-v-c2b1f83f="" class="line">texture.Bitmap = bitmap;</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">LightDome light = renderer.NewPlugin<LightDome>();</span><span data-v-c2b1f83f="" class="line">// Switches between a hemispherical or (full) spherical shape of the light.</span><span data-v-c2b1f83f="" class="line">// Possible values are: true (Sphere), false (Hemisphere)</span><span data-v-c2b1f83f="" class="line">light.DomeSpherical = true;</span><span data-v-c2b1f83f="" class="line">// Specify the light texture.</span><span data-v-c2b1f83f="" class="line">light.DomeTex = texture;</span><span data-v-c2b1f83f="" class="line">// Enable the use of a light texture.</span><span data-v-c2b1f83f="" class="line">// If "use_dome_tex = False" the 'color' of the light will be used instead.</span><span data-v-c2b1f83f="" class="line">light.UseDomeTex = true;</span></code>
Node.js <code data-v-c2b1f83f=""><span data-v-c2b1f83f="" class="line">// The UVWGenEnvironment allows spherical, cube, etc. textures to be mapped on the environment color slot or dome lights.</span><span data-v-c2b1f83f="" class="line">var uvwgen = renderer.classes.UVWGenEnvironment();</span><span data-v-c2b1f83f="" class="line">// Specify transformation of the input directions.</span><span data-v-c2b1f83f="" class="line">uvwgen.uvw_matrix = vray.Matrix( vray.Vector(1, 0, 0), vray.Vector(0, 0, 1), vray.Vector(0, -1, 0));</span><span data-v-c2b1f83f="" class="line">// Specify the type and shape of the texture.</span><span data-v-c2b1f83f="" class="line">uvwgen.mapping_type = "spherical";</span><span data-v-c2b1f83f="" class="line">uvwgen.ground_on = 1;</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">var bitmap = renderer.classes.BitmapBuffer();</span><span data-v-c2b1f83f="" class="line">// unlike JPG files, HDR files are linear</span><span data-v-c2b1f83f="" class="line">bitmap.transfer_function = 0;</span><span data-v-c2b1f83f="" class="line">bitmap.file = path.join(SCENE_PATH, "assets", "Sea_D.hdr");</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">var texture = renderer.classes.TexBitmap();</span><span data-v-c2b1f83f="" class="line">// Specify UVW generator for the texture.</span><span data-v-c2b1f83f="" class="line">texture.uvwgen = uvwgen;</span><span data-v-c2b1f83f="" class="line">// Specify the bitmap that the texture will be using.</span><span data-v-c2b1f83f="" class="line">texture.bitmap = bitmap;</span><span data-v-c2b1f83f="" class="line"></span><span data-v-c2b1f83f="" class="line">var light = renderer.classes.LightDome();</span><span data-v-c2b1f83f="" class="line">// Switches between a hemispherical or (full) spherical shape of the light.</span><span data-v-c2b1f83f="" class="line">// Possible values are: true (Sphere), false (Hemisphere)</span><span data-v-c2b1f83f="" class="line">light.dome_spherical = true;</span><span data-v-c2b1f83f="" class="line">// Specify the light texture.</span><span data-v-c2b1f83f="" class="line">light.dome_tex = texture;</span><span data-v-c2b1f83f="" class="line">// Enable the use of a light texture.</span><span data-v-c2b1f83f="" class="line">// If "use_dome_tex = false" the 'color' of the light will be used instead.</span><span data-v-c2b1f83f="" class="line">light.use_dome_tex = true;</span></code>
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