Renderer & Drawing Modes
Control face selection, visibility, lighting, occlusion, and the TradingView primitive backend used to carry projected 3D geometry.
One call per frame
p3d.render(scene,
maxFaces = 100,
culling = true,
lighting = false,
ambient = 0.3,
wireframe = false,
occlusion = true,
occlusionRaster = 768)Frame pipeline
World transform, camera transform, back-face culling, occlusion culling, depth sorting, lighting and shadows, perspective projection, then drawing output.
Renderer parameters
| Parameter | Default | Purpose |
|---|---|---|
maxFaces | 100 | Caps solid faces. Contour paths, wireframes, and overlays use their own drawing budgets. |
culling | true | Removes back-facing polygons. |
lighting | false | Enables diffuse shading and scene light evaluation. |
ambient | 0.3 | Sets minimum face brightness when passed explicitly. |
wireframe | false | Forces scene-wide outline output. |
occlusion | true | Drops hidden faces with a sparse raster pass. |
occlusionRaster | 768 | Sets occlusion buffer resolution. Lower values are faster and coarser. |
Mesh styles
| Style | Result |
|---|---|
| solid | Filled faces. |
| wireframe | All edges with no fill, including interior geometry. |
| wireframe_front | Front-facing edges only for a cleaner convex silhouette. |
Solid-face draw modes
linefill
The recommended backend uses lines and linefills with adaptive rail sharing. Adjacent coplanar faces can reuse an edge rail, increasing practical face capacity. It supports in-place updateSurface() and updateBars().
poly
The legacy polyline backend supports styled solid-face outlines but has lower capacity and no in-place surface or bar updates. Use it only when those visible outlines are required.
Drawing clear behavior
At the start of every call, render clears chart polylines, lines, labels, and linefills before emitting the current frame.
- Create manual drawing objects after rendering if they must remain.
- Tables are not cleared and work well for debug or budget monitors.
- Explicit render arguments override matching scene-light settings for that frame.