allow_indicator_icons
$draw.allow_indicator_icons() -> boolIf true, performance indicator icons can be drawn on the HUD.
Returns bool: Indicator icon allowed state.
Draw sprites, text and shapes on screen.
154 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).
$draw.allow_indicator_icons() -> boolIf true, performance indicator icons can be drawn on the HUD.
Returns bool: Indicator icon allowed state.
$draw.antialiasing_mode(cmdlist: Reference, mode: int)Sets the anti aliasing mode
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
mode | int | Mode index |
$draw.area_rect_light(transform: Component, color: vec3, temperature: float, intensity: float, bounding_radius: float, outer_angle: float, inner_angle: float, width: float, height: float, force_fallback: bool, camera_mask: int, scene: Component, clip_volume: Component, fallback_start_distance: float, fallback_fade_range: float, cast_shadows: bool, dynamic_shadows: bool, shadow_cone_angles: vec2)Draws a rectangle area light.
| Parameter | Type | Meaning |
|---|---|---|
transform | Component | Reference a transform component that positions the light. |
color | vec3 | The light's color. |
temperature | float | Color temperature |
intensity | float | The light's intensity. |
bounding_radius | float | The bounding radius of the light. |
outer_angle | float | The outer angle of the spot falloff, in degrees. |
inner_angle | float | The inner angle of the spot falloff, in degrees. |
width | float | The width of the light rectangle. |
height | float | The height of the light rectangle. |
force_fallback | bool | If true, forces the light to use a fallback spot light approximation instead of the full area light. |
camera_mask | int | Which (split-screen) cameras should draw this light. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
clip_volume | Component | (Optional) Reference to transform component that will be used as a clipping volume for the light. |
fallback_start_distance | float | The start distance of the spotlight fallback crossfade. |
fallback_fade_range | float | The distance over which the fallback crossfade happens. |
cast_shadows | bool | Does this light cast shadows? |
dynamic_shadows | bool | Enable dynamic shadow casting for this light. |
shadow_cone_angles | vec2 | Inner (x) and outer (y) cone angles for shadow cone. |
$draw.box(center: vec3, rotation: vec4, half_extents: vec3, color: var, lifetime: float)Draw a wireframe box.
| Parameter | Type | Meaning |
|---|---|---|
center | vec3 | The center of the box. |
rotation | vec4 | The rotation. |
half_extents | vec3 | The half-extents of the box. |
color | var | The line color (vec3 or vec4). |
lifetime | float | The time in seconds for which the box should persist. Zero means a single frame. |
$draw.calc_text_bounds(text: var, font: Reference, font_size: float, width: float, args: list, force_uppercase: bool, allow_word_break: bool) -> vec2Calculate the rendered size of a text string.
| Parameter | Type | Meaning |
|---|---|---|
text | var | The text to calculate for. |
font | Reference | Font to use. |
font_size | float | Pt size for font. |
width | float | Pixel width to word wrap on. |
args | list | List of values to insert into the message. |
force_uppercase | bool | Whether to force uppercase. |
allow_word_break | bool | Whether to allow long words to be cut when word is wider than wrap width |
Returns vec2: vec2 containing width and height of text.
$draw.catch_closing_ring(cmdlist: Reference, position: vec2, radius: float, opacity: float)Catch specific. Draws tint effect based on inside or outside of closing ring
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
position | vec2 | The center of closing ring, ignoring height |
radius | float | The radius of closing ring. |
opacity | float | The opacity of closing ring. Disabled if 0.0 |
$draw.catch_holowood_lighting_override(cmdlist: Reference, color: vec3, temperature: float, direction: vec3, intensity: float, recolor_target: vec3, recolor_alpha: float)Catch specific. Override the sun light for holowood vignettes.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
color | vec3 | The light's color. |
temperature | float | Color temperature |
direction | vec3 | The direction of the sun light. |
intensity | float | The light's intensity. |
recolor_target | vec3 | The target color to recolor to |
recolor_alpha | float | 0 to 1 value of how much vignettes should be recolored. |
$draw.catch_holowood_settings(cmdlist: Reference, vignette_appear_effect_strength: float, vignette_disappear_effect_strength: float, vignette_disappear_progress: float)Catch specific. Controls special visual effects for holowood map
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
vignette_appear_effect_strength | float | The intensity of vignette appearing effect |
vignette_disappear_effect_strength | float | The intensity of vignette disappearing effect. |
vignette_disappear_progress | float | How much the vignette has disappeared. 1.0 means fully disappear. |
$draw.character_light(cmdlist: Reference, color: vec3, direction: vec3, temperature: float, intensity: float, shadow_scale: float, rim_light_scale: float, hair_aniso_glow_scale: float)Draws character light
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
color | vec3 | Character Light Color. |
direction | vec3 | Character Light Direction |
temperature | float | Character Light Temperature |
intensity | float | Character Light Intensity |
shadow_scale | float | Character Shadow Scale |
rim_light_scale | float | Character rim light scale. |
hair_aniso_glow_scale | float | Character hair aniso glow scale. |
$draw.cmdlist_begin(priority: int) -> ReferenceOpen a generic cmdlist. Prefer drawcall3d or drawcall2d for 3d and 2d draws. @see drawcall3d_begin @see drawcall2d_begin
| Parameter | Type | Meaning |
|---|---|---|
priority | int | (optional, default 0) Priority; higher overrides lower. Only recognized by some systems like presentation_adjustments. |
Returns Reference: Cmdlist handle.
$draw.cmdlist_end(cmdlist: Reference)Close a generic cmdlist. @see cmdlist_begin
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
$draw.contact_shadow_settings(cmdlist: Reference, step_count: int, max_trace_distance: float, penumbra_sharpness: float, distance_fade_start: float, distance_fade_range: float)Sets the contact shadow settings
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
step_count | int | Number of ray steps to take; rounded up to nearest 4. 0 to disable. |
max_trace_distance | float | Max trace distance in centimeters |
penumbra_sharpness | float | Penumbra sharpness, 1.0 (softest) and above. |
distance_fade_start | float | Begin to fade out contact shadows at this distance from camera (cm) |
distance_fade_range | float | Fade out over this distance; all contact shadows disappear at distance_fade_start + distance_fade_range (cm) |
$draw.cross(pos: vec3, color: var, size: float, lifetime: float, draw_on_top: bool)Draw a cross of a specified size at the specified point.
| Parameter | Type | Meaning |
|---|---|---|
pos | vec3 | The center point. |
color | var | The line color (vec3 or vec4). |
size | float | Length of the cross lines. |
lifetime | float | The time in seconds for which the line should persist. Zero means a single frame. |
draw_on_top | bool | If the line should be drawn on top |
$draw.decal(transform: Component, type: int, priority: int, color: vec4, flags: int, channels: int, blend_radius_range: vec2, normal_cutoff: float, start_fade_percent: float, cull_percent: float, uv_panning_velocity: vec2, atlas: Reference, atlas_key: string, camera_mask: int)Draws a decal.
| Parameter | Type | Meaning |
|---|---|---|
transform | Component | Reference a transform component that positions the decal. |
type | int | The decal type, see vrender_decal_type_e. |
priority | int | Draw order, 0..255; higher = on top. |
color | vec4 | The decal's tint and opacity. Tint may not apply for some decal types. |
flags | int | Decal flags. Not all flags apply for all decal types. See _vrender_decal_flags_t. |
channels | int | Decal channels. Controls surfaces that the decal can be projected on. |
blend_radius_range | vec2 | The distance from the center of the radius at which edge fade starts (x) and ends (y), 0..sqrt(2); larger start numbers effectively disable blend. End should be greater than start to be meaningful. |
normal_cutoff | float | How much of an angle between the decal box and surface before projection is suppressed. 1..-1, usually something like -0.70 to cutoff at 45 degrees. |
start_fade_percent | float | The percent of the screen covered where a light should start fading. |
cull_percent | float | The percent of the screen covered at which the light should be culled. |
uv_panning_velocity | vec2 | Panning velocity of texture coordinate |
atlas | Reference | Atlas. |
atlas_key | string | Atlas key, identifying which texture to use in the atlas. |
camera_mask | int | Which (split-screen) cameras should draw this decal. |
$draw.directional_light(color: vec3, temperature: float, intensity: float, fade_fraction: float, start_fade_percent: float, cull_percent: float, camera_mask: int, scene: Component, clip_volume: Component)Draws a bounded directional light.
| Parameter | Type | Meaning |
|---|---|---|
color | vec3 | The light's color. |
temperature | float | Color temperature |
intensity | float | The light's intensity. |
fade_fraction | float | The fraction of the bounding box to fade, from the edge. |
start_fade_percent | float | The percent of the screen covered where a light should start fading. |
cull_percent | float | The percent of the screen covered at which the light should be culled. |
camera_mask | int | Which (split-screen) cameras should draw this light. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
clip_volume | Component | (Optional) Reference to transform component that will be used as a clipping volume for the light. |
$draw.dissolve_capsule(position: vec3, rotation: vec4, channels: int, invert: bool, length: float, radius: float)Dissolves a capsule from geometry
| Parameter | Type | Meaning |
|---|---|---|
position | vec3 | Position of the center of the capsule. |
rotation | vec4 | Rotation of the capsule. |
channels | int | Dissolve channels. Controls surfaces that the volume can dissolve. |
invert | bool | If the shape should be inverted or not. |
length | float | The length of the capsule. |
radius | float | The radius of the capsule |
$draw.drawcall2d_begin(texture: Reference, sampler: Reference, sort: var, render_pass_name: string) -> ReferenceInitialize a draw command for a sprite.
| Parameter | Type | Meaning |
|---|---|---|
texture | Reference | Reference to a texture to draw. |
sampler | Reference | Optional reference to a sampler to use for the texture. |
sort | var | Sort value to use. |
render_pass_name | string | Render pass name (optional); if set, use the first render target instead of texture. |
Returns Reference: Draw call handle.
$draw.drawcall2d_color(drawcall: Reference, value: vec4)Set the primary color of the sprite verts.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
value | vec4 | The value of the color. |
$draw.drawcall2d_color_overlay(drawcall: Reference, value: vec4)Set the overlay color of a sprite draw
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
value | vec4 | The value of the color. |
$draw.drawcall2d_mask(drawcall: Reference, texture: Reference, sampler: Reference, box_x: vec2, box_y: vec2, box_pos: vec2, opacity: float, uv_scale: vec2, uv_offset: vec2, world_locator: Component)Set the sprite mask texture and projection.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
texture | Reference | The mask texture. |
sampler | Reference | Optional sampler to use for the mask texture. |
box_x | vec2 | The X-axis basis of the mask box projection. |
box_y | vec2 | The Y-axis basis of the mask box projection. |
box_pos | vec2 | The position of the center of the box projection. |
opacity | float | The influence of this mask on sprites (1: full influence, 0: no influence). |
uv_scale | vec2 | The scale applied to the mask texture UVs. |
uv_offset | vec2 | The offset applied ot the mask texture UVs. |
world_locator | Component | reference to a ui_world_locator.vscript component to attach world position to |
$draw.drawcall2d_material_begin(drawcall: Reference) -> ReferenceInstantiate a material for the drawcall2d in the specified draw command. Cannot change material settings for the base material after the call. Note need to use the return value to feed into material attribute function's drawcall input.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. |
Returns Reference: Material draw call handle.
$draw.drawcall2d_material_end(drawcall: Reference)Finish a drawcall2d material instance specification.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
$draw.drawcall2d_material_override(drawcall: Reference, material: Reference)Specify a different material instance for sprite rendering.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
material | Reference | Material instance to draw the sprite with. |
$draw.drawcall2d_mouse_cursor(drawcall: Reference)Mark this sprite as a mouse cursor. It will be given an updated position at draw time, such that the top left corner of the quad matches the latest mouse position.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
$draw.drawcall2d_position(drawcall: Reference, ul: vec2, ur: vec2, ll: vec2, lr: vec2)Set the four corners of the sprite draw.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
ul | vec2 | Upper Left Coord. |
ur | vec2 | Upper Right Coord. |
ll | vec2 | Lower Left Coord. |
lr | vec2 | Lower Right Coord. |
$draw.drawcall2d_scissor(drawcall: Reference, ul: vec2, lr: vec2)Define screen bounds to scissor this sprite.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
ul | vec2 | Upper Left Scissor Box Coord. |
lr | vec2 | Lower Right Scissor Box Coord. |
$draw.drawcall2d_set_additive(drawcall: Reference, value: bool)Set the additive blend mode property of this sprite.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
value | bool | True or false for additive setting. |
$draw.drawcall2d_set_dissolve(drawcall: Reference, dissolve: bool)Set the vui dissolve value.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
dissolve | bool | True or false for dissolve setting. |
$draw.drawcall2d_uvs(drawcall: Reference, ul: vec2, ur: vec2, ll: vec2, lr: vec2)Override the UV coords for the four corners of the sprite.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
ul | vec2 | Upper Left UV |
ur | vec2 | Upper Right UV |
ll | vec2 | Lower Left UV |
lr | vec2 | Lower Right UV |
$draw.drawcall2d_world_locator(drawcall: Reference, world_locator: Component)Attach the drawcall2d to a location in 3d world defined by a ui_world_locator component
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
world_locator | Component | reference to a ui_world_locator.vscript component to attach world position to |
$draw.drawcall3d_animation(drawcall: Reference, model: Reference, entity: Entity, bones_bindings: list, allowed_error: float)Sample the blended animation from the input animation lists, and set the bone transformation matrices for draw command
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
model | Reference | Model on which to animate. |
entity | Entity | The entity to retrive pose from, also used for combining skeletons for animation. Must be the same entity as input from animation.set_model_pose. |
bones_bindings | list | List of physics bones bindings |
allowed_error | float | Allowed world unit error when posing skeleton. Higher values allow faster processing |
$draw.drawcall3d_begin(model: Reference, cmd_list_index: int, model_type: int, use_local_transform: bool, local_position: vec3, local_rotation: vec4, local_scale: vec3, interpolation_id: int) -> ReferenceOpen a draw command with the specified model. It will use transform component from calling entity, plus optional local transform.
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model to draw. |
cmd_list_index | int | Optional offset for additional command lists. |
model_type | int | The model type. |
use_local_transform | bool | Whether to add local transform |
local_position | vec3 | Local position. |
local_rotation | vec4 | Local rotation. |
local_scale | vec3 | Local scale. |
interpolation_id | int | The interpolation id. If this is changed during two command lists, out won't try to interpolate them. |
Returns Reference: Draw call handle.
$draw.drawcall3d_bounds(model: Reference, position: vec3, scale: vec3, color: vec3)Draw bounding sphere of the specified model.
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model to draw bounds of. |
position | vec3 | The sphere position. |
scale | vec3 | The sphere scale. |
color | vec3 | The line color. |
$draw.drawcall3d_camera_mask(drawcall: Reference, mask: int)Specify a mask indicating the camera indices where the model should draw.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
mask | int | The mask. For example, a mask of 101 means the first and third split-screen cameras should draw this model. |
$draw.drawcall3d_cast_shadow(drawcall: Reference, cast_shadow: bool, cast_local_shadow: bool)Specify whether to enable or disable a model's shadow casting. If not called, default to enabled.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
cast_shadow | bool | Whether to enable model to cast sun shadow. |
cast_local_shadow | bool | Whether to enable model to cast local light shadow. |
$draw.drawcall3d_decal_mask(drawcall: Reference, decal_mask: int)Specify which decal channels can cast on this model with a mask.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
decal_mask | int | The decal mask. |
$draw.drawcall3d_disable_draw_on_top(drawcall: Reference, slot: int, material: Reference)Open a material in the specified draw command on a specified slot and make it not drawn on top
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
slot | int | The model material slot. |
material | Reference | The material to apply. |
$draw.drawcall3d_enable_draw_on_top(drawcall: Reference, slot: int, material: Reference)Open a material in the specified draw command on a specified slot and make it drawn on top
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
slot | int | The model material slot. |
material | Reference | The material to apply. |
$draw.drawcall3d_end(drawcall: Reference)Close a draw command list.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
$draw.drawcall3d_marker(drawcall: Reference, marker: int)Specify a marker which this model is drawn relative to.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
marker | int | Marker ID. |
$draw.drawcall3d_material(drawcall: Reference, slot: int, material: Reference)Open a material in the specified draw command on a specified slot. Note that all the following material attributes will change this material instead until next drawcall3d_material.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
slot | int | The model material slot. Override all slots if -1 |
material | Reference | The material to apply. |
$draw.drawcall3d_material_all_outline_draws(drawcall: Reference, material: Reference, model: Reference, invert: bool)Open a draw command on all of materials that can draw outline, and override with outline material.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
material | Reference | The material to apply. |
model | Reference | The model ref we are drawing |
invert | bool | If true, open command for all non-outline materials |
$draw.drawcall3d_material_multi(drawcall: Reference, mask: int, material: Reference)Open a material in the specified draw command on a mask for multiple material slots. Note that all the following material attributes will change this material instead until next drawcall3d_material.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
mask | int | The mask indicating which materials to override |
material | Reference | The material to apply. |
$draw.drawcall3d_model_bounds(drawcall: Reference, model: Reference, position: vec3, radius: float, draw_bounds: bool)Set bounding sphere of the specified model.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
model | Reference | The model to set the bounds of. |
position | vec3 | The sphere position. |
radius | float | The radius of the bounding sphere. |
draw_bounds | bool | Draw debug bounding-sphere |
$draw.drawcall3d_model_lod_authority(drawcall: Reference, lod_authority: Component, cmd_list_index: int)Sets the model to copy this model's current LOD level from.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
lod_authority | Component | The model which dictates this model's LOD level. |
cmd_list_index | int | Optional offset for additional command lists. |
$draw.drawcall3d_model_lod_thresholds(drawcall: Reference, overrides: list)Overrides the model's LOD thresholds
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
overrides | list | List of floats, each of which is a screen percent threshold. |
$draw.drawcall3d_prime(drawcall: Reference, other_cmd_list_index: int, other_model: Reference)If needed, inherit transforms and other data from another draw. Used to prime new drawcalls on the same model.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the current draw call. @see drawcall3d_begin |
other_cmd_list_index | int | Other command list to use for priming. Should match the other drawcall3d_begin, not the current one. |
other_model | Reference | Other model to use for priming. Should match the other drawcall3d_begin, not the current one. |
$draw.drawcall_material_attribute(drawcall: Reference, member: string, value: var)Set an uniform attribute in material draw.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
member | string | The name of the attribute. |
value | var | The value to set the attribute to. |
$draw.drawcall_material_attribute_vec4_precise(drawcall: Reference, member: string, xyz: vec3, w: float)Set a vec4 uniform attribute in material draw. Using a vec3 xyz and float w as input to make sure input vec4 is not packed.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
member | string | The name of the attribute. |
xyz | vec3 | The xyz value to set the attribute to. |
w | float | The w value to set the attribute to. |
$draw.drawcall_material_color(drawcall: Reference, member: string, value: var, color_override: int)Set the primary color in a specified material draw.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
member | string | The name of the color parameter. |
value | var | The value of the color (vec3 or vec4). |
color_override | int | How the color parameter affects the material color (see the enum in model.vscript.) |
$draw.drawcall_material_cull_mode(drawcall: Reference, cull_mode: int)Set cull mode of a material. Note it cannot be changed after gpu resource is readied.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
cull_mode | int | The cull mode in vgpu_cull_mode_e |
$draw.drawcall_material_draw_order(drawcall: Reference, draw_order: int, is_offset: bool)Set draw order of a material
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
draw_order | int | The draw order. Should range between -16 to 15 |
is_offset | bool | Whether to treat the draw order as an offset from original draw order |
$draw.drawcall_material_sort_stage(drawcall: Reference, sort_stage: int, ignore_opaque: bool, ignore_translucent: bool)Set sort stage of a material
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
sort_stage | int | The sort stage. See vrender_draw_call_sort_stage_t. |
ignore_opaque | bool | Whether to ignore if material is opaque. |
ignore_translucent | bool | Whether to ignore if material is translucent. |
$draw.drawcall_material_stencil(drawcall: Reference, enabled: bool, fail_op: int, pass_op: int, depth_fail_op: int, compare_op: int, compare_mask: int, write_mask: int, ref: int)Set stencil state overrides for material draw. All settings are optional, those not provided will fall back to defaults.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
enabled | bool | Enable or disable stencil entirely. |
fail_op | int | The operation to apply when the stencil test fails. |
pass_op | int | The operation to apply when the stencil test passes. |
depth_fail_op | int | The operation to apply when the depth test fails. |
compare_op | int | The comparison operation for stencil testing. |
compare_mask | int | The mask applied to stencil values prior to comparison. Useful for testing a subset of stencil bits. Valid range [0-255]. |
write_mask | int | The mask applied when modifying the stencil buffer via a stencil operation. Useful to updating a subset of stencil bits. Valid range [0-255]. |
ref | int | The stencil reference value. Meaning varies depending on stencil operation. Valid range [0-255]. |
$draw.drawcall_material_texture(drawcall: Reference, slot: int, texture: Reference)Set a texture in a specified material draw.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
slot | int | Texture slot index. |
texture | Reference | Reference to texture. |
$draw.drawcall_material_type_override(drawcall: Reference, material_type: int)Override the material type of a material. Note it cannot be changed after gpu resource is readied.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall3d_begin |
material_type | int | The material type from vrender_material_type_e |
$draw.drawcall_scene(drawcall: Reference, scene: Component)Draw to a specific scene.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see e.g. drawcall3d_begin |
scene | Component | The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.fog(color: vec3, sun_color: vec3, density: float, height_density: float, height_falloff: float, color_exponent: float, start_distance: float, start_height: float, ibl_fog_power: float, ibl_fog_enabled: bool)Draws exponential height fog.
| Parameter | Type | Meaning |
|---|---|---|
color | vec3 | Fog color. |
sun_color | vec3 | Fog sun color. |
density | float | Distance fog density. |
height_density | float | Height fog density. |
height_falloff | float | Height falloff. |
color_exponent | float | Color/Sun color lerp exponent. |
start_distance | float | Fog start disatance. |
start_height | float | Fog start height. |
ibl_fog_power | float | IBL Fog Power. |
ibl_fog_enabled | bool | IBL Fog Enabled. |
$draw.force_show_indicator_icons() -> boolIf true, performance indicator icons must be drawn on the HUD.
Returns bool: Indicator icon show state.
$draw.get_client_display_rate(user: User) -> intGet the display refresh rate for a client user.
| Parameter | Type | Meaning |
|---|---|---|
user | User | The user whose name controls the movement pattern. |
Returns int: Render refresh rate
$draw.get_client_window_state(user: User) -> intGet the window state flags for a client user.
| Parameter | Type | Meaning |
|---|---|---|
user | User | The user whose name controls the movement pattern. |
Returns int: Window state flags; @see vwm_window_state_flags_t
$draw.get_current_display_mode_refresh_rate_hz() -> intGet the current display refresh rate of the current display mode (fullscreen display mode if we are in exclusive fullscreen, otherwise desktop display mode.)
Returns int: Refresh rate in Hz
$draw.get_default_mask_owner_only() -> boolGet the default owner_masking boolean
Returns bool: True if owner only masking desired
$draw.get_default_material_from_model_by_slot_index(model: Reference, slot_index: int) -> ReferenceGet a reference to a model's default material by material slot index
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model to draw. |
slot_index | int | The material slot index |
Returns Reference: The reference to default material instance (vrender_material_instance_t)
$draw.get_display_mode_list() -> listGet the list of supported exclusive fullscreen modes in [0-vec3(x: mode0_width, y: mode0_height, z: mode0_refresh rate), 1-int(mode0_format), 2-vec3(x: mode1_width, y: mode1_height, z: mode1_refresh rate), 3-int(mode1_surface_format), ...]
Returns list: The list of supported exclusive fullscreen modes in [0-vec3(x: mode0_width, y: mode0_height, z: mode0_refresh rate), 1-int(mode0_format), 2-vec3(x: mode1_width, y: mode1_height, z: mode1_refresh rate), 3-int(mode1_surface_format), ...]
$draw.get_exclusive_fullscreen_display_mode() -> listGet current exclusive fullscreen mode in [0-vec3(x: mode0_width, y: mode0_height, z: mode0_refresh rate), 1-int(mode0_format)]
Returns list: Current exclusive fullscreen mode in [0-vec3(x: mode0_width, y: mode0_height, z: mode0_refresh rate), 1-int(mode0_format)]
$draw.get_fps_cap_for_current_display() -> intGet the FPS cap setting for the current display
Returns int: Current fps_cap_level for this window while on its current display (0: Unlimited, otherwise: Display Hz / N)
$draw.get_fullscreen() -> intGet window fullscreen mode
Returns int: 0 for windowed, 1 for borderless fullscreen, 2 for exclusive fullscreen
$draw.get_material_texture_slot_index_by_name(material: Reference, texture_slot_name: string) -> intGet the texture slot index from a material
| Parameter | Type | Meaning |
|---|---|---|
material | Reference | The material instance to get texture slot index from |
texture_slot_name | string | Name of texture slot |
Returns int: Slot index, or -1 if not found
$draw.get_model_bounding_radius(model: Reference, scale: vec3) -> floatGet the world scale bounding radius of a model
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model. |
scale | vec3 | The world scale of the model's transform. |
Returns float: Bounding radius of the given model
$draw.get_model_bounds_max(model: Reference, scale: vec3) -> vec3Get the maximum of a model's bounding box
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model. |
scale | vec3 | The world scale of the model's transform. |
Returns vec3: The given model's bounding box maximum
$draw.get_model_bounds_min(model: Reference, scale: vec3) -> vec3Get the minimum of a model's bounding box
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model. |
scale | vec3 | The world scale of the model's transform. |
Returns vec3: The given model's bounding box minimum
$draw.get_model_material_slot_count(model: Reference) -> intGet number of material slots in a model (from lod 0)
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model to draw. |
Returns int: Number of material slots
$draw.get_model_material_slot_index_by_slot_name(model: Reference, slot_name: string) -> intGet the slot index from a material slot name
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model to draw. |
slot_name | string | Name of material slot |
Returns int: Slot index, or -1 if not found
$draw.get_model_opaque_material_slot_mask(model: Reference) -> intGet a bitmask containing opaque material (whatever is not transparency sorted) slots from a model.
| Parameter | Type | Meaning |
|---|---|---|
model | Reference | The model. |
Returns int: The bitmask containing opaque material slots from a model.
$draw.get_override_slot_material(override: Reference) -> ReferenceGet the material being overridden for a given slot.
| Parameter | Type | Meaning |
|---|---|---|
override | Reference | The slot override. |
Returns Reference: The material being overridden.
$draw.get_override_slot_name(override: Reference) -> stringGet the name of the slot being overridden.
| Parameter | Type | Meaning |
|---|---|---|
override | Reference | The slot override. |
Returns string: Name of slot being overridden.
$draw.get_pipelines_pending() -> boolIf true, vgpu is still working on building shader pipelines.
Returns bool: True if pipeline builds are pending.
$draw.get_platform_default_shadow_resolution_enum() -> intGet the platform default shadow resolution. See vrender_shadow_resolution_t.
Returns int: The platform default shadow resolution. See vrender_shadow_resolution_t. Note this is not the shadow quality level in user settings.
$draw.get_sprite_bounds(texture: Reference, authored_for_1080p: bool, authored_for_4k: bool) -> vec2Get the width and height of a texture asset.
| Parameter | Type | Meaning |
|---|---|---|
texture | Reference | Reference to a texture to query. |
authored_for_1080p | bool | If the asset dimensions are designed for a 1080p canvas. |
authored_for_4k | bool | If the asset dimensions are designed for a 4k canvas. |
Returns vec2: vec2 containing width and height of texture.
$draw.get_window_display_index() -> intGet current display index for the window
Returns int: The display index
$draw.get_window_size(user: User) -> vec2Get window size for a user.
| Parameter | Type | Meaning |
|---|---|---|
user | User | User identifier. |
Returns vec2: The window size.
$draw.gi_volume(gi_data: Reference, fade_dist: float, priority: int, scene: Component)Draws a GI volume.
| Parameter | Type | Meaning |
|---|---|---|
gi_data | Reference | Baked GI probe data |
fade_dist | float | GI volume fade distance in cm. |
priority | int | GI volume priority |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.is_hud_visible() -> boolReturns true if the HUD is currently visible.
Returns bool: If hud should be visible.
$draw.is_world_point_in_view(point: vec3, user: User, viewport_transform: vec4) -> boolChecks whether a world position is in viewport
| Parameter | Type | Meaning |
|---|---|---|
point | vec3 | World-space point |
user | User | User identifier. |
viewport_transform | vec4 | xy: viewport position, zw : viewport size, both are normalized between 0.0 and 1.0 (full window) |
Returns bool: Whether the position is in viewport
$draw.line(a: vec3, b: vec3, color: var, width: float, lifetime: float, draw_on_top: bool)Draw a line between two points.
| Parameter | Type | Meaning |
|---|---|---|
a | vec3 | The first point. |
b | vec3 | The second point. |
color | var | The line color (vec3 or vec4). |
width | float | The line width. |
lifetime | float | The time in seconds for which the line should persist. Zero means a single frame. |
draw_on_top | bool | If the line should be drawn on top |
$draw.main_viewport_transform(viewport_transform: vec4)Request a specific main viewport transform.
| Parameter | Type | Meaning |
|---|---|---|
viewport_transform | vec4 | Vector where x,y is requested viewport origin in range [0,1] and z,w is width,height in range [0,1]. |
$draw.make_color(r: float, g: float, b: float, a: float) -> vec4Build an RGBA color value.
| Parameter | Type | Meaning |
|---|---|---|
r | float | Red in the range 0 to 1. |
g | float | Green in the range 0 to 1. |
b | float | Blue in the range 0 to 1. |
a | float | Alpha in the range 0 to 1. |
Returns vec4: A color.
$draw.make_nine_slice(window_ul: vec2, window_ur: vec2, window_ll: vec2, window_lr: vec2, box_dimensions: vec2, sprite_dimensions: vec2, border_authoring_scale: float, border_ul: vec2, border_lr: vec2) -> listBuild a list of values to use in drawing a nine slice sprite.
| Parameter | Type | Meaning |
|---|---|---|
window_ul | vec2 | Upper left corner. |
window_ur | vec2 | Upper right corner. |
window_ll | vec2 | Lower left corner. |
window_lr | vec2 | Lower right corner. |
box_dimensions | vec2 | Dimensions of the ui box. |
sprite_dimensions | vec2 | Dimensions of the sprite. |
border_authoring_scale | float | Scale to apply to all border thicknesses to account for authoring scale. |
border_ul | vec2 | Border thickness from the upper left corner in pixels. |
border_lr | vec2 | Border thickness from the bottom right in pixels. |
Returns list: List of sets of 6 values (ul, ur, ll, lr, ul_uv, lr_uv).
$draw.movie_update(cmdlist: Reference, movie: Reference, y_texture: Reference, uv_texture: Reference, min_t_ms: int, max_t_ms: int)Updates movie textures.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
movie | Reference | The movie object. |
y_texture | Reference | The y texture to update. |
uv_texture | Reference | The uv texture to update. |
min_t_ms | int | Window start in ms. |
max_t_ms | int | Window end in ms. |
$draw.music_sync(cmdlist: Reference, beat: float, beat_duration: float, beat_count: int)Set current music sync beat for uses in shaders.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
beat | float | The current beat. Each integer is a whole beat. |
beat_duration | float | The current beat duration in seconds. |
beat_count | int | The accumulated beat count. |
$draw.occlusion_query(cmdlist: Reference, half_extents: vec3) -> boolChecks if a bounding box is fully occluded. Occlusion query is done on GPU, results a several frames old.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
half_extents | vec3 | The half-extents of the box. |
Returns bool: True if the box is fully occluded. Otherwise, false.
$draw.pipeline_prewarm_list(pipeline_list: Reference)Send a list of pipelines to render to be prewarmed when corresponding shaders are loaded.
| Parameter | Type | Meaning |
|---|---|---|
pipeline_list | Reference | Reference to a .pipelines file. |
$draw.planar_reflection(cmdlist: Reference, position: vec3, rotation: vec4, distance_fade: vec2, angle_fade: vec2, normal_distortion_strength: float)Draws planar reflections.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
position | vec3 | The position of the reflection plane. |
rotation | vec4 | The rotation of the reflection plane. |
distance_fade | vec2 | Start and end distances for distance fade (in cm.) |
angle_fade | vec2 | Start and end angles for angle fade (in degrees). |
normal_distortion_strength | float | The amount of normal offset applied to reflection sampling. |
$draw.plot(name: string, value: float)Add a value to a named plot.
| Parameter | Type | Meaning |
|---|---|---|
name | string | The name of the plot. |
value | float | The value to add. |
$draw.plot_clear(name: string)Clear a named plot.
| Parameter | Type | Meaning |
|---|---|---|
name | string | The name of the plot. |
$draw.plot_compare(name: string, file: string)Compare a named plot which one previously written to a file.
| Parameter | Type | Meaning |
|---|---|---|
name | string | The name of the plot. |
file | string | The image file name whose contents will be compared against. |
$draw.point_light(transform: Component, color: vec3, temperature: float, intensity: float, bounding_radius: float, start_fade_percent: float, cull_percent: float, camera_mask: int, scene: Component, clip_volume: Component, cast_shadows: bool, dynamic_shadows: bool)Draws a point light.
| Parameter | Type | Meaning |
|---|---|---|
transform | Component | Reference a transform component that positions the light. |
color | vec3 | The light's color. |
temperature | float | Color temperature |
intensity | float | The light's intensity. |
bounding_radius | float | The bounding radius of the light. |
start_fade_percent | float | The percent of the screen covered where a light should start fading. |
cull_percent | float | The percent of the screen covered at which the light should be culled. |
camera_mask | int | Which (split-screen) cameras should draw this light. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
clip_volume | Component | (Optional) Reference to transform component that will be used as a clipping volume for the light. |
cast_shadows | bool | Enable shadow casting for this light. |
dynamic_shadows | bool | Enable dynamic shadow casting for this light. |
$draw.postprocessing_bloom(cmdlist: Reference, enabled: bool, input_threshold: vec3, output_scale: vec3)Sets the bloom input threshold.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
enabled | bool | Bloom enabled flag. |
input_threshold | vec3 | The HDR input threshold color. max(input - threshold, 0) |
output_scale | vec3 | The HDR output scale factor. |
$draw.postprocessing_brightness(cmdlist: Reference, brightness: float)Sets the brightness for the display output
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
brightness | float | Value of brightness |
$draw.postprocessing_car_camera_grading(cmdlist: Reference, tint: vec3, intensity: float, exposure: float, brightness: float, gamma: float, contrast: float, saturation: float)Control car camera color grading
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
tint | vec3 | Tint Color |
intensity | float | Intensity of Tint |
exposure | float | Intensity of Exposure |
brightness | float | Intensity of Brightness |
gamma | float | Intensity of Gamma |
contrast | float | Intensity of Contrast |
saturation | float | Intensity of Saturation |
$draw.postprocessing_contrast(cmdlist: Reference, contrast: float)Sets the contrast for the display output
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
contrast | float | Value of contrast |
$draw.postprocessing_distortion(cmdlist: Reference, scale: float)Sets the parameters for the distortion.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
scale | float | Scale to apply to distortion (valid range is greater than 0 and less than or equal to 1). |
$draw.postprocessing_dof(cmdlist: Reference, dof_enabled: bool, dof_focus_plane: float, dof_lens_radius: float, dof_blur_radius: float, firefly_suppression: float, bokeh_edge_count: int, bokeh_rotation_degrees: float, quality: int)Sets the parameters for the depth of field
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
dof_enabled | bool | Whether the dof passes are enabled true/false |
dof_focus_plane | float | Where the focus plane of the depth of field is, everything beyond this will be blurred |
dof_lens_radius | float | The radius of the lens in pixels. Larger values mean faster blurring. |
dof_blur_radius | float | How many pixels will contribute to the blur |
firefly_suppression | float | The strength of brightness weighting to reduce flicker. |
bokeh_edge_count | int | Number of edges for polygonal bokeh, or circular bokeh for values < 3. |
bokeh_rotation_degrees | float | Rotation of polygon bokeh, in degrees. |
quality | int | Quality level of bokeh blur. |
$draw.postprocessing_exposure(cmdlist: Reference, exposure: float, emissive_bias: float)Sets the relative exposure (in EV_100) for the display output
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
exposure | float | Relative exposure in EV_100 |
emissive_bias | float | Bias (in EV_100) applied to scene exposure for emissive surfaces. |
$draw.postprocessing_hue(cmdlist: Reference, hue: float)Sets the hue for the display output
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
hue | float | Value of hue angle in degrees -180 to 180 |
$draw.postprocessing_outlines(cmdlist: Reference, width_pixels: float, color: vec4, max_distance: float)Sets the parameters for postprocess outlines
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
width_pixels | float | Outline width in pixels. |
color | vec4 | Outline color |
max_distance | float | The maximum distance; edges beyond this distance will not generate outlines. |
$draw.postprocessing_outlines_glow(cmdlist: Reference, width_pixels: float, inner_color: vec4, outer_color: vec4, stencil_compare_mask: int, stencil_reference: int)Sets the parameters for outline-based glow postprocess
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
width_pixels | float | Outline width in pixels. |
inner_color | vec4 | Outline color at inner edge. |
outer_color | vec4 | Outline color at outer edge. |
stencil_compare_mask | int | Stencil comparison bitmask. |
stencil_reference | int | Stencil reference value. |
$draw.postprocessing_radial_blur(cmdlist: Reference, enabled: bool, bias: float, max_distance: float, chromatic_aberration: float, center_offset: vec2)Sets the radial blur settings
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist |
enabled | bool | Radial Blur enabled flag |
bias | float | The amount to bias the center out by. making this larger makes the unblurred region larger |
max_distance | float | The max distance a blur can spread |
chromatic_aberration | float | Intensity of chromatic aberration, value is represented as a 0 to 1 range |
center_offset | vec2 | Offset of the center of the blur |
$draw.postprocessing_render_target_translation(cmdlist: Reference, translation: vec2)Sets the translation for render targets
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
translation | vec2 | The translation of the render target in range of -1 to 1 |
$draw.postprocessing_saturation(cmdlist: Reference, saturation: float)Sets the saturation for the display output
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
saturation | float | Value of saturation |
$draw.postprocessing_ssao(cmdlist: Reference, mode: int, radius: float, intensity: float, normal_bias: float)Sets the SSAO mode + options
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
mode | int | Current mode. Refer to vrender_postprocess_ambientocclusion_mode_t |
radius | float | World space radius of AO sampling, in cm. |
intensity | float | Scales effect intensity, higher is darker. |
normal_bias | float | Small bias value to prevent noise due to Z buffer precision. |
$draw.postprocessing_sunshafts(cmdlist: Reference, enabled: bool, layer0_tint: vec3, layer1_tint: vec3, layer2_tint: vec3, final_tint: vec3, decay: float, radius: float, shaft_threshold: float, sunburst_intensity: float)Sets the sunshaft effect settings.
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
enabled | bool | Enable / disable the effect. |
layer0_tint | vec3 | Tint color for blur layer 0. |
layer1_tint | vec3 | Tint color for blur layer 1. |
layer2_tint | vec3 | Tint color for blur layer 2. |
final_tint | vec3 | Tint color for final output. |
decay | float | Decay multiplier for blur falloff. Range: [0, 1] |
radius | float | Sampling radius for blur. Range: [0, 0.5] |
shaft_threshold | float | Sunshaft Threshold |
sunburst_intensity | float | Intensity of the sunburst mask [0-1]. |
$draw.postprocessing_tint(cmdlist: Reference, tint: vec3, intensity: float)Sets a tint for the display output
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
tint | vec3 | Color of tint |
intensity | float | Intensity of tint |
$draw.postprocessing_tonemapping(cmdlist: Reference, tonemapping_a: float, tonemapping_b: float, tonemapping_c: float, tonemapping_d: float, tonemapping_e: float, tonemapping_f: float, tonemapping_w: float)Sets the parameters for the tonemapping
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
tonemapping_a | float | shoulder strength |
tonemapping_b | float | linear strength |
tonemapping_c | float | linear angle |
tonemapping_d | float | toe strength |
tonemapping_e | float | toe numerator |
tonemapping_f | float | toe denominator |
tonemapping_w | float | linear white point |
$draw.postprocessing_vignette(cmdlist: Reference, inner_color: vec3, inner_intensity: float, outer_color: vec3, outer_intensity: float, center: vec2, radii: vec2, color_falloff: float, intensity_falloff: float, blend_mode: float)Sets the parameters for the vignette
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
inner_color | vec3 | Inner color of vignette |
inner_intensity | float | Inner intensity of vignette |
outer_color | vec3 | Outer color of vignette |
outer_intensity | float | Outer intensity of vignette |
center | vec2 | Center point of the vignette |
radii | vec2 | Radius values in x and y for the vignette ellipse |
color_falloff | float | Falloff parameter for controlling the blend between inner and outer color |
intensity_falloff | float | Falloff parameter for controlling the alpha intensity outside of the vignette ellipse |
blend_mode | float | Controls the blending of the vignette, 0 is additive, 1 is alpha-blend and values between mix the two |
$draw.postprocessing_vui(cmdlist: Reference, dissolve_animation_time: float, dissolve_cutoff: float, dissolve_edge_cutoff: float, dissolve_edge_blend: float, dissolve_transparency: float, dissolve_direction: float, dissolve_texture_direction: float, dissolve_texture_scroll_speed: float, dissolve_gradient_a: vec4, dissolve_gradient_b: vec4, dissolve_gradient_c: vec4, glitch_strength: vec4, glitch_grid_size: vec2, glitch_animation_speed: float)Controls UI post-processing effects
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
dissolve_animation_time | float | Animation time of effect |
dissolve_cutoff | float | Theshold for texture cutoff |
dissolve_edge_cutoff | float | Theshold for edge texture cutoff |
dissolve_edge_blend | float | Theshold for edge texture blend |
dissolve_transparency | float | The transparency of the dissolve |
dissolve_direction | float | Direction of the dissolve on screen |
dissolve_texture_direction | float | Direction of the texture scrolling |
dissolve_texture_scroll_speed | float | Speed of the texture scrolling |
dissolve_gradient_a | vec4 | First color of the gradient |
dissolve_gradient_b | vec4 | Second color of the gradient |
dissolve_gradient_c | vec4 | Third color of the gradient |
glitch_strength | vec4 | UI Glitch Strength |
glitch_grid_size | vec2 | UI Glitch Grid Size |
glitch_animation_speed | float | UI Glitch Animation Speed |
$draw.probe(position: vec3, rotation: vec4, scale: vec3, probe_data: Reference, fade_fractions: vec3, priority: int, camera_mask: int, scene: Component, offset: vec3, volume_type: int, distant_probe: bool)Draws a probe.
| Parameter | Type | Meaning |
|---|---|---|
position | vec3 | Position from transform component. |
rotation | vec4 | Rotation from transform component. |
scale | vec3 | Scale from transform component. |
probe_data | Reference | Probe data. |
fade_fractions | vec3 | Probe fade fractions |
priority | int | Probe priority. |
camera_mask | int | Which (split-screen) cameras should draw this probe. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
offset | vec3 | The local-space offset applied when capturing the probe. |
volume_type | int | The volume type: box, sphere, or cylinder. |
distant_probe | bool | Is this a distant probe? (Disables parallax correction.) |
$draw.probe_from_world(probe_data: Reference, fade_fractions: vec3, priority: int, camera_mask: int, scene: Component, offset: vec3, volume_type: int, distant_probe: bool)Draws a probe.
| Parameter | Type | Meaning |
|---|---|---|
probe_data | Reference | Probe data. |
fade_fractions | vec3 | Probe fade fractions |
priority | int | Probe priority. |
camera_mask | int | Which (split-screen) cameras should draw this probe. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
offset | vec3 | The local-space offset applied when capturing the probe. |
volume_type | int | The volume type: box, sphere, or cylinder. |
distant_probe | bool | Is this a distant probe? (Disables parallax correction.) |
$draw.reset_exclusive_fullscreen_display_mode_for_all_displays()Reset exclusive fullscreen mode for all displays
$draw.reset_fps_cap_for_all_displays()Reset the FPS cap setting for all displays
$draw.select_ramp_index(index: int, texture_size: int, ramp_count: int, scene: Component)sets the index of the color ramp to use.
| Parameter | Type | Meaning |
|---|---|---|
index | int | The index of the requested ramp. |
texture_size | int | The size of the texture ramp. |
ramp_count | int | The total amount of ramps. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.set_exclusive_fullscreen_display_mode(resolution_and_refresh_rate: vec3, format: int)Set target exclusive fullscreen mode
| Parameter | Type | Meaning |
|---|---|---|
resolution_and_refresh_rate | vec3 | xy: resolution, z: refresh rage |
format | int | A format which should match return value from get_exclusive_fullscreen_display_mode() or get_display_mode_list() |
$draw.set_fps_cap_for_current_display(fps_cap_level: int)Set the FPS cap setting for the current display
| Parameter | Type | Meaning |
|---|---|---|
fps_cap_level | int | 0: Unlimited, otherwise: Display Hz / N |
$draw.set_frame_buffer_count(count: int)Set the frame buffer count
| Parameter | Type | Meaning |
|---|---|---|
count | int | Frame buffer count. |
$draw.set_fullscreen(fullscreen: int)Set window to windowed mode, or one of the fullscreen modes
| Parameter | Type | Meaning |
|---|---|---|
fullscreen | int | 0 for windowed, 1 for borderless fullscreen, 2 for exclusive fullscreen |
$draw.set_global_visual_time(time: int)Set visual time for vfx and shader for this frame. If not called, will use virtual time * default time interval.
| Parameter | Type | Meaning |
|---|---|---|
time | int | Time in milliseconds |
$draw.shader_graph_custom_globals_single(cmdlist: Reference, custom_globals_set_index: int, channel_index: int, value: float, no_interpolate: bool, scene: Component)Sets shader graph custom globals data (single-channel)
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist to add this command to. @see cmdlist_begin |
custom_globals_set_index | int | Index of the custom globals set to drive |
channel_index | int | Which channel on the specified custom globals set to drive |
value | float | Value to drive the specified custom globals set and channel |
no_interpolate | bool | (Optional) Disables interpolation of value from the prior frame |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.shader_graph_custom_globals_xyzw(cmdlist: Reference, custom_globals_set_index: int, value: vec4, no_interpolate: bool, scene: Component)Sets shader graph custom globals data (XYZW channels)
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist to add this command to. @see cmdlist_begin |
custom_globals_set_index | int | Index of the custom globals set to drive |
value | vec4 | XYZW value |
no_interpolate | bool | (Optional) Disables interpolation of value from the prior frame |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.shadow_settings(cmdlist: Reference, near_plane_override: float, far_plane: float, cascade_fade_amount: float, cascade_split_adjustment: float, cascade_count: int, resolution: int, resolution_splitscreen: int, normal_offset_bias: float, depth_plane_bias_clamp: float, disable_staggered_update: bool)Sets the shadow settings
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
near_plane_override | float | Shadow near plane override. |
far_plane | float | Shadow far plane |
cascade_fade_amount | float | Shadow cascade fade amount (0 - 1) |
cascade_split_adjustment | float | Shadow cascade split distribution adjustment factor (0 - 1) |
cascade_count | int | Number of shadow cascade slices to render. |
resolution | int | Enum describing the shadow resolution to use. |
resolution_splitscreen | int | Enum describing the shadow resolution to use for splitscreen cases. |
normal_offset_bias | float | Shadow bias applied by offseting sample along surface normal. |
depth_plane_bias_clamp | float | Clamp value for automatic depth bias. |
disable_staggered_update | bool | Disables the staggered shadow update, so all cascades update each frame. |
$draw.shadow_volume(cmdlist: Reference, transform: Component, generation: int, is_static: bool)Sets a volume to tightly limit shadow map rendering
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
transform | Component | Reference to a transform component describing the volume. |
generation | int | Change this value to force the shadow to rerender (even if static). |
is_static | bool | If true, indicates a shadow volume is used as a static fallback shadow map, will only be rerendered when the volume moves or the generation changes. |
$draw.show_watermark_regions(user: User, scale: vec2)Show the regions that the on-screen watermark will be placed.
| Parameter | Type | Meaning |
|---|---|---|
user | User | The user whose name controls the movement pattern. |
scale | vec2 | Window scale. |
$draw.special_light(light_type: int, use_direction: bool, use_color: bool, direction: vec3, color: vec4, scene: Component)sets a special light direction (sun/rim/fill).
| Parameter | Type | Meaning |
|---|---|---|
light_type | int | The light's type. |
use_direction | bool | Do we want to use the direction information from the light.) |
use_color | bool | Do we want to use the color information from the light.) |
direction | vec3 | The direction of the special light. |
color | vec4 | The light's color. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.special_shadow(color: vec4, scene: Component)sets a special shadow color.
| Parameter | Type | Meaning |
|---|---|---|
color | vec4 | The shadow's color. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.sphere(position: vec3, color: var, radius: float, divisions: int, lifetime: float, use_non_uniform_scale: bool, non_uniform_scale: vec3)Draw a sphere.
| Parameter | Type | Meaning |
|---|---|---|
position | vec3 | The origin of the sphere. |
color | var | The line color (vec3 or vec4). |
radius | float | The radius of the sphere. |
divisions | int | The number of subdivisions in the sphere mesh. |
lifetime | float | The time in seconds for which the sphere should persist. Zero means a single frame. |
use_non_uniform_scale | bool | Whether to use 'scale' to scale the sphere |
non_uniform_scale | vec3 | Only used when use_non_uniform_scale is true. The scale of the debug sphere to be drawn. Can be non-uniform |
$draw.spot_light(transform: Component, color: vec3, temperature: float, direction: vec3, intensity: float, bounding_radius: float, start_fade_percent: float, cull_percent: float, outer_angle: float, inner_angle: float, camera_mask: int, scene: Component, clip_volume: Component, cast_shadows: bool, dynamic_shadows: bool, inner_shadow_angle: float, outer_shadow_angle: float)Draws a spot light.
| Parameter | Type | Meaning |
|---|---|---|
transform | Component | Reference a transform component that positions the light. |
color | vec3 | The light's color. |
temperature | float | Color temperature |
direction | vec3 | The direction of the spot light. |
intensity | float | The light's intensity. |
bounding_radius | float | The bounding radius of the light. |
start_fade_percent | float | The percent of the screen covered where a light should start fading. |
cull_percent | float | The percent of the screen covered at which the light should be culled. |
outer_angle | float | The outer angle of the spot light, in degrees. |
inner_angle | float | The inner angle of the spot light, in degrees. |
camera_mask | int | Which (split-screen) cameras should draw this light. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
clip_volume | Component | (Optional) Reference to transform component that will be used as a clipping volume for the light. |
cast_shadows | bool | Enable shadow casting for this light. |
dynamic_shadows | bool | Enable dynamic shadow casting for this light. |
inner_shadow_angle | float | Inner cone angle for shadow cone. |
outer_shadow_angle | float | Outer cone angle for shadow cone. |
$draw.sun_disc(direction: vec3)Sets direction of the sun's visual disc.
| Parameter | Type | Meaning |
|---|---|---|
direction | vec3 | The direction of the sun disc. |
$draw.sun_light(color: vec3, temperature: float, direction: vec3, intensity: float, scene: Component)Draws the sun light.
| Parameter | Type | Meaning |
|---|---|---|
color | vec3 | The light's color. |
temperature | float | Color temperature |
direction | vec3 | The direction of the sun light. |
intensity | float | The light's intensity. |
scene | Component | (Optional) The scene component, e.g. entity.get_hierarchy_singleton(type: 'scene.vscript'). |
$draw.text(text: string, pos: vec2, alignment: vec2, font: Reference, font_size: float, color: vec4, wrap: float, args: list, sort: var, dissolve_ui: bool)Draw some text to screen.
| Parameter | Type | Meaning |
|---|---|---|
text | string | The text to draw. |
pos | vec2 | Location of the text. |
alignment | vec2 | Used for justification. |
font | Reference | Font to use. |
font_size | float | Pt size for font. |
color | vec4 | Color of the text. |
wrap | float | Pixel width to word wrap on. |
args | list | List of values to insert into the message. |
sort | var | Sort value to use (optional, otherwise assumes debug text). |
dissolve_ui | bool | Whether the ui element should be dissolved or not |
$draw.text_color_overlay(drawcall: Reference, value: vec4)Set the color overlay for a text draw that affect both the text and the glyph
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the text draw call. |
value | vec4 | The overlay color |
$draw.text_mask(drawcall: Reference, texture: Reference, sampler: Reference, box_x: vec2, box_y: vec2, box_pos: vec2, opacity: float, uv_scale: vec2, uv_offset: vec2, world_locator: Component)Set the sprite mask texture and projection for a text draw.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. @see drawcall2d_begin |
texture | Reference | The mask texture. |
sampler | Reference | Optional sampler to use for the mask texture. |
box_x | vec2 | The X-axis basis of the mask box projection. |
box_y | vec2 | The Y-axis basis of the mask box projection. |
box_pos | vec2 | The position of the center of the box projection. |
opacity | float | The influence of this mask on sprites (1: full influence, 0: no influence). |
uv_scale | vec2 | The scale applied to the mask texture UVs. |
uv_offset | vec2 | The offset applied ot the mask texture UVs. |
world_locator | Component | reference to a ui_world_locator.vscript component to attach world position to |
$draw.text_material_begin(drawcall: Reference, material: Reference, cmd_list_index: int) -> ReferenceInstantiate a material for the text in the specified draw command. Note that we need to use the return value to feed into material attribute function's drawcall input.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call. |
material | Reference | Reference to the custom material. |
cmd_list_index | int | Index of cmdlist, need to be different if we have multiple text draws in one component. |
Returns Reference: Material draw call handle.
$draw.text_material_end(drawcall: Reference)Finish a text material instance specification.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the material draw call. @see text_material_begin |
$draw.text_material_set_dissolve(drawcall: Reference, dissolve: bool)Set the vui dissolve value.
| Parameter | Type | Meaning |
|---|---|---|
drawcall | Reference | Reference to the draw call |
dissolve | bool | True or false for dissolve setting. |
$draw.ui_world_locator(position: vec3, camera_index: int, pin_to_edge: bool, margin: vec4)Place a locator in world space for ui to attach to. (For example, overhead widget and offscreen indicator).
| Parameter | Type | Meaning |
|---|---|---|
position | vec3 | The position. |
camera_index | int | The camera index to use for projection |
pin_to_edge | bool | Pin to edge if off-screen. |
margin | vec4 | How much to inset from left, top, right and bottom when pinned to edge of screen (normalized so 1.0 is half viewport width or height). 0 means no margin and the point will be pinned to the exact edge of the screen. Positive moves the pinned point in as a percentage of screen width. |
$draw.update_watermark_position(user: User, octal_index: int, bounds: vec2, scale: vec2) -> listGets the next position of an on-screen watermark. As an anti-leak measure, the position changes in a pattern based on user's ID.
| Parameter | Type | Meaning |
|---|---|---|
user | User | The user whose name controls the movement pattern. |
octal_index | int | The current octal index into the user's publisher ID. |
bounds | vec2 | Size of the watermark. |
scale | vec2 | Window scale. |
Returns list: The new octal index and the current screen position of the watermark.
$draw.user_settings(cmdlist: Reference, gamma_correction: float, bloom_allowed: bool, ssao_enabled: bool, vsync_enabled: int, refresh_rate: int, resolution_scale: float, dynamic_resolution_enabled: bool, dof_enabled: bool, shadow_cascade_max_count: int, shadow_resolution_enum: int, sunshafts_enabled: bool, dynamic_resolution_explicit_frame_time_target_ms: float, local_light_shadows_enabled: bool, gi_volumes_enabled: bool, aniso_filtering_boost: int)Sets the user graphics settings
| Parameter | Type | Meaning |
|---|---|---|
cmdlist | Reference | Reference to the cmdlist. @see cmdlist_begin |
gamma_correction | float | The gamma correction. |
bloom_allowed | bool | Whether bloom is allowed |
ssao_enabled | bool | Whether ssao is enabled |
vsync_enabled | int | Whether vsync is enabled (0 = off, 1 = on, 2 = adaptive) |
refresh_rate | int | Display refresh rate |
resolution_scale | float | The resolution scale |
dynamic_resolution_enabled | bool | Whether dynamic resolution scaling is enabled |
dof_enabled | bool | Whether depth of field is enabled |
shadow_cascade_max_count | int | Maximum number of shadow cascades. |
shadow_resolution_enum | int | Shadow resolution. See vrender_shadow_resolution_t. |
sunshafts_enabled | bool | Whether sunshafts are enabled |
dynamic_resolution_explicit_frame_time_target_ms | float | Explicit target ms for dynamic resolution (0 disables explicit setting and uses refresh rate). |
local_light_shadows_enabled | bool | Whether local light shadows are enabled |
gi_volumes_enabled | bool | Whether GI volumes are enabled |
aniso_filtering_boost | int | Anisotropic filtering boost for compatible textures (0: None) |
$draw.viewport(scene_view: string, camera: string, tl: vec2, dimensions: vec2)For a given scene view, set viewport override. Optionally update camera width and height as well.
| Parameter | Type | Meaning |
|---|---|---|
scene_view | string | scene_view name, should match scene_view.vscript. |
camera | string | Optional camera name, should match e.g. fixed_camera.vscript. |
tl | vec2 | Top left of viewport. |
dimensions | vec2 | Viewport dimensions. |
$draw.vui_calculate_window(parent_ui_box: Component, attach_to_world: bool, position: vec2, dimensions: vec2, rotation: float, scale: vec2, pivot: vec2, anchor: vec2, alpha: float, manual_sort: int, position_is_screen_space: bool, is_distorted_box: bool, apply_safe_zone_margins: bool)Calculate the window for this UI box given a parent.
| Parameter | Type | Meaning |
|---|---|---|
parent_ui_box | Component | Reference to parent UI box. |
attach_to_world | bool | True or false to attach to world. |
position | vec2 | Position of this UI box. |
dimensions | vec2 | Dimensions of this UI box. |
rotation | float | Rotation of this UI box. |
scale | vec2 | Scale of this UI box. |
pivot | vec2 | Pivot of this UI box. |
anchor | vec2 | Anchor of this UI box. |
alpha | float | Alpha of this UI box. |
manual_sort | int | Manual sort value of this UI box. |
position_is_screen_space | bool | True or false if position is in screen space. |
is_distorted_box | bool | True or false if ui_box is a distorted box type. |
apply_safe_zone_margins | bool | True or false if ui_box should apply safe zone margins. |
$draw.vui_get_canvas_size() -> vec2Get the canvas size for UI. A canvas sized ui element will fill the whole screen.
Returns vec2: The canvas size.
$draw.vui_get_default_window() -> listGet the default window for relative sprite / text rendering.
Returns list: List containing x, y, width, height, x scale, y scale.
$draw.vui_get_sort_value(category: int, manual: int) -> varCalculate a sorting value based on some settings and the caller's hierarchy.
| Parameter | Type | Meaning |
|---|---|---|
category | int | Most significant sort key. |
manual | int | Middle significance sort override. |
Returns var: Sort value to provide to drawcall2d functions.
$draw.world_point_to_screen(point: vec3, user: User, clamp_to_screen: bool, viewport_relative: bool, viewport_coordinates: bool, viewport_transform: vec4) -> vec3Converts a point in world space to the screen.
| Parameter | Type | Meaning |
|---|---|---|
point | vec3 | World-space point |
user | User | User identifier. |
clamp_to_screen | bool | Clamp to the bounds of the screen? |
viewport_relative | bool | If false, absolute screen position. If true, don't offset to be relative to the user's splitscreen viewport. |
viewport_coordinates | bool | If true, return viewport coordinates - [0, 1], otherwise use pixel coordinates. |
viewport_transform | vec4 | xy: viewport position, zw : viewport size, both are normalized between 0.0 and 1.0 (full window) |
Returns vec3: Projected point in x, y, sign of point in z.
$draw.world_point_to_screen_pinned(point: vec3, user: User, margin: float, viewport_relative: bool, viewport_transform: vec4) -> listConverts a point in world space to the screen. The resultant point is pinned to the edge of the screen, less the margin.
| Parameter | Type | Meaning |
|---|---|---|
point | vec3 | World-space point |
user | User | User identifier. |
margin | float | How much to inset. [-1, 1). 0 means no margin and the point will be pinned to the exact edge of the screen. Positive moves the pinned point in as a percentage of screen width. |
viewport_relative | bool | If false, absolute screen position. If true, don't offset to be relative to the user's splitscreen viewport. |
viewport_transform | vec4 | xy: viewport position, zw : viewport size, both are normalized between 0.0 and 1.0 (full window) |
Returns list: A list of [0: projected point x, 1: projected point y, 2: was the point pinned?, 3: vec2(min screen x, max screen x), 4: vec2(min screen y, max screen y)].