Render

Description

Supported Script Types:

  • Interface Scripts
  • Client Entity Scripts
  • Avatar Scripts
The Render API enables you to configure the graphics engine.

Properties

Name Type Summary
renderMethod Render.RenderMethod

The render method being used.

shadowsEnabled boolean

true if shadows are enabled, false if they're disabled.

ambientOcclusionEnabled boolean

true if ambient occlusion is enabled, false if it's disabled.

antialiasingMethod Render.AntialiasingMethod

The anti-aliasing method being used.

viewportResolutionScale number

The view port resolution scale, > 0.0.

nametagsEnabled boolean

true if nametags are enabled, false if they're disabled.

maximumTextureMemory number

The maximum texture memory in MB.

Methods

Name Return Value Summary
getAmbientOcclusionEnabled boolean

Gets whether or not ambient occlusion is enabled.

getAntialiasingMethod Render.AntialiasingMethod

Gets the anti-aliasing method being used.

getAntialiasingMethodNames Array.<string>

Gets the names of the possible anti-aliasing methods, per Render.AntialiasingMethod.

getConfig object

Gets the configuration for a rendering job by name.

Warning: For internal, debugging purposes. Subject to change.

getMaximumTextureMemory number

Gets the maxmium texture memory in MB.

getNametagsEnabled boolean

Gets whether nametags are enabled.

getRenderMethod Render.RenderMethod

Gets the render method being used.

getRenderMethodNames Array.<string>

Gets the names of the possible render methods, per Render.RenderMethod.

getShadowsEnabled boolean

Gets whether or not shadows are enabled.

getViewportResolutionScale number

Gets the view port resolution scale.

setAmbientOcclusionEnabled None

Sets whether or not ambient occlusion is enabled.

setAntialiasingMethod None

Sets the anti-aliasing method to use.

setMaximumTextureMemory None

Sets the maxmium texture memory in MB.

setNametagsEnabled None

Sets whether nametags are enabled.

setRenderMethod None

Sets the render method to use.

setShadowsEnabled None

Sets whether or not shadows are enabled.

setViewportResolutionScale None

Sets the view port resolution scale.

Signals

Name Summary
settingsChanged

Triggered when one of the Render API's properties changes.

Type Definitions

AntialiasingMethod
Type: number

The anti-aliasing method is specified by the following values:

Value Name Description
0 NONE
1 TAA
2 FXAA
RenderMethod
Type: number

The rendering method is specified by the following values:

Value Name Description
0 DEFERRED More complex rendering pipeline where lighting is applied to the scene as a whole after all objects have been rendered.
1 FORWARD Simpler rendering pipeline where each object in the scene, in turn, is rendered and has lighting applied.

Method Details

(static) getAmbientOcclusionEnabled( ) → {boolean}
Returns: true if ambient occlusion is enabled, false if it's disabled.

Gets whether or not ambient occlusion is enabled.

(static) getAntialiasingMethod( ) → {Render.AntialiasingMethod}
Returns: The anti-aliasing method being used.

Gets the anti-aliasing method being used.

Example

Report the current anti-aliasing method.

var antialiasingMethod = Render.getAntialiasingMethod();
print("Current render method: " + Render.getAntialiasingMethodNames()[antialiasingMethod]);
(static) getAntialiasingMethodNames( ) → {Array.<string>}
Returns: The names of the possible anti-aliasing methods.

Gets the names of the possible anti-aliasing methods, per Render.AntialiasingMethod.

Example

Report the names of the possible anti-aliasing methods.

var antialiasingMethods = Render.getAntialiasingMethodNames();
print("Anti-aliasing methods:");
for (var i = 0; i < antialiasingMethods.length; i++) {
    print("- " + antialiasingMethods[i]);
}
(static) getConfig( name ) → {object}
Returns: The configuration for the rendering job.

Gets the configuration for a rendering job by name.

Warning: For internal, debugging purposes. Subject to change.

Parameters

Name Type Description
name string

The name of the rendering job.

(static) getMaximumTextureMemory( ) → {number}
Returns: number

Gets the maxmium texture memory in MB.

(static) getNametagsEnabled( ) → {boolean}
Returns: true if nametags are enabled, false if they're disabled.

Gets whether nametags are enabled.

(static) getRenderMethod( ) → {Render.RenderMethod}
Returns: The render method being used.

Gets the render method being used.

Example

Report the current render method.

var renderMethod = Render.getRenderMethod();
print("Current render method: " + Render.getRenderMethodNames()[renderMethod]);
(static) getRenderMethodNames( ) → {Array.<string>}
Returns: The names of the possible render methods.

Gets the names of the possible render methods, per Render.RenderMethod.

Example

Report the names of the possible render methods.

var renderMethods = Render.getRenderMethodNames();
print("Render methods:");
for (var i = 0; i < renderMethods.length; i++) {
    print("- " + renderMethods[i]);
}
(static) getShadowsEnabled( ) → {boolean}
Returns: true if shadows are enabled, false if they're disabled.

Gets whether or not shadows are enabled.

(static) getViewportResolutionScale( ) → {number}
Returns: The view port resolution scale, > 0.0.

Gets the view port resolution scale.

(static) setAmbientOcclusionEnabled( enabled )

Sets whether or not ambient occlusion is enabled.

Parameters

Name Type Description
enabled boolean

true to enable ambient occlusion, false to disable.

(static) setAntialiasingMethod( antialiasingMethod )

Sets the anti-aliasing method to use.

Parameters

Name Type Description
antialiasingMethod Render.AntialiasingMethod

The anti-aliasing method to use.

(static) setMaximumTextureMemory( maximumTextureMemory )

Sets the maxmium texture memory in MB.

Parameters

Name Type Description
maximumTextureMemory number
(static) setNametagsEnabled( enabled )

Sets whether nametags are enabled.

Parameters

Name Type Description
enabled boolean

true if nametags are enabled, false if they're disabled.

(static) setRenderMethod( renderMethod )

Sets the render method to use.

Parameters

Name Type Description
renderMethod Render.RenderMethod

The render method to use.

(static) setShadowsEnabled( enabled )

Sets whether or not shadows are enabled.

Parameters

Name Type Description
enabled boolean

true to enable shadows, false to disable.

(static) setViewportResolutionScale( resolutionScale )

Sets the view port resolution scale.

Parameters

Name Type Description
resolutionScale number

The view port resolution scale to set, > 0.0.

Signal Details

settingsChanged( )
Returns: Signal

Triggered when one of the Render API's properties changes.

Example

Report when a render setting changes.

Render.settingsChanged.connect(function () {
    print("Render setting changed");
});
// Toggle Developer > Render > Shadows or similar to trigger.