Class GreasedLinePluginMaterial
Hierarchy
- MaterialPluginBase
- GreasedLinePluginMaterial
Implements
Index
Constructors
Properties
Accessors
Methods
- add
Fallbacks - bind
For Sub Mesh - collect
Defines - copy
To - dispose
- fill
Render Target Textures - get
Active Textures - get
Animatables - get
Attributes - get
Class Name - get
Custom Code - get
Samplers - get
Uniform Buffers Names - get
Uniforms - hard
Bind For Sub Mesh - has
Render Target Textures - has
Texture - is
Ready For Sub Mesh - parse
- prepare
Defines - prepare
Defines Before Attributes - serialize
- set
Color - set
Colors - update
Lazy
Constructors
constructor
Creates a new material plugin
Parameters
material: Material
Optional scene: Scene
Optional options: GreasedLineMaterialOptions
Returns GreasedLinePluginMaterial
Properties
color ModeSearch playground for colorMode
The mixing mode of the color paramater. Default value is GreasedLineMeshColorMode.SET
colors SamplingSearch playground for colorsSampling
The type of sampling of the colors texture. The values are the same when using with textures.
dash OffsetSearch playground for dashOffset
Dash offset
dash RatioSearch playground for dashRatio
Length of the dash. 0 to 1. 0.5 means half empty, half drawn.
Readonly mark All Defines As DirtySearch playground for markAllDefinesAsDirty
Helper function to mark defines as being dirty.
Type declaration
Helper function to mark defines as being dirty.
Returns void
nameSearch playground for name
Defines the name of the plugin
prioritySearch playground for priority
Defines the priority of the plugin. Lower numbers run first.
register For Extra EventsSearch playground for registerForExtraEvents
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
resolve IncludesSearch playground for resolveIncludes
Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
use ColorsSearch playground for useColors
Whether to use the colors option to colorize the line
use DashSearch playground for useDash
Turns on/off dash mode
visibilitySearch playground for visibility
Normalized value of how much of the line will be visible 0 - 0% of the line will be visible 1 - 100% of the line will be visible
widthSearch playground for width
Line base width. At each point the line width is calculated by widths[pointIndex] * width
Static DEFAULT_ COLORSearch playground for DEFAULT_COLOR
Default line color for newly created lines
Static DEFAULT_ WIDTHSearch playground for DEFAULT_WIDTH
Defaule line width
Static DEFAULT_ WIDTH_ ATTENUATEDSearch playground for DEFAULT_WIDTH_ATTENUATED
Default line width when sizeAttenuation is true
Static Readonly GREASED_ LINE_ MATERIAL_ NAMESearch playground for GREASED_LINE_MATERIAL_NAME
Plugin name
Accessors
color
colors
colors Distribution Type
Gets the color distributiopn type
Returns GreasedLineMeshColorDistributionType
Sets the color distribution type
Parameters
value: GreasedLineMeshColorDistributionType
color distribution type
Returns void
dash Count
Gets the number of dashes in the line
Returns number
Sets the number of dashes in the line
Parameters
value: number
dash
Returns void
is Enabled
Returns boolean
resolution
size Attenuation
False means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines
Returns boolean
Turn on/off attenuation of the width option and widths array.
Parameters
value: boolean
false means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines
Returns void
Methods
add FallbacksSearch playground for addFallbacks
Add fallbacks to the effect fallbacks list.
Parameters
defines: MaterialDefines
defines the Base texture to use.
fallbacks: EffectFallbacks
defines the current fallback list.
currentRank: number
defines the current fallback rank.
Returns number
the new fallback rank.
bind For Sub MeshSearch playground for bindForSubMesh
Bind the uniform buffer
Parameters
uniformBuffer: UniformBuffer
Returns void
collect DefinesSearch playground for collectDefines
Collects all defines.
Parameters
defines: {}
The object to append to.
[name: string]: { default: any; type: string }
default: any
type: string
Returns void
copy ToSearch playground for copyTo
Makes a duplicate of the current configuration into another one.
Parameters
plugin: MaterialPluginBase
define the config where to copy the info
Returns void
disposeSearch playground for dispose
Disposes the plugin material.
Returns void
fill Render Target TexturesSearch playground for fillRenderTargetTextures
Fills the list of render target textures.
Parameters
renderTargets: SmartArray<RenderTargetTexture>
the list of render targets to update
Returns void
get Active TexturesSearch playground for getActiveTextures
Get the shader textures
Parameters
activeTextures: BaseTexture[]
Returns void
get AnimatablesSearch playground for getAnimatables
Returns the animatable textures.
Parameters
animatables: IAnimatable[]
Array of animatable textures.
Returns void
get AttributesSearch playground for getAttributes
Get the shader attributes
Parameters
attributes: string[]
array which will be filled with the attributes
Returns void
get Class NameSearch playground for getClassName
Get the class name
Returns string
class name
get Custom CodeSearch playground for getCustomCode
Get shader code
Parameters
shaderType: string
vertex/fragment
Returns Nullable<{}>
shader code
get SamplersSearch playground for getSamplers
Get the shader samplers
Parameters
samplers: string[]
Returns void
get Uniform Buffers NamesSearch playground for getUniformBuffersNames
Gets the uniform buffers names added by the plugin.
Parameters
ubos: string[]
list that the ubo names should be added to.
Returns void
get UniformsSearch playground for getUniforms
Get the shader uniforms
Returns { fragment: string; ubo: { name: string; size: number; type: string }[]; vertex: string }
uniforms
fragment: string
ubo: { name: string; size: number; type: string }[]
vertex: string
hard Bind For Sub MeshSearch playground for hardBindForSubMesh
Binds the material data (this function is called even if mustRebind() returns false)
Parameters
uniformBuffer: UniformBuffer
defines the Uniform buffer to fill in.
scene: Scene
defines the scene the material belongs to.
engine: Engine
defines the engine the material belongs to.
subMesh: SubMesh
the submesh to bind data for
Returns void
has Render Target TexturesSearch playground for hasRenderTargetTextures
Gets a boolean indicating that current material needs to register RTT
Returns boolean
true if this uses a render target otherwise false.
has TextureSearch playground for hasTexture
Checks to see if a texture is used in the material.
Parameters
texture: BaseTexture
Base texture to use.
Returns boolean
- Boolean specifying if a texture is used in the material.
is Ready For Sub MeshSearch playground for isReadyForSubMesh
Specifies that the submesh is ready to be used.
Parameters
defines: MaterialDefines
the list of "defines" to update.
scene: Scene
defines the scene the material belongs to.
engine: Engine
the engine this scene belongs to.
subMesh: SubMesh
the submesh to check for readiness
Returns boolean
- boolean indicating that the submesh is ready or not.
parseSearch playground for parse
Parses a serialized objects
Parameters
source: any
serialized object
scene: Scene
scene
rootUrl: string
root url for textures
Returns void
prepare DefinesSearch playground for prepareDefines
Prepare the defines
Parameters
defines: MaterialGreasedLineDefines
_scene: Scene
_mesh: AbstractMesh
Returns void
prepare Defines Before AttributesSearch playground for prepareDefinesBeforeAttributes
Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.
Parameters
defines: MaterialDefines
the list of "defines" to update.
scene: Scene
defines the scene to the material belongs to.
mesh: AbstractMesh
the mesh being rendered
Returns void
serializeSearch playground for serialize
Serializes this plugin material
Returns any
serializationObjec
set ColorSearch playground for setColor
set ColorsSearch playground for setColors
update LazySearch playground for updateLazy
Updates the material. Use when material created in lazy mode.
Returns void
GreasedLinePluginMaterial for GreasedLineMesh