Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ the user's current request wins, followed by this file, then the subsystem docum
evidence, compatibility constraints and validation. The human creates the pull request, answers
review questions and takes responsibility for the submission; agent assistance does not transfer
that responsibility.


## Design philosophy

Equilibrium means simplicity and functionality in balance. Prefer the smallest design that
fully covers the feature:

- Reuse existing engine facilities (`IGraph`, containers, math helpers) instead of writing
parallel implementations.
- Data comes first: prefer simple data representations and reuse of existing data. Keep only
what is needed or what fits the task best, without sacrificing performance.
- Less code with the same behavior is the better solution; do not trade away required
functionality for brevity.

## Mandatory preflight

Before editing:
Expand Down
41 changes: 41 additions & 0 deletions core/materialsystem1/DefaultShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ BEGIN_SHADER_CLASS(
FixedArray<Vector4D, 4> bufferData;
bufferData.append(rendPassInfo->drawColor);
bufferData.append(GetTextureTransform(m_baseTextureTransformVar, m_baseTextureScaleVar));
AppendMaterialParams(bufferData, setupParams);

GPUBufferView cameraParamsBuffer;
for (const RenderBufferInfo& rendBuffer : setupParams.uniformBuffers)
Expand Down Expand Up @@ -211,8 +212,48 @@ BEGIN_SHADER_CLASS(
return setupParams.pipelineInfo.bindGroup[bindGroupId];
}

// the parameters of the derived shaders after the color and the texture transform
virtual void AppendMaterialParams(FixedArray<Vector4D, 4>& bufferData, const BindGroupSetupParams& setupParams) const {}

MatTextureProxy m_baseTexture;
mutable GPUBufferView m_currentCameraBuffer;
mutable int m_currentCameraId{ -1 };

END_SHADER_CLASS

//------------------------------------------------------------
// Debug overlay shader: the Default pipelines and bindings, the GPU shader draws
// the dash and pattern effects from the vertex data (see DebugOverlay.cpp)

namespace CDebugDrawShaderLocalNamespace {
static const char ThisClassNameStr[] = "DebugDraw";
static ArrayCRef<int> GetSupportedVertexLayoutIds()
{
static const int supportedFormats[] = { 0, SHADER_VERTEX_ID(DynMeshVertex) };
return ArrayCRef(supportedFormats);
}

class CDebugDrawShader : public CDefaultShaderLocalNamespace::CDefaultShader
{
public:
CDebugDrawShader(IMaterial* material) : CDefaultShader(material) {}

ArrayCRef<int> GetSupportedVertexLayoutIds() const override { return CDebugDrawShaderLocalNamespace::GetSupportedVertexLayoutIds(); }
const char* GetName() const override { return ThisClassNameStr; }
int GetNameHash() const override { return StringIdConst24("DebugDraw"); }

// the viewport size for the lines in pixels and the camera position for Lit
void AppendMaterialParams(FixedArray<Vector4D, 4>& bufferData, const BindGroupSetupParams& setupParams) const override
{
const IVector2D targetSize = setupParams.passContext.recorder->GetRenderTargetDimensions();
const float width = static_cast<float>(max(targetSize.x, 1));
const float height = static_cast<float>(max(targetSize.y, 1));
bufferData.append(Vector4D(width, height, 1.0f / width, 1.0f / height));

Matrix4x4 view;
g_matSystem->GetMatrix(MATRIXMODE_VIEW, view);
bufferData.append(Vector4D(inverse(view).getTranslationComponentTransposed(), 0.0f));
}
};
DEFINE_SHADER(ThisClassNameStr, CDebugDrawShader)
}
26 changes: 15 additions & 11 deletions core/materialsystem1/Renderers/NVRHI/NVRHICommandRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void CNVRHICommandRecorder::ClearBuffer(IGPUBuffer* buffer, int64 offset, int64
void CNVRHICommandRecorder::CopyTextureToTexture(const TextureCopyInfo& source, const TextureCopyInfo& destination, const TextureExtent& copySize) const
{
ASSERT(source.origin.x >= 0 && source.origin.y >= 0 && source.origin.arraySlice >= 0);
ASSERT(copySize.width >= 0 && copySize.height >= 0 && copySize.arraySize >= 0);
ASSERT(copySize.arraySize >= 0);

CNVRHITexture* srcTexture = static_cast<CNVRHITexture*>(source.texture);
CNVRHITexture* dstTexture = static_cast<CNVRHITexture*>(destination.texture);
Expand All @@ -122,25 +122,29 @@ void CNVRHICommandRecorder::CopyTextureToTexture(const TextureCopyInfo& source,
ASSERT_MSG(srcTexture->GetFlags() & TEXFLAG_COPY_SRC, "%s don't have TEXFLAG_COPY_SRC flag", srcTexture->GetName());
ASSERT_MSG(dstTexture->GetFlags() & TEXFLAG_COPY_DST, "%s don't have TEXFLAG_COPY_DST flag", dstTexture->GetName());

ASSERT_MSG(source.origin.x + copySize.width <= srcTexture->GetWidth() && source.origin.y + copySize.height >= srcTexture->GetHeight() && source.origin.arraySlice + copySize.arraySize <= srcTexture->GetArrayLayersSize(),
// a negative extent size copies the whole texture, like the TextureExtent defaults
const int copyWidth = copySize.width < 0 ? srcTexture->GetWidth() : copySize.width;
const int copyHeight = copySize.height < 0 ? srcTexture->GetHeight() : copySize.height;

ASSERT_MSG(source.origin.x + copyWidth <= srcTexture->GetWidth() && source.origin.y + copyHeight <= srcTexture->GetHeight() && source.origin.arraySlice + copySize.arraySize <= srcTexture->GetArrayLayersSize(),
"source texture origin and size outside of source texture size range");
ASSERT_MSG(destination.origin.x + copySize.width <= dstTexture->GetWidth() && destination.origin.y + copySize.height >= dstTexture->GetHeight() && destination.origin.arraySlice + copySize.arraySize <= dstTexture->GetArrayLayersSize(),
ASSERT_MSG(destination.origin.x + copyWidth <= dstTexture->GetWidth() && destination.origin.y + copyHeight <= dstTexture->GetHeight() && destination.origin.arraySlice + copySize.arraySize <= dstTexture->GetArrayLayersSize(),
"dest texture origin and size outside of dest texture size range");

nvrhi::TextureSlice rhiImageSrc{};
rhiImageSrc.width = copySize.width;
rhiImageSrc.height = copySize.height;
rhiImageSrc.width = copyWidth;
rhiImageSrc.height = copyHeight;
rhiImageSrc.mipLevel = source.origin.mipLevel;
rhiImageSrc.x = source.origin.x;
rhiImageSrc.y = source.origin.y;

nvrhi::TextureSlice rhiImageDst{};
rhiImageSrc.width = copySize.width;
rhiImageSrc.height = copySize.height;
rhiImageSrc.mipLevel = destination.origin.mipLevel;
rhiImageSrc.x = destination.origin.x;
rhiImageSrc.y = destination.origin.y;
rhiImageDst.width = copyWidth;
rhiImageDst.height = copyHeight;
rhiImageDst.mipLevel = destination.origin.mipLevel;
rhiImageDst.x = destination.origin.x;
rhiImageDst.y = destination.origin.y;

for(int i = 0; i < copySize.arraySize; ++i)
{
rhiImageSrc.arraySlice = source.origin.arraySlice + i;
Expand Down
55 changes: 55 additions & 0 deletions core/materialsystem1/Renderers/NVRHI/NVRHILibraryVK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ bool CNVRHIRenderLibVK::InitAPI(const ShaderAPIParams& params)
}
#endif

#ifdef NVRHI_WITH_VALIDATION
// synchronization validation reports buffer/image hazards that the default
// validation layer does not catch (write-after-read across submissions etc)
if (vulkan_validation.GetBool() && arrayFindIndex(m_optionalExtensions.instance, VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME) != -1)
{
m_enabledExtensions.instance.append(VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME);
m_validationFeatures.setEnabledValidationFeatures({ 1u, &m_syncValidationEnable });
m_useSyncValidation = true;
}
#endif

Array<const char*> vkInstExtNames(PP_SL);
Array<const char*> vkLayerNames(PP_SL);

Expand Down Expand Up @@ -311,6 +322,11 @@ bool CNVRHIRenderLibVK::InitAPI(const ShaderAPIParams& params)
.setPpEnabledExtensionNames(vkInstExtNames.ptr())
.setPApplicationInfo(&applicationInfo);

#ifdef NVRHI_WITH_VALIDATION
if (m_useSyncValidation)
info.setPNext(&m_validationFeatures);
#endif

const vk::Result res = vk::createInstance(&info, nullptr, &m_vkInstance);
if (res != vk::Result::eSuccess)
{
Expand Down Expand Up @@ -453,6 +469,12 @@ bool CNVRHIRenderLibVK::InitAPI(const ShaderAPIParams& params)
m_nvrhiFrameWaitQuery = m_nvrhiDevice->createEventQuery();
m_nvrhiDevice->setEventQuery(m_nvrhiFrameWaitQuery, nvrhi::CommandQueue::Graphics);

// the presentation waits these semaphores, which are signaled by an empty
// submission at the end of every frame (see EndFrame); one per frame in flight
for (VkSemaphore& semaphore : m_framePresentSemaphores)
semaphore = m_vkDevice.createSemaphore(vk::SemaphoreCreateInfo());
m_nvrhiFramePresentCmdList = m_nvrhiDevice->createCommandList();

return true;
}

Expand Down Expand Up @@ -584,6 +606,13 @@ bool CNVRHIRenderLibVK::FindQueueFamilies(vk::PhysicalDevice vkPhysicalDevice, v
const bool enableComputeQueue = false;
const bool enableCopyQueue = false;

// this may be called multiple times (device probing and the final call for the
// picked device), so the families must be rediscovered from scratch
m_vkGraphicsQueueFamily = -1;
m_vkComputeQueueFamily = -1;
m_vkTransferQueueFamily = -1;
m_vkPresentQueueFamily = -1;

auto queueFamiliyProps = vkPhysicalDevice.getQueueFamilyProperties();

for (int i = 0; i < int(queueFamiliyProps.size()); i++)
Expand Down Expand Up @@ -873,6 +902,17 @@ void CNVRHIRenderLibVK::ExitAPI()
CNVRHIRenderAPI::Instance.m_rhiDevice = nullptr;
m_nvrhiDevice = nullptr;
m_nvrhiFrameWaitQuery = nullptr;
m_nvrhiFramePresentCmdList = nullptr;
m_framePresentSemaphore = nullptr;

for (VkSemaphore& semaphore : m_framePresentSemaphores)
{
if (semaphore)
{
m_vkDevice.destroySemaphore(semaphore);
semaphore = nullptr;
}
}

if (m_vkDebugReportCallback)
m_vkInstance.destroyDebugReportCallbackEXT(m_vkDebugReportCallback);
Expand Down Expand Up @@ -923,6 +963,21 @@ void CNVRHIRenderLibVK::EndFrame()
stats.textureUpdateCount = 0;

g_renderWorker.Execute(__func__, [this]() {
// signal the frame-present semaphore from an empty submission: queue submissions
// execute in order, so it completes only after every pass of this frame, and the
// present (which waits it) cannot show a partially rendered image
if (m_nvrhiFramePresentCmdList)
{
VkSemaphore vkFramePresentSemaphore = m_framePresentSemaphores[m_framePresentSemaphoreIdx];
m_framePresentSemaphoreIdx = (m_framePresentSemaphoreIdx + 1) % uint32_t(std::size(m_framePresentSemaphores));
m_framePresentSemaphore = vkFramePresentSemaphore;
m_nvrhiDevice->queueSignalSemaphore(nvrhi::CommandQueue::Graphics, vkFramePresentSemaphore, 0);

m_nvrhiFramePresentCmdList->open();
m_nvrhiFramePresentCmdList->close();
m_nvrhiDevice->executeCommandList(m_nvrhiFramePresentCmdList);
}

m_currentSwapChain->SwapBuffers();

const int bufferCount = 3;// m_currentSwapChain->m_rhiSwapChainTextures.numElem();
Expand Down
13 changes: 13 additions & 0 deletions core/materialsystem1/Renderers/NVRHI/NVRHILibraryVK.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,22 @@ class CNVRHIRenderLibVK
PFN_vkGetInstanceProcAddr m_vkGetInstanceProcAddr = nullptr;
nvrhi::vulkan::DeviceHandle m_nvrhiDevice;
nvrhi::EventQueryHandle m_nvrhiFrameWaitQuery;
// signaled by an empty submission at the end of the frame, the presentation
// waits it so the late passes (console, HUD) don't race the present;
// rotated per frame in flight (same scheme as the swapchain semaphores)
VkSemaphore m_framePresentSemaphores[3];
uint32_t m_framePresentSemaphoreIdx = 0;
// the semaphore signaled for the current frame (set in EndFrame before the present)
VkSemaphore m_framePresentSemaphore = nullptr;
nvrhi::CommandListHandle m_nvrhiFramePresentCmdList;

vk::Instance m_vkInstance;
vk::DebugReportCallbackEXT m_vkDebugReportCallback;
#ifdef NVRHI_WITH_VALIDATION
vk::ValidationFeaturesEXT m_validationFeatures;
vk::ValidationFeatureEnableEXT m_syncValidationEnable{ vk::ValidationFeatureEnableEXT::eSynchronizationValidation };
bool m_useSyncValidation{ false };
#endif
vk::PhysicalDevice m_vkPhysicalDevice;
vk::Device m_vkDevice;
vk::Queue m_vkGraphicsQueue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static void NVRHIBeginRenderPass(const RenderPassDesc& renderPassDesc, nvrhi::Co
.setTexture(depthTexture->GetNVRHITextureHandle())
.setReadOnly(renderPassDesc.depthReadOnly);

rhiFramebufferDesc.setDepthAttachment(depthTexture->GetNVRHITextureHandle());
rhiFramebufferDesc.setDepthAttachment(rhiDepthAttachment);

const bool clearDepth = !renderPassDesc.depthReadOnly && renderPassDesc.depthLoadOp == LOADFUNC_CLEAR;
const bool clearStencil = !renderPassDesc.stencilReadOnly && IsStencilFormat(renderPassDesc.depthStencil.texture->GetFormat()) && renderPassDesc.stencilLoadOp == LOADFUNC_CLEAR;
Expand Down
19 changes: 12 additions & 7 deletions core/materialsystem1/Renderers/NVRHI/NVRHISwapChainVK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,23 @@ bool CNVRHISwapChainVK::SetBackbufferSize(int wide, int tall)

bool CNVRHISwapChainVK::SwapBuffers()
{
nvrhi::vulkan::DeviceHandle nvrhiDevice = CNVRHIRenderLibVK::Instance->m_nvrhiDevice;
CNVRHIRenderLibVK* renderLib = CNVRHIRenderLibVK::Instance;

// the per-image semaphore is signaled by the FIRST Graphics submission of the frame
// (BeginFrame registers the signal), while the actual rendering is submitted later;
// additionally wait for the frame-present semaphore, which the render library signals
// with an empty submission at the end of the frame, or the last drawn passes
// (console, HUD) race the presentation
vk::Semaphore vkWaitSemaphores[2] = { m_vkCurrentPresentSemaphore, renderLib->m_framePresentSemaphore };

void* pNext = nullptr;
vk::PresentInfoKHR info = vk::PresentInfoKHR()
.setWaitSemaphoreCount(1)
.setPWaitSemaphores(&m_vkCurrentPresentSemaphore)
.setWaitSemaphoreCount(2)
.setPWaitSemaphores(vkWaitSemaphores)
.setSwapchainCount(1)
.setPSwapchains(&m_vkSwapChain)
.setPImageIndices(&m_swapChainBufferIndex)
.setPNext(pNext);
.setPImageIndices(&m_swapChainBufferIndex);

const vk::Result res = CNVRHIRenderLibVK::Instance->m_vkPresentQueue.presentKHR(&info);
const vk::Result res = renderLib->m_vkPresentQueue.presentKHR(&info);
ASSERT_MSG(res == vk::Result::eSuccess || res == vk::Result::eErrorOutOfDateKHR || res == vk::Result::eSuboptimalKHR, "Present failure");

// no semaphore rotation here: m_vkCurrentPresentSemaphore is selected
Expand Down
14 changes: 9 additions & 5 deletions core/materialsystem1/Renderers/WGPU/WGPUCommandRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CWGPUCommandRecorder::ClearBuffer(IGPUBuffer* buffer, int64 offset, int64 s
void CWGPUCommandRecorder::CopyTextureToTexture(const TextureCopyInfo& source, const TextureCopyInfo& destination, const TextureExtent& copySize) const
{
ASSERT(source.origin.x >= 0 && source.origin.y >= 0 && source.origin.arraySlice >= 0);
ASSERT(copySize.width >= 0 && copySize.height >= 0 && copySize.arraySize >= 0);
ASSERT(copySize.arraySize >= 0);

CWGPUTexture* srcTexture = static_cast<CWGPUTexture*>(source.texture);
CWGPUTexture* dstTexture = static_cast<CWGPUTexture*>(destination.texture);
Expand All @@ -94,9 +94,13 @@ void CWGPUCommandRecorder::CopyTextureToTexture(const TextureCopyInfo& source, c
ASSERT_MSG(srcTexture->GetFlags() & TEXFLAG_COPY_SRC, "%s don't have TEXFLAG_COPY_SRC flag", srcTexture->GetName());
ASSERT_MSG(dstTexture->GetFlags() & TEXFLAG_COPY_DST, "%s don't have TEXFLAG_COPY_DST flag", dstTexture->GetName());

ASSERT_MSG(source.origin.x + copySize.width <= srcTexture->GetWidth() && source.origin.y + copySize.height >= srcTexture->GetHeight() && source.origin.arraySlice + copySize.arraySize <= srcTexture->GetArrayLayersSize(),
// a negative extent size copies the whole texture, like the TextureExtent defaults
const int copyWidth = copySize.width < 0 ? srcTexture->GetWidth() : copySize.width;
const int copyHeight = copySize.height < 0 ? srcTexture->GetHeight() : copySize.height;

ASSERT_MSG(source.origin.x + copyWidth <= srcTexture->GetWidth() && source.origin.y + copyHeight <= srcTexture->GetHeight() && source.origin.arraySlice + copySize.arraySize <= srcTexture->GetArrayLayersSize(),
"source texture origin and size outside of source texture size range");
ASSERT_MSG(destination.origin.x + copySize.width <= dstTexture->GetWidth() && destination.origin.y + copySize.height >= dstTexture->GetHeight() && destination.origin.arraySlice + copySize.arraySize <= dstTexture->GetArrayLayersSize(),
ASSERT_MSG(destination.origin.x + copyWidth <= dstTexture->GetWidth() && destination.origin.y + copyHeight <= dstTexture->GetHeight() && destination.origin.arraySlice + copySize.arraySize <= dstTexture->GetArrayLayersSize(),
"dest texture origin and size outside of dest texture size range");

WGPUTexelCopyTextureInfo rhiImageSrc{};
Expand All @@ -113,8 +117,8 @@ void CWGPUCommandRecorder::CopyTextureToTexture(const TextureCopyInfo& source, c

WGPUExtent3D rhiCopySize;
rhiCopySize.depthOrArrayLayers = copySize.arraySize;
rhiCopySize.width = copySize.width;
rhiCopySize.height = copySize.height;
rhiCopySize.width = copyWidth;
rhiCopySize.height = copyHeight;

wgpuCommandEncoderCopyTextureToTexture(m_rhiCommandEncoder, &rhiImageSrc, &rhiImageDst, &rhiCopySize);

Expand Down
45 changes: 41 additions & 4 deletions docs/public_rendering_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,51 @@ if (snd_scriptsound_debug.GetBool())
| Builder | Shape | Setters |
|---|---|---|
| `DbgText3D()` | Text at a 3D position | `Text(fmt, ...)`, `Position`, `Distance` (max visible distance), `Color` |
| `DbgLine()` | Line | `Start`, `End`, `Color`, `ColorStart`, `ColorEnd` |
| `DbgBox()` | Axis-aligned box | `Box(bbox)`, `Mins`, `Maxs`, `CenterSize`, `Color`, `Fill` |
| `DbgLine()` | Line | `Start`, `End`, `Color`, `ColorStart`, `ColorEnd`, `Width` (pixels, up to 1 is a regular line), `Dash` (dash and gap length in pixels, 0 is solid) |
| `DbgBox()` | Axis-aligned box | `Box(bbox)`, `Mins`, `Maxs`, `CenterSize`, `Color`, `Fill`, `Lit` |
| `DbgOriBox()` | Oriented box | box setters + `Position`, `Rotation(quaternion)` |
| `DbgSphere()` | Sphere | `Position`, `Radius`, `Color`, `Fill` |
| `DbgSphere()` | Sphere | `Position`, `Radius`, `Color`, `Fill`, `Lit` |
| `DbgCylinder()` | Cylinder | `Position`, `Radius`, `Height`, `Color` |
| `DbgPoly()` | Polygon (up to 20 points) | `Point`, `Points`, `ClipPlane(plane, origin, size)`, `Color`, `Fill`, `Outline` |
| `DbgPoly()` | Polygon (up to 20 points) | `Point`, `Points`, `ClipPlane(plane, origin, size)`, `Color`, `Fill`, `Outline`, `Lit` |
| `DbgVolume()` | Convex volume from planes | `Planes`, `Volume(volume)`, `Color` |

`Width(px)` sets the line thickness in pixels: a line wider than one pixel is drawn as a quad
expanded in screen space and keeps its pixel width at any distance, otherwise it is a regular line.

The 3D primitives are drawn with the `DebugDraw` shader (`core/materialsystem1/DefaultShader.cpp`,
GPU source `E2Base/shadersSRC/source_DebugDraw.fx`): the `Default` shader pipelines and bindings plus
the viewport size and the camera position in the material parameters. The effects add no geometry:
the effect of a primitive is packed into its `DynMeshVertex` vertices by `DbgSetupEffect` and
`DbgLineVertex` in `shared/render/DebugOverlay.cpp`:

| Vertex value | Lines | Other primitives |
|---|---|---|
| `_position.xyz` | Line end | Position |
| `_position.w` | Thick line width in pixels, the sign is the quad side; `0` for a regular line | — |
| `_normal.xyz` (half) | Vector to the other end | `0` |
| `_normal.w` (half) | `Dash` in pixels, negative at the end vertices | `Lit` |
| `_texCoord.x` (half) | `pattern * 256 + size` (pattern size in whole pixels up to 255) | same |
| `_texCoord.y` (half) | `GapAlpha` | same |

The vertex shader clips a line by the camera (the vertex behind it moves to the clip point), expands
a thick line across its screen direction and passes the dash start on screen: the line start, or
its end when the start is behind the camera. The dashes stay in place at that point when the
camera moves.

Effect setters of the 3D builders (all but `DbgText3D` and `DbgVolume`):

- `Pattern(pattern, sizePx = 4)` — screen-space transparency pattern: `DBG_PATTERN_CHECKER`,
`DBG_PATTERN_HATCH` (diagonal stripes), `DBG_PATTERN_DOTS`.
- `GapAlpha(alpha)` — alpha multiplier of the pattern holes and the dash gaps, `0` (default) cuts
them out.
- `Occluded(pattern = DBG_PATTERN_HATCH)` — the parts behind the scene geometry are drawn too, with
this pattern (`DBG_PATTERN_NONE` draws them solid). The overlay draws the primitives in two
passes: the visible parts, then the occluded parts with the inverted depth test.
- `Lit()` of the filled boxes, spheres and polygons — shades the faces by the angle to the camera
(the face normal comes from the screen derivatives of the world position).

Scripts get the same setters and the `DBG_PATTERN_*` constants.

Common setters (call them last, they return the base builder):

- `Time(seconds)` — keep the primitive visible for the given time; `0` (default) — one frame.
Expand Down
Loading
Loading