sekme-99
whitesmoke
600
#dd3333
# 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()
// 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();
// 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();
}
// 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();
});
});
});