---
title: "Using Vantage via App SDK"
canonical: "https://documentation.chaos.com/space/APPSDK/132808915/Using%20Vantage%20via%20App%20SDK"
format: markdown
---
## 0. Who this is for

These guidelines are for users of the App SDK who want to use it render a scene with Chaos Vantage. We will not discuss details on how to write code with the App SDK here - there are separate docs and examples for this included in the SDK package. Rather we will cover how you can add a few lines into existing code to be able to renderer the scene using Chaos Vantage.

Note: This document will be updated and extended over time.


## 1. How to set up a Live link

### 1.1. The steps

Here are the few simple steps how to set up a Live link between App SDK and Vantage:

1. Make sure you meet the [system requirements for Vantage](https://www.chaos.com/vantage#technical-requirements).
2. Make sure you use the latest version of [App SDK](https://www.chaos.com/vray/application-sdk).
3. Start Vantage and leave it in idle.
4. Set up the code for [Distributed Rendering](https://docs-chaos.atlassian.net/wiki/spaces/APPSDK/pages/132678866). In short the steps are:
  1. **Disable the VFB globally** because Vantage doesn't send back images to VFB and its window would remain black.
  2. Create an instance of `VRayRenderer`.
  3. **Set the **`inProcess`** flag** (variations in naming in the different language bindings) to exclude the local machine from rendering. This prevents V-Ray from rendering and thus allowing Vantage to use all resources.
  4. Explicitly **enable DR**.
  5. Load the scene.
  6. Add the remote host for distributed rendering (localhost or the IP of the computer where Vantage is running) with **port 20701**. If the port number is omitted it defaults to 20207.
  7. Start rendering in interactive mode.
5. Make changes and Vantage will update accordingly.

To see if Vantage has established a successful live link, check if the label in the lower right corner of the viewport displays <span style="color: #000000">**[LIVE LINK]**</span><span style="color: #000000">:</span>

![image](media://4d067d42-5758-4eb1-9563-34cb33e2c01b)

### 1.2. Code examples

Here is some sample code with our basic interactive example included in the SDK package rewritten using the steps described above. You can also view our new example added in the interactive examples included in the SDK package:


<details>
<summary>Python</summary>

```python
# Import vray module and set the SCENE_PATH environment variable.
# ...
 
# Disable the VFB globally because Vantage doesn't send back images to VFB and its window would remain black.
# If we only set the RenderOptions flag enableFrameBuffer to be False it will hide the VFB
# but the libs associated with it will be loaded anyway.
vray.enableFrameBuffer(False)
 
# Create an instance of VRayRenderer with default options.
# The renderer is automatically closed after the `with` block.
with vray.VRayRenderer() as renderer:
	# Set the inProcess flag to exclude the local machine from rendering.
    # This prevents V-Ray from rendering and thus allowing Vantage to use all resources.
    renderer.inProcess = False
 
    # Register a simple log callback. Always useful for debugging.
    # ...

	# We have to explicitly enable DR first.
    renderer.setDREnabled(True)

    # Load scene from a file.
    renderer.load(os.path.join(SCENE_PATH, 'intro.vrscene'))

    # Add remote host for distributed rendering.
    # If port is omitted it defaults to 20207.
    # NOTE: Replace this address with the address of a host running
    # Vantage.
    renderer.addHosts('127.0.0.1:20701')

    # Start rendering.
    renderer.startSync()

    # Wait for rendering to end.
    renderer.waitForRenderEnd()
```
</details>


<details>
<summary>C++</summary>

```python
// Include VRay headers and set the SCENE_PATH environment variable.
// ...
 
// Load V-Ray SDK library.
// The directory containing the vray shared object should be present in
// the PATH environment variable.
// Disable the VFB globally because Vantage doesn't send back images to VFB and its window would remain black.
// If we only set the RendererOptions flag enableFrameBuffer to be false it will hide the VFB
// but the libs associated with it will be loaded anyway.
VRayInit init(NULL, false);
 
// Create an instance of VRayRenderer with default options.
// The renderer is automatically closed at the end of the current scope.
VRayRenderer renderer;
 
// Set the inProcess flag to exclude the local machine from rendering.
// This prevents V-Ray from rendering and thus allowing Vantage to use all resources.
renderer.inProcess = false;
 
// It's recommended to always have a console log
renderer.setOnLogMessage(logMessage);
 
// We have to explicitly enable DR first.
renderer.setDREnabled(true);
 
// Load scene from a file.
renderer.load("intro.vrscene");
 
// Add remote host for distributed rendering.
// If port is omitted it defaults to 20207.
// NOTE: Replace this address with the address of a host running
// Vantage.
renderer.addHosts("127.0.0.1:20701");
 
// Start rendering.
renderer.startSync();
 
// Wait for rendering to end.
renderer.waitForRenderEnd();
```
</details>


<details>
<summary>C#.Net</summary>

```python
// Use VRay related namespaces and set the SCENE_PATH environment variable.
// ...
 
// Disable the VFB globally because Vantage doesn't send back images to VFB and its window would remain black.
// If we only set the RendererOptions flag IsFrameBufferEnabled to be false it will hide the VFB
// but the libs associated with it will be loaded anyway.
VFB.Enable(false);

// Create an instance of VRayRenderer with default options.
// The renderer is automatically closed after the `using` block.
using (VRayRenderer renderer = new VRayRenderer())
{
	// Set the InProcess flag to exclude the local machine from rendering.
    // This prevents V-Ray from rendering and thus allowing Vantage to use all resources.
    renderer.InProcess = false;

	// Add a listener for any type of log message.
	// ...

	// We have to explicitly enable DR first.
	renderer.SetDREnabled(true);

	// Load scene from a file.
    renderer.Load("intro.vrscene");

	// Add remote host for distributed rendering.
    // If port is omitted it defaults to 20207.
    // NOTE: Replace this address with the address of a host running
    // Vantage.
    renderer.AddHosts("127.0.0.1:20701");

    // Start rendering.
    renderer.StartSync();

    // Wait for rendering to end.
    renderer.WaitForRenderEnd();
}
```
</details>


<details>
<summary>Node.js</summary>

```python
// Import vray module and set the SCENE_PATH environment variable.
// ...
 
// Disable the VFB globally because Vantage doesn't send back images to VFB and its window would remain black.
// If we only set the RendererOptions flag enableFrameBuffer to be false it will hide the VFB
// but the libs associated with it will be loaded anyway.
vray.enableFrameBuffer(false);
 
// Create an instance of VRayRenderer with default options.
var renderer = vray.VRayRenderer();

// Set the inProcess flag to exclude the local machine from rendering.
// This prevents V-Ray from rendering and thus allowing Vantage to use all resources.
renderer.inProcess = false;

// It's recommended to always have a console log callback.
// ...

// We have to explicitly enable DR first.
renderer.setDREnabled(true);

// Load scene from a file asynchronously.
renderer.load('intro.vrscene', function(err) {
    if (err) {
        // Scene was not loaded.
        throw err;
    }

    // Add remote host for distributed rendering.
    // If port is omitted it defaults to 20207.
    // NOTE: Replace this address with the address of a host running
    // Vantage.
    renderer.addHosts('127.0.0.1:20701');

    // Start rendering.
    renderer.start(function(err) {
        if (err) {
            // Couldn't start rendering.
            throw err;
        }

        // Wait for rendering to end.
        renderer.waitForRenderEnd(function() {

            // Closes the renderer.
            // The renderer object is unusable after closing since its resources
            // are freed. It should be released for garbage collection.
            renderer.close();
        });
    });
});

```
</details>