StaticgetReturns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Draws asset into the caller-owned render target target. The composite is
drawn directly into the RenderTargetProvider backing that
Texture; that same Texture can then be used directly on a Material
(e.g. as baseTex) — there is no separate publish step.
target must be a Render Target Texture — created in Lens Studio, or at runtime
with Scene#createRenderTargetTexture (or Camera.renderTarget).
Clearing is controlled by RenderRequest#clear (default: clear first); the render target's own clear-color options do not affect this draw.
Edge anti-aliasing follows the render target's authored
RenderTargetProvider#antialiasingMode and
RenderTargetProvider#antialiasingQuality: Disabled draws single-sample
(edges alias); any other mode draws the composite with MSAA at the quality's
sample count (Low is 2x; Medium/High/Ultra are 4x), clamped to what the
device supports. Temporal and post-process modes need a camera, so TAA, FXAA and
SMAA also map to MSAA here; MSAAStrategy does not apply.
Pass a RenderRequest to place, clip, or select a source sub-region of
asset, or a fresh one for the defaults (whole target, full source, cleared
first). request is required — pass null to take the defaults. Executes on
the render thread; asset must be ready (asset.isReady). Throws if target
or asset is null, asset is not ready, or target is not a Render Target
Texture.
The caller-owned render destination: a Render Target Texture.
The vector asset to draw (must be ready).
Draw options as a RenderRequest, or null for the default
placement, region, and clear behavior. Required.
//@input Asset.VectorComposite mySvg
//@input Asset.Texture rt // a Render Target Texture created in Lens Studio, also used on an Image's Material
var renderer = new VectorRenderer();
// `request` is required; a fresh RenderRequest carries the defaults.
var req = new VectorComposite.RenderRequest();
script.mySvg.ready().then(function () {
script.createEvent("UpdateEvent").bind(function () {
// The vector output appears wherever `rt` is sampled.
renderer.render(script.rt, script.mySvg, req);
});
});
Draws a vector composite into a caller-owned render-target Texture. A VectorRenderer is stateless — one renderer can draw many assets into many targets, and VectorRenderer#render is cheap to call every frame because it replays the asset's already-tessellated geometry.
The destination is a standard Studio render-target Texture: create one at runtime with Scene#createRenderTargetTexture (then size it through its RenderTargetProvider
control), or author one in Studio (an@input Asset.TextureRender Target, orCamera.renderTarget). Sampling that same Texture (a materialbaseTex, a screen image, a post effect) reflects the vector output through the normal render-graph consumption path.Since
Lens Scripting Version 368
Snap OS
Example