©Anton Podvalny

Table of Contents

In this chapter, we will discuss the process of texture baking with V-Ray.

 

Introduction


Rendering to texture, or "texture baking,” allows you to create texture maps based on an object's appearance in the rendered scene. The textures are then “baked” into the object that is, they become part of the object via mapping, and can be used to display the textured object rapidly on Direct3D devices such as graphics display cards or game engines.

In our case, we will show you how a simple scene can be baked and how this method can also be used for making a Fly-Through Animation. First off, you render the scene. Then you instanciate the BakeView plugin and specify the bake_node and the target_nodes. Specify any other parameters as needed. Then you start the render process again. In the image example above we can choose to bake the ground and the plane objects, in which case we receive the following baked textures:

After this you can load the baked textures on the ground and plane object. Here are some additional views of the scene from different positions:

Parameters


The plugin which controls the parameters related to baking is called BakeView. Its parameters are:

  • bake_node - The node to bake
  • target_nodes - List of the target objects for projection baking
  • bake_uvwgen - The uvw generator
  • dilation - Number of pixels to expand around geometry
  • flip_derivs - true to flip the texture direction derivatives (reverses bump mapping)
  • u_min - The minimum u value to bake
  • v_min - The minimum v value to bake
  • u_max - The maximum u value to bake
  • v_max - The maximum v value to bake
  • transform - Transform
  • fov - Field of view (overrides the one defined in RenderView)
  • projection_baking - 0 - normal baking, 1 - projection baking
  • mode - 0 - outside, 1 - inside, 2 - outside first, the inside, 3 - inside first, the outside, 4 - closest
  • normal - 0 - Smooth normal, 1 - Geometry normal
  • max_depth - Geometry that is intersected further than this value along the ray will be ignored. If the value is zero then no geometry will be ignored.
  • ray_offset - The ray's beginning will be offseted this much along the normal.
  • from_camera - 0 - shade reflections, etc. from rays along surface normal; 1 - bake from rays originating from camera.

 

Example


The following example texture is baked using this scene.

Diffuse Render element:

Extra texture - dirt:

  • No labels
Was this helpful?