©BBB3viz

Table of Contents

This page provides information on V-Ray Proxy Objects in a .vrmesh file format and working with .vrmesh files though VRayProxy.

 

The .vrmesh File Format


The .vrmesh file format can hold data for meshes, hair and particles. It contains all geometric information for a mesh including vertices and face topology, texture channels, face material IDs, smoothing groups, and normals. It can also include point cloud data. Materials are not saved in the file. Instead, the geometry is rendered with the material applied to the VRayProxy object. This is so because third party materials and procedural textures would be difficult to describe in a general way. In addition, you may want to edit the material independently of the mesh as the .vrmesh files can be rendered outside of 3ds Max – for example, by the standalone version of V-Ray, or V-Ray for Maya.

The .vrmesh file format stores its meshes preprocessed and subdivided into chunks for easier access. Also, V-Ray automatically regards proxies that load the same .vrmesh files like instanced duplicates in the scene to save memory when those proxies have the same settings. These two features significantly speed up the rendering. To keep the load low in the viewpor,t the .vrmesh file format also contains a simplified version of the mesh used for preview purposes.

 

Exporting a Mesh to a File


You can create your own VRayProxy appropriate mesh files in multiple ways:

  1. Dialog from MaxScript: Select the meshes you want to export and then type doVRayMeshExport() in the MaxScript Listener window to display the Mesh Export dialog.
  2. Direct export from MaxScript: Select the meshes you want to export and then use the vrayMeshExport() function. For more information, please see the MaxScript page.
  3. Through V-Ray menu: Select the meshes you want to export, and then go to V-Ray > .vrmesh exporter. For more information, please see the Mesh Export dialog.

The function returns ok if the .vrmesh file was exported successfully, and undefined otherwise.

In V-Ray 6 for 3ds Max, the .vrmesh exporter tool has been moved to the V-Ray Menu (||V-Ray|| > .vrmesh exporter) and is no longer available in the quad menu.

For earlier V-Ray versions, right-click in the viewport and select V-Ray mesh export option from the quad menu to display the Mesh Export dialog.

 


Mesh Export Dialog


The Mesh Export Dialog specifies the mesh file as well as some export options.

Folder – Specifies the folder where the mesh file(s) are created. 

Export all selected objects in a single file – Takes all selected objects and merges them into one mesh file. This option also stores the transformations of the selected objects. When importing the file with a proxy object, it must be centered at the origin if you want the objects to be in the same place. Also, since the imported mesh is rendered using the material of the proxy object, all meshes from the file render with that material. You must use sub-object materials and different material IDs if you want the meshes to have different materials.

Export each selected object in a separate file – Creates one file for each selected object. The name of each file is derived from the name of the corresponding 3ds Max node. The transformation of an object is not included in its mesh file, and the corresponding proxy must have the same transformation as the original object if it is to appear in the same place. Note that you can use this option even with a single object, which will cause the object's pivot point to be preserved in the exported .vrmesh file.

File – Specifies the name of the file when Export all selected objects in a single file is selected. A path does not need to be specified; the Folder path will be used.

Specify preview mesh – When enabled, uses a mesh to preview the proxy in the viewport.

Pick preview mesh – Specifies the mesh to be used as a preview for the proxy in the viewport.

Export animation – When enabled, exports the animation from an animated mesh in the .vrmesh file.

Frame range – Specifies how to determine the range of animation frames to be exported into the .vrmesh file.

Scene animation range – Exports the whole animation into the .vrmesh file.
Frame range – Exports only the section of the animation specified with the Start Frame and the End Frame parameters.

Redraw views during export – When enabled, plays the animation in the viewport while it is being exported. This is an easy way to monitor the progress of the export.

Automatically create proxies – When enabled, creates proxy objects for the exported meshes. The proxies will have the correct transformations and materials derived from the original objects. The original objects will be deleted.

Export point clouds – When enabled, adds a point cloud representation of the mesh separated into different levels of detail. The various levels of detail can be used by proxies for saving memory when rendering distant objects.

Lowest level point size – Determines the size of point cloud disks at the most detailed level. If this value is small, point clouds rendered at the lowest level appear closer to original mesh but use more memory. For more information, see the Lowest Level Point Size Parameter example below. 

Faces in preview % – Specifies how many faces are used to show a preview of the proxy in the viewport.

Warn for existing files – When enabled, V-Ray displays a warning when saving over an existing file.

Min preview faces – Sets the minimum amount of faces that are used as a preview on importing using VRayProxy.

Max preview faces – Sets the maximum amount of faces that are used as a preview on importing using VRayProxy.

Preview type – Specifies the method for producing a preview mesh from the original geometry. Previous versions of V-Ray have used the Face Skipping (very fast) method.

Vertex Clustering (fast) – Uses a uniform grid with at most one vertex in each cell. This method is very fast and robust, but does not preserve fine details.
Refined Clustering (quality) – A two-stage algorithm that uses vertex clustering to get the job halfway done. Then a more sophisticated but slower algorithm finishes the mesh simplification. This method produces higher quality meshes than the Vertex Clustering (fast) method alone but is slightly slower.
Face skipping (very fast) – Displays randomly picked faces from the original mesh. This is the fastest algorithm, but it doesn't produce a connected mesh.

Faces in voxel – Specifies the maximum number of faces in a voxel after voxel subdivision.

Optimize for instancing – When enabled, each mesh object occupies a whole voxel.

Create Multi/Sub-Object Mtl – This option is available when multiple objects with different materials are exported. When enabled, V-Ray assigns a Multi/Sub-Object material to the created proxy and the sub-materials are assigned to the appropriate faces automatically.

Condense Multi Mtl – When enabled, V-Ray makes sure that only unique materials are exported.

Pressing the OK button creates the vrmesh file (and a VRayProxy object if the Automatically create proxies option is enabled). The export process may take some time depending on the amount of geometry that must be processed.

 

 


 

Example: Lowest Level Point Size Parameter


This example demonstrates the effect of the Lowest level point size parameter. Smaller values mean that more point cloud disks with smaller radii are used to approximate the original mesh geometry at the lowest level (the level rendered closest to camera). Increasing this size makes the approximation rougher, with a smaller number of disks that are larger in size. While rendering, it is not possible to achieve better detail than the one at the lowest level.

 

 

  
Lowest level point size
 = 2.0

 
Lowest level point size
 = 4.0

 
Lowest level point size
 = 8.0

 
Lowest level point size
 = 16.0

 
Lowest level point size
 = 24.0

 


Other Ways to export a Mesh


VRayProxy files can be exported from Mudbox using a Mudbox plugin that is available on the Misc Tools page. This reads the subdivision levels as they are in a Mudbox scene and after exporting as a VRayProxy to be loaded with the corresponding faces. In that way, level 0 of the Mudbox sculpt would be the lowest level. Also of note is that LOD scale works just for vrmeshes exported from Mudbox using the Mudbox to VRayProxy plugin, and sets the maximum number of pixels an edge can span over before it is subdivided. In this way, you can control the loaded vrmesh level for rendering.

 

 

Notes


  • You can convert .ply and .obj files to .vrmesh files with the help of the ply2vrmesh converter tool.
  • The V-Ray SDK has methods for reading and writing of .vrmesh files.