© Square Enix © Goodbye Kansas


Table of Contents

This page offers a step by step tutorial on how to use V-Ray for projection baking. 


Overview


In this tutorial we explore how to use V-Ray for projection baking. One way is to use the V-Ray BakerTool and another is to use the V-Ray Renderer ROP. We provide a use case for each of the methods. 

You can download a sample scene and all of its assets as an archive to help you follow the steps of the tutorial. 

The scene requires Houdini 18 at least and V-Ray Next, Update 1.


Download Tutorial Assets


High Poly
Low Poly Baked


Projection Baking with V-Ray BakerTool


Let's start by opening the bakingViaBakerTool_start scene packed and available for download.

Enter the Balloon node and find the Null node called Balloon_low. This is the low poly balloon geometry. Next to it, find the Balloon_high node, that represents the high poly geometry.





Create a V-Ray BakerTool node and call it "Balloon". The same name is used later when we save the baked textures.

Connect the Balloon_low node to the left input and Balloon_high to the right input of the Balloon node.

In the Baker tab of the V-Ray BakerTool change the Baking Mode to Projection Baking.

To avoid unnecessary edges in the bump and normals texture, we can skip baking the normals of the lowRes mesh. Go to the Projection Settings panel and set the Normals to Smooth.




Attributes


Go to the Renderer tab and set the Sampler to Bucket.

In the Forced Attributes, enter "fabricID" and leave the Use Lights field empty.

fabricID is an attribute already created in the scene as a node called assign_different_texture_to_every_part_of_the_balloon. Its purpose is to prompt the material to use different textures with respect to the attribute's value for each primitive.





The name of the string attribute is put in brackets "<>" next to the texture path in the imageFile node.




Render Elements


Now let's go back to the Balloon node (V-Ray BakerTool) and open the Output tab.

Enable the following checkboxes: Output, Diffuse, BumpNormals, Reflection, Refl Gloss, Ambient Occlusion.

Expand the Ambient Occlusion settings and set the Radius to 0.3 and Subdivs to 6.

In the Custom Attributes enable the first one and enter borders @ border attributes in the fields. This attribute serves to darken the different patches of textile onto the edges, so they are more distinct.

Also choose higher resolution (4069 2) for the texture.



Disable Lights


Since we are not really interested in the beauty pass, we can disable all lights, including the default ones to speed up the rendering.

To disable the default lights, go into V-Ray BakerTool > Renderer tab > Disable Lightning.



Ropes and Basket Settings


Now, let's go on with the setup of the balloon ropes.

Copy the V-Ray BakerTool and connect the Ropes_low and Ropes_high nodes to their respective inputs, just as we did with the low and high res nodes for the balloon.





For the ropes, we only need the Diffuse, BumpNormals and Ambient Occlusion Outputs enabled





This same setup with the V-Ray BakerTool is repeated for the Basket low and high poly geometries.





Again, in the Output tab, enable only the Diffuse, BumpNormals and Ambient Occlusion options.


 




To start the texture baking, press the Execute Baking button of the respective V-Ray BakerTool node.

Note that you need different V-Ray Baker Tool node for each of the geometries - one for the balloon, another for the ropes and a third one for the basket.

To bake three separate texture maps, go to each of the three V-Ray BakerTool nodes and press the Execute Baking button.



Projection Baking with V-Ray Renderer ROP


You can also bake textures using the V-Ray Renderer ROP. Let's see what steps are needed to do it.

Open the bakingViaRendererRop_start.hip file packed with this tutorial assets.

Here the different elements that are baked are referred as geo nodes, because V-Ray Renderer ROP baking does not support SOP nodes.

From the /obj create a camera. The location and direction of the camera are not important, as it is used only as a container for baking settings.

Dive into the Baking_ROPNet node and create a V-Ray Renderer node. Let's call it BalloonROP.

Select the newly created camera as a Camera and then enable the Bake to Texture option.





Once you enable the Bake to Texture option, a Bake tab appears with all the necessary baking options.

For Objects, select the LowRes balloon object.

For Target Objects, select the HighRes balloon object.

Set Projection Baking to Projection, Mode to Closest, and Normal to Smooth.



Render Optimization


Let's optimize the render so to speed the rendering process. Go to the Renderer tab.

Set the Image Sampler Type to Bucket.

Change the Max Subdivs to 12.





Disable the Global Illumination from the Global Illumination tab.

Go to the Options tab > Lights tab and disable the Default Lights and Shadows options.





Go to the Objects tab.

Leave the Candidate Objects field empty.

For Force Objects, select the low and high Res Balloon objects.

In the Force Attributes field enter the fabricID attribute.

You can also leave the Candidate Lights field empty, as we are not interested in the beauty pass and it will speed up the render process.



Render Elements


We have to manually select the elements to be baked.

Create a V-Ray Render Elements node, call it balloonElements and dive into it. 

Then, we create the following elements: diffuse, bumpnormals, reflect, reflection glossiness, ambient occlusion, user attribute.


Diffuse:

Create a V-Ray Color Channel (RE) and change its Type to Diffuse. Call the node diffuse as this name is used by default for the (render) element when saved. Connect it to the first input of the channelsContainer.

Bump-normals:

Create a V-Ray Bump Normals (RE) node and call it bumpNormals. Connect it to the next input of the channelsContainer.

Reflect:

Create a V-Ray Reflection Glossiness (RE) and set its Type to RawReflectionFilter. Rename it to reflect and connect it to the next input of the channelsContainer.

Reflection Glossiness:

Create a V-Ray Reflection Glossiness (RE) and call it reflGloss. Connect it to the next input of the channelsContainer.

Ambient Occlusion:

This element is created in two steps:

  1. Create a V-Ray ExtraTex (RE) and call it ao. Connect it to the next input of the channelsContainer.
  2. Create a V-Ray Dirt node and connect it to the input of the extraTex element from the previous step. Change its Radius to 0.3, enable the Subdivs As Samples option and set the Subdivs to 6.

User attribute:

The creation of this element also requires two steps:

  1. Create a V-Ray ExtraTex (RE) and call it borders. Connect it to the next input of the channelsContainer.
  2. Create a V-Ray User Color node. Place "border" in the attribute field and connect the output of this node to the input of the V-Ray ExtraTex (RE) from step 1.





Now let's render those elements. Go out of the BallonElements node and select the balloonROP node.

In the Images tab > Network drag and drop the balloonElements.

We are ready to Render to Disk.


 


Ropes and Basket Settings


In order not to repeat all of the steps from the beginning, let's copy the balloonROP and balloonElements and change their names respectively to ropesROP and ropesElements.

Navigate to the Bake tab and choose the ropes low and high res polys as Objects and Target Objects. Then in the Objects tab, amend the Force Objects to high and low res ropes objects. Delete the fabricID attribute from the Forced Attributes field.





Dive into the ropesElements node and delete all elements but diffuse, bumpNormals and ambient occlusion.

Go one level up and from ropesROP press the Render to Disk button.

Repeat the same steps for the basket.


Note that you need a separate ROP node for each of the three geometries - balloon, ropes and basket. The baking steps are repeated for each of those three.