Render Settings
Render settings control output quality, background, and debug overlays. Access them via scene.render.
local render = scene.renderAnti-Aliasing
Section titled “Anti-Aliasing”render.antialiasing = "msaa4" -- "none" | "msaa2" | "msaa4" | "msaa8"| Mode | Description |
|---|---|
"none" | No anti-aliasing (fastest) |
"msaa2" | 2× multisample anti-aliasing |
"msaa4" | 4× multisample (good balance) |
"msaa8" | 8× multisample (highest quality) |
Background
Section titled “Background”Control what’s drawn behind the scene:
render.clear_mode = "color" -- "color" | "skybox" | "none"render.background_color = { r = 0.1, g = 0.1, b = 0.1, a = 1 }| Mode | Description |
|---|---|
"color" | Fill with background_color |
"skybox" | Use the environment sky settings |
"none" | Transparent (useful for compositing) |
Wireframe
Section titled “Wireframe”Toggle wireframe rendering for debugging geometry:
render.wireframe = true -- default falseRender Statistics
Section titled “Render Statistics”Read-only stats for profiling and debugging:
| Property | Type | Description |
|---|---|---|
render.draw_calls | number | Draw calls this frame |
render.triangle_count | number | Triangles rendered this frame |
render.vertex_count | number | Vertices processed this frame |
render.texture_memory | number | GPU texture memory in bytes |
render.fps | number | Current frames per second |
render.frame_time_ms | number | Time for the last frame in milliseconds |
-- Log performance statsprint(string.format( "FPS: %.0f | Draw calls: %d | Triangles: %d | VRAM: %.1f MB", render.fps, render.draw_calls, render.triangle_count, render.texture_memory / (1024 * 1024)))Example: Debug Setup
Section titled “Example: Debug Setup”local render = scene.render
-- Wireframe with solid backgroundrender.wireframe = truerender.clear_mode = "color"render.background_color = { r = 0.15, g = 0.15, b = 0.15, a = 1 }render.antialiasing = "none" -- wireframe doesn't need AA
-- Print stats every frameprint(string.format("Tris: %d, Draws: %d", render.triangle_count, render.draw_calls))Example: Production Quality
Section titled “Example: Production Quality”local render = scene.render
render.antialiasing = "msaa4"render.clear_mode = "skybox" -- use environment skyrender.wireframe = false