Class TriPlanarBlock
Hierarchy (View Summary)
- NodeMaterialBlock
- TriPlanarBlock
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Create a new TriPlanarBlock
Parameters
- name: string
defines the block name
- hideSourceZ: boolean = false
defines a boolean indicating that normal Z should not be used (false by default)
Returns TriPlanarBlock
- name: string
Properties
comments
Gets or sets the comments associated with this block
disable Level Multiplication
Gets or sets a boolean indicating if multiplication of texture with level should be disabled
inputs Are Exclusive
Gets or sets a boolean indicating that only one input can be connected at a time
on Code Is Ready Observable
Observable raised when the block code is ready (if the code loading is async)
project As Cube
Project the texture(s) for a better fit to a cube
unique Id
Gets or sets the unique id of the node
visible In Inspector
Gets or sets a boolean indicating that this input can be edited in the Inspector (false by default)
visible On Frame
Gets or sets a boolean indicating that this input can be edited from a collapsed frame
Accessors
a
-
Gets the a output component
Returns NodeMaterialConnectionPoint
b
-
Gets the b output component
Returns NodeMaterialConnectionPoint
build Id
-
get buildId(): number
Gets or sets the build Id
Returns number
-
set buildId(value: number): void
Parameters
- value: number
Returns void
code Is Ready
-
get codeIsReady(): boolean
Gets a boolean indicating that this block has is code ready to be used
Returns boolean
convert To Gamma Space
-
get convertToGammaSpace(): boolean
Returns boolean
-
set convertToGammaSpace(value: boolean): void
Gets or sets a boolean indicating if content needs to be converted to gamma space
Parameters
- value: boolean
Returns void
convert To Linear Space
-
get convertToLinearSpace(): boolean
Returns boolean
-
set convertToLinearSpace(value: boolean): void
Gets or sets a boolean indicating if content needs to be converted to linear space
Parameters
- value: boolean
Returns void
g
-
Gets the g output component
Returns NodeMaterialConnectionPoint
has Image Source
-
get hasImageSource(): boolean
Gets a boolean indicating that this block is linked to an ImageSourceBlock
Returns boolean
inputs
-
Gets the list of input points
Returns NodeMaterialConnectionPoint[]
is Final Merger
-
get isFinalMerger(): boolean
Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)
Returns boolean
is Input
-
get isInput(): boolean
Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)
Returns boolean
is Loop
-
get isLoop(): boolean
Gets a boolean indicating if this block is a loop
Returns boolean
is Teleport In
-
get isTeleportIn(): boolean
Gets a boolean indicating if this block is a teleport in
Returns boolean
is Teleport Out
-
get isTeleportOut(): boolean
Gets a boolean indicating if this block is a teleport out
Returns boolean
is Unique
-
get isUnique(): boolean
Gets a boolean indicating that this block can only be used once per NodeMaterial
Returns boolean
level
-
Gets the level output component
Returns NodeMaterialConnectionPoint
name
-
get name(): string
Gets the name of the block
Returns string
-
set name(newName: string): void
Sets the name of the block. Will check if the name is valid.
Parameters
- newName: string
Returns void
normal
-
Gets the normal input component
Returns NodeMaterialConnectionPoint
outputs
-
Gets the list of output points
Returns NodeMaterialConnectionPoint[]
position
-
Gets the position input component
Returns NodeMaterialConnectionPoint
r
-
Gets the r output component
Returns NodeMaterialConnectionPoint
rgb
-
Gets the rgb output component
Returns NodeMaterialConnectionPoint
rgba
-
Gets the rgba output component
Returns NodeMaterialConnectionPoint
sampler Name
-
get samplerName(): string
Gets the sampler name associated with this texture
Returns string
sampler Y Name
-
Gets the samplerY name associated with this texture
Returns Nullable<string>
sampler Z Name
-
Gets the samplerZ name associated with this texture
Returns Nullable<string>
sharpness
-
Gets the sharpness input component
Returns NodeMaterialConnectionPoint
source
-
Gets the source input component
Returns NodeMaterialConnectionPoint
source Y
-
Gets the sourceY input component
Returns NodeMaterialConnectionPoint
source Z
-
Gets the sourceZ input component
Returns Nullable<NodeMaterialConnectionPoint>
target
-
Gets or sets the target of the block
Returns NodeMaterialBlockTargets
-
Parameters
- value: NodeMaterialBlockTargets
Returns void
texture
texture Y
texture Z
will Be Generated Into Vertex Shader From Fragment Shader
-
get willBeGeneratedIntoVertexShaderFromFragmentShader(): boolean
Gets a boolean indicating that the code of this block will be promoted to vertex shader even if connected to fragment output
Returns boolean
Methods
_ deserialize
-
Deserializes the block from a serialization object
Parameters
- serializationObject: any
the object to deserialize from
- scene: Scene
the current scene
- rootUrl: string
the root URL for loading
Returns void
- serializationObject: any
auto Configure
-
autoConfigure(
material: NodeMaterial,
additionalFilteringInfo?: (node: NodeMaterialBlock) => boolean,
): voidLets the block try to connect some inputs automatically
Parameters
- material: NodeMaterial
defines the hosting NodeMaterial
- additionalFilteringInfo: (node: NodeMaterialBlock) => boolean = ...
optional additional filtering condition when looking for compatible blocks
Returns void
- material: NodeMaterial
bind
build
-
Compile the current node and generate the shader code
Parameters
- state: NodeMaterialBuildState
defines the current compilation state (uniforms, samplers, current string)
- activeBlocks: NodeMaterialBlock[]
defines the list of active blocks (i.e. blocks to compile)
Returns boolean
true if already built
- state: NodeMaterialBuildState
clone
-
Clone the current block to a new identical block
Parameters
- scene: Scene
defines the hosting scene
- rootUrl: string = ""
defines the root URL to use to load textures and relative dependencies
Returns NodeMaterialBlock | null
a copy of the current block
- scene: Scene
connect To
-
connectTo(
other: NodeMaterialBlock,
options?: { input?: string; output?: string; outputSwizzle?: string },
): TriPlanarBlock | undefinedConnect current block with another block
Parameters
- other: NodeMaterialBlock
defines the block to connect with
Optionaloptions: { input?: string; output?: string; outputSwizzle?: string }define the various options to help pick the right connections
Returns TriPlanarBlock | undefined
the current block
- other: NodeMaterialBlock
dispose
-
Release resources
Returns void
get Class Name
-
Gets the current class name
Returns string
the class name
get First Available Input
-
getFirstAvailableInput(
forOutput?: Nullable<NodeMaterialConnectionPoint>,
): NodeMaterialConnectionPoint | nullWill return the first available input e.g. the first one which is not an uniform or an attribute
Parameters
- forOutput: Nullable<NodeMaterialConnectionPoint> = null
defines an optional connection point to check compatibility with
Returns NodeMaterialConnectionPoint | null
the first available input or null
- forOutput: Nullable<NodeMaterialConnectionPoint> = null
get First Available Output
-
getFirstAvailableOutput(
forBlock?: Nullable<NodeMaterialBlock>,
): NodeMaterialConnectionPoint | nullWill return the first available output e.g. the first one which is not yet connected and not a varying
Parameters
- forBlock: Nullable<NodeMaterialBlock> = null
defines an optional block to check compatibility with
Returns NodeMaterialConnectionPoint | null
the first available input or null
- forBlock: Nullable<NodeMaterialBlock> = null
get Input By Name
-
Find an input by its name
Parameters
- name: string
defines the name of the input to look for
Returns NodeMaterialConnectionPoint | null
the input or null if not found
- name: string
get Output By Name
-
Find an output by its name
Parameters
- name: string
defines the name of the output to look for
Returns NodeMaterialConnectionPoint | null
the output or null if not found
- name: string
get Sibling Output
-
Gets the sibling of the given output
Parameters
- current: NodeMaterialConnectionPoint
defines the current output
Returns NodeMaterialConnectionPoint | null
the next output in the list or null
- current: NodeMaterialConnectionPoint
initialize
-
Initialize the block and prepare the context for build
Parameters
- state: NodeMaterialBuildState
defines the state that will be used for the build
Returns void
- state: NodeMaterialBuildState
initialize Defines
-
Initialize defines for shader compilation
Parameters
- defines: NodeMaterialDefines
defines the material defines to update
Returns void
- defines: NodeMaterialDefines
is An Ancestor Of
-
Checks if the current block is an ancestor of a given block
Parameters
- block: NodeMaterialBlock
defines the potential descendant block to check
Returns boolean
true if block is a descendant
- block: NodeMaterialBlock
is Connected In Fragment Shader
-
Gets a boolean indicating that this connection will be used in the fragment shader
Returns boolean
true if connected in fragment shader
is Ready
-
Checks if the block is ready
Returns boolean
true if the block is ready
prepare Defines
-
Prepares the defines for the block
Parameters
- defines: NodeMaterialDefines
the defines to prepare
Returns void
- defines: NodeMaterialDefines
provide Fallbacks
-
Add potential fallbacks if shader compilation fails
Parameters
- fallbacks: EffectFallbacks
defines the current prioritized list of fallbacks
Optionalmesh: AbstractMeshdefines the mesh to be rendered
Returns void
- fallbacks: EffectFallbacks
register Input
-
registerInput(
name: string,
type: NodeMaterialBlockConnectionPointTypes,
isOptional?: boolean,
target?: NodeMaterialBlockTargets,
point?: NodeMaterialConnectionPoint,
): TriPlanarBlockRegister a new input. Must be called inside a block constructor
Parameters
- name: string
defines the connection point name
- type: NodeMaterialBlockConnectionPointTypes
defines the connection point type
- isOptional: boolean = false
defines a boolean indicating that this input can be omitted
Optionaltarget: NodeMaterialBlockTargetsdefines the target to use to limit the connection point (will be VertexAndFragment by default)
Optionalpoint: NodeMaterialConnectionPointan already created connection point. If not provided, create a new one
Returns TriPlanarBlock
the current block
- name: string
register Output
-
registerOutput(
name: string,
type: NodeMaterialBlockConnectionPointTypes,
target?: NodeMaterialBlockTargets,
point?: NodeMaterialConnectionPoint,
): TriPlanarBlockRegister a new output. Must be called inside a block constructor
Parameters
- name: string
defines the connection point name
- type: NodeMaterialBlockConnectionPointTypes
defines the connection point type
Optionaltarget: NodeMaterialBlockTargetsdefines the target to use to limit the connection point (will be VertexAndFragment by default)
Optionalpoint: NodeMaterialConnectionPointan already created connection point. If not provided, create a new one
Returns TriPlanarBlock
the current block
- name: string
replace Repeatable Content
-
replaceRepeatableContent(
vertexShaderState: NodeMaterialBuildState,
defines: NodeMaterialDefines,
mesh?: AbstractMesh,
): voidFunction called when a block is declared as repeatable content generator
Parameters
- vertexShaderState: NodeMaterialBuildState
defines the current compilation state for the vertex shader
- defines: NodeMaterialDefines
defines the material defines to update
Optionalmesh: AbstractMeshdefines the mesh to be rendered
Returns void
- vertexShaderState: NodeMaterialBuildState
serialize
-
Serializes the block
Returns any
the serialized object
update Uniforms And Samples
-
updateUniformsAndSamples(
state: NodeMaterialBuildState,
nodeMaterial: NodeMaterial,
defines: NodeMaterialDefines,
uniformBuffers: string[],
): voidAdd uniforms, samplers and uniform buffers at compilation time
Parameters
- state: NodeMaterialBuildState
defines the state to update
- nodeMaterial: NodeMaterial
defines the node material requesting the update
- defines: NodeMaterialDefines
defines the material defines to update
- uniformBuffers: string[]
defines the list of uniform buffer names
Returns void
- state: NodeMaterialBuildState
validate Block Name
-
Validates the new name for the block node.
Parameters
- newName: string
the new name to be given to the node.
Returns boolean
false if the name is a reserve word, else true.
- newName: string
Block used to read a texture with triplanar mapping (see "boxmap" in https://iquilezles.org/articles/biplanar/)