Rendering & Light

Renderer & Drawing Modes

Control face selection, visibility, lighting, occlusion, and the TradingView primitive backend used to carry projected 3D geometry.

Updated Publisher Alien_AlgorithmsPine Script v6

One call per frame

Renderer signaturepine
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

ParameterDefaultPurpose
maxFaces100Caps solid faces. Contour paths, wireframes, and overlays use their own drawing budgets.
cullingtrueRemoves back-facing polygons.
lightingfalseEnables diffuse shading and scene light evaluation.
ambient0.3Sets minimum face brightness when passed explicitly.
wireframefalseForces scene-wide outline output.
occlusiontrueDrops hidden faces with a sparse raster pass.
occlusionRaster768Sets occlusion buffer resolution. Lower values are faster and coarser.

Mesh styles

StyleResult
solidFilled faces.
wireframeAll edges with no fill, including interior geometry.
wireframe_frontFront-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.

Wireframes are independent
Wireframe styles always use line primitives regardless of the solid-face draw mode.

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.
Pine3D is a graphical rendering library for Pine Script. TradingView drawing, execution, and publication limits still apply. © Alien_Algorithms.