Pass
ClassControls how a mesh will get rendered.
- Available on all platforms
Controls how a mesh will get rendered. Each Pass acts as an interface for the shader it's associated with.
Any properties on a Pass's shader will automatically become properties on that Pass.
For example, if the shader defines a variable named baseColor, a script would be able to access that property as material.mainPass.baseColor.
Index
Properties
Methods
Example
var sprite = script.getSceneObject().getFirstComponent(SpriteVisual.getTypeName());
var pass = sprite.mainPass;
pass.baseTex.control.play(-1,0.0);
Extends
Indexable
[
index:string]:any
Properties
blendMode
blendMode:
BlendMode
The blend mode used for rendering. Possible values:
| BlendMode | Value | Expression |
|---|---|---|
| Normal | 0 | SrcAlpha, OneMinusSrcAlpha |
| MultiplyLegacy [DEPRECATED] | 1 | DstColor, OneMinusSrcAlpha |
| AddLegacy [DEPRECATED] | 2 | One, One |
| Screen | 3 | One, OneMinusSrcColor |
| PremultipliedAlpha | 4 | One, OneMinusSrcAlpha |
| AlphaToCoverage | 5 | Blend Disabled |
| Disabled | 6 | Blend Disabled |
| Add | 7 | SrcAlpha, One |
| AlphaTest | 8 | Blend Disabled |
| ColoredGlass | 9 | Blend Disabled |
| Multiply | 10 | DstColor, Zero |
| Min | 11 | One, One |
| Max | 12 | One, One |
// Sets the blend mode of the main pass for a material to Screen
//@input Asset.Material material
script.material.mainPass.blendMode = 3;
Default Value
BlendMode.Disabled
colorMask
colorMask:
vec4b
Controls the masking of color channels with a vec4b representing each channel with a boolean.
Default Value
(true, true, true, false)
cullMode
cullMode:
CullMode
The cull mode used for rendering.
Default Value
CullMode.Back
depthTest
depthTest:
boolean
Enables depth-sorting.
Default Value
true
depthWrite
depthWrite:
boolean
Enables writing pixels to the depth buffer.
Default Value
true
frustumCullMax
frustumCullMax:
vec3
Set max corner of aabb. It only applys when user selects FrustumCullMode.UserDefinedAABB
Default Value
(-Infinity, -Infinity, -Infinity)
frustumCullMin
frustumCullMin:
vec3
Set min corner of aabb. It only applys when user selects FrustumCullMode.UserDefinedAABB
Default Value
(Infinity, Infinity, Infinity)
frustumCullMode
frustumCullMode:
FrustumCullMode
Mode for setting frustum culling on Pass
Default Value
FrustumCullMode.Auto
frustumCullPad
frustumCullPad:
number
Extend render object's aabb to (1 + value). Only applys when user select FrustumCullMode.Extend
Since
Lens Scripting Version 153
Default Value
0
instanceCount
instanceCount:
number
Number of times the pass will be rendered. Useful with the Instance ID node in Material Editor.
Default Value
1
lineWidth
lineWidth:
number
Line width used for rendering.
Default Value
1
name
name:
string
The name of the Pass.
Default Value
""
polygonOffset
polygonOffset:
vec2
Changes the position that each polygon gets drawn.
Default Value
(0, 0)
samplers
readonlysamplers:SamplerWrappers
Returns texture samplers used by this pass to set filtering and wrap modes.
stencilState
stencilState:
StencilState
The stencil test state for Pass.
twoSided
twoSided:
boolean
Whether the material renders on both sides of a mesh face.
Default Value
false
Methods
getTypeName()
staticgetTypeName():TypeName<Pass>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<Pass>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean