UV mapping tells a computer how to apply a texture to a 3D object. We’ll start this tutorial by importing an already mapped cube thus making the assumption that you know how to create a UV mapped cube in a 3D modeling software.
We import a UV mapped object by pressing Ctrl+D (or by going to Assets tab and clicking on Import button). In this guide we’ll import a UV mapped cube and place it in the Visualizer by right-clicking in the Visualizer, hovering above Object and clicking on our object.
After that, you should see your object in the Visualizer. It is going to be grey without any texture applied to it.
In LightAct, UV mapped objects can grab any texture variable and apply it onto itself. Therefore, let’s create a layer and a texture variable.
We right-click somewhere in the Sequencer and click on Add layer. Then, let’s open that layer by double-clicking on it.
Now, right click on the Texture in the Variables section and then click on Create new. A new texture variable should appear with a name Exposed texture 1 (or similar).
Then, right-click on the texture variable and click on Add setter. This will create a Texture setter node on the left side of the window. If you select it you can change the name of the variable into something more telling. Let’s change it to boxTexture.
Now, what we have to do is tell LightAct which texture should this boxTexture variable hold. You can connect any texture to the texture input of the Texture setter node, but let’s import an image and use that image as texture input. We press Ctrl+D again and import an image file.
Then insert an Image reader node by right-clicking to bring up the menu and starting to write ‘image reader’ in the search box. Click on Image reader when it appears.
Connect all the nodes as shown above.
Then, select Image reader node and select the imported image as the source.
You can also go ahead and check the Preview checkbox in the Node properties which will make the texture show up below the Image reader if the transport is on the layer. This is not necessary, but it can be useful to check if the texture is correct.
Congratulations! We’ve successfully read an image file and are saving this texture into a variable. All we have to do now is to tell our cube in the Visualizer that it should use boxTexture variable as the texture source.
Select the cube in the visualizer and in the Source tab of its properties select boxTexture as the source. This is it, now the cube in the Visualizer should have a texture applied to it.
In the next chapter, we’ll insert a projector and tell it to source its content from this cube.