3. VRay Asset Export
Last updated
Last updated
There are several different ways to export the scene assets, and the choice of process depends on the desired configuration setup on ThreeKit.
An entire scene can be exported to ThreeKit, through a vrscene export, and ThreeKit will expose the contents in terms of mesh nodes and lights, along with the exposed attributes named with the TK_ prefix. Vray scene files can be imported into ThreeKit in three different ways:
As a scene, which also extracts the camera as a ThreeKit camera in the scene, along with a vrscene node that contains the contents of the scene.
As a model asset, which extracts everything into a model asset, except for the camera.
As materials only - which extracts each material found in the vrscene as a separate Vray material asset.
To export a vrscene version of the current scene, the user must switch the render output settings from just “Render” to “Export to a vrscene file”, then hit the Render button to trigger the export.
Here is an example from the Maya UI:
Please note that the Strip Paths checkbox is set to ON. This is important, because then all of the texture links inside the vrscene will be saved as just the file name, without the full local path. This will enable ThreeKit to find those textures in the same folder as the vrscene.
The subsequent checkboxes under that, for writing the data in hex format will just help to keep the file size smaller, particularly in the case where there is a lot of geometry being included.
Each vrscene export will only include the camera used to trigger the “render”. A vrscene export is essentially a text file that describes a single image render.
When the vrscene is imported as a scene asset, the ThreeKit import process will generate a scene asset which will also include a camera with the same settings as the ones found inside the vrscene file. If the Vray camera was using a Physical Camera operator on it, those settings will also be exposed on ThreeKit as well.
If you wish to export multiple cameras that require a Vray Physical Camera, then you will need to perform a separate vrscene export from each camera individually, then zip up all these vrscenes together into a single zip file with the extension rename from .zip to .vrscenezip.
Then, you can import the vrscenezip file into the platform as a scene asset, which will extract all the cameras into separate camera objects.
In a typical configuration, where a set of different products need to be swapped and rendered with the same scene, we would want to export the scene backdrop along with the lights as a vrscene by itself, separate from the product geometry.
For this purpose just make sure you hide all product geometry in the scene, leaving only the backdrop geometry and the lights visible. You can choose to export this from the render camera if importing it as a scene directly, or just from a random camera if you plan to use this as a model asset on its own.
The advantage to importing the scene elements as a model asset instead of a scene is because it makes it easier to swap and update the lights asset without breaking anything in the scene asset itself. The scene lights asset can be dragged and dropped into a scene, and it can be swapped there through rules as needed. This makes the setup more flexible.
The light linking will then be configured directly on ThreeKit.
The product geometry can be exported separately on its own as a vrscene file, or as FBX files. There are advantages and disadvantages to each option.
Vrscene advantages:
The export can include special geometry and nodes such as Fur.
Shader networks can be connected into model properties, such as Displacement
A single export to include both the geometry and material assignment, instead of dealing with multiple files when swapping of materials is not needed.
Dense geometry will be displayed as a bounding box only on ThreeKit, which loads much faster in the browser.
Vrscene disadvantages:
The mesh shape can only be previewed as a bounding box currently, making them unsuitable for dual use as both Webgl and Vray configuration.
The user would not currently be able to apply Polymesh operators on ThreeKit to these Vray mesh nodes.
FBX advantages:
The meshes can be used for all kinds of configuration - Webgl, Vray renders, as well as AR exports
All polymesh and material operators are applicable to them.
FBX disadvantages:
The more detailed meshes can take a long time to load into the browser window when using the asset editors.
Doperties.
Requires separate exports for the Vray materials. Does not allow the export of special nodes like Fur, or shader networks connected to mesh properties like Displacement.
In order to import each Vray material to the platform as a separate standalone asset, the materials can be simply applied to a box inside your 3D application, without any other assets visible, and rendered to a vrscene that way. That vrscene can then be imported into ThreeKit with the Material option, which will extract all the Vray materials in the scene to separate material assets on ThreeKit.
This approach is not strictly required. The vrscenes can contain any geometry and lights, and the import process as Materials will still extract only the material themselves, ignoring the rest of the data. The reason the user may prefer to apply the materials to individual boxes, is to keep the file size as low as possible for the import process.
One very important thing to consider when exporting materials in this fashion is to maintain the UV channel assignments. If some of the textures in the shader network are meant to be applied to the second, or third, etc. UV channel, then the box should also have those channels available, and the textures need to be linked to those channels before export.
When exporting materials or vrscenes in general, textures are often required in the process. The vrscene files do not embed the texture data directly. Instead, these files contain the path to the file, with the file name. When the file nodes specified in the export are not named with a TK_ prefix for exposure on ThreeKit, then the texture files should be included with the vrscene file itself for upload.
This can be done by zipping together the vrscene file along with the necessary textures, into a ZIP file. The extension of this ZIP file will then need to be changed to .vrscenezip. The ThreeKit platform will automatically recognize this as a vrscene import that contains multiple files.
Example vrscenezip file:
This approach is only necessary in the scenario where the user does not desired to upload these textures separately to ThreeKit, and link them to TK_xxx attributes on the uploaded vrscenes.
In this case listed above, if these textures are instead uploaded to ThreeKit separately, then there is no need for the vrscenezip file. Dragging and dropping the .vrscene file will be sufficient.
There may be instances where you may wish to have multiple vrscenes imported together into one single asset, instead of separate assets. At this time, the only reason for this would be to minimize the number separate assets on the platform.
In order to do this, all the necessary vrscenes would need to be packaged together into a single ZIP file, with the extension set to .vrscene zip.
Here is an example of such a zip file:
Uploading this vrscenezip file to ThreeKit will create a single asset with the name SceneBundle.
Inside that asset you will find the two separate vrscene nodes, as shown here:
Last, but not least, the Vray Framebuffer color correction settings can also be exported by Vray, and imported to ThreeKit. This needs to be done by choosing to save these corrections directly from the Vray Framebuffer as a single file.
The Vray 4 framebuffer will export these as a .vccglb file, while the Vray 5 and 6 framebuffer will export these as a .vfbl file. The ThreeKit platform currently supports only the Vray4 .vccglb files, which can be applied to any Vray renders.
This screenshot shows all the corrections supported by ThreeKit through these .vccglb files. To save the vccglb file you have to click on the “Globals” button in the Vray4 Framebuffer UI.
ThreeKit will correctly render the Exposure, White Balance, Hue/Saturation, Color Balance, Levels, Curve, and Background Image settings. The others shown there - LUT, OCIO, and ICC profiles are not currently supported by ThreeKit.
In order for the Background Image feature to export correctly, the path in the image slot needs to include only the image filename, without any local path. While the local path is required for local renders on the user’s machine, they will interfere with the functioning of the ThreeKit platform. When the user is ready to export the vccglb file, simply edit the path out from the text box, leaving only the file name.
The image will also need to be included together with the .vccglb file. This can be done by zipping together the two files into a ZIP file, and then renaming the extension from .zip to .vccglbzip.