ShaderAttrib
from panda3d.core import ShaderAttrib
- class ShaderAttrib
Bases:
Bases:
RenderAttrib
Inheritance diagram
- autoShader() bool
If true, then this
ShaderAttrib
does not contain an explicit shader - instead, it requests the automatic generation of a shader.
- clearAllShaderInputs() RenderAttrib
Clears all the shader inputs on the attrib.
- clearFlag(flag: int) RenderAttrib
- clearShader() RenderAttrib
- clearShaderInput(id: InternalName) RenderAttrib
- clearShaderInput(id: str) RenderAttrib
- static getClassType() TypeHandle
- getInstanceCount() int
Returns the number of geometry instances. A value of 0 means not to use instancing at all.
- getShader() Shader
Returns the shader object associated with the node. If get_override returns true, but
getShader()
returns NULL, that means that this attribute should disable the shader.
- getShaderInput(id: InternalName) ShaderInput
Returns the
ShaderInput
of the given name. If no such name is found, this function does not return NULL — it returns the “blank”ShaderInput
.
- getShaderInput(id: str) ShaderInput
Returns the
ShaderInput
of the given name. If no such name is found, this function does not return NULL — it returns the “blank”ShaderInput
.
- getShaderInputBuffer(id: InternalName) ShaderBuffer
Returns the
ShaderInput
as aShaderBuffer
. Assertion fails if there is none, or if it is not aShaderBuffer
.
- getShaderInputMatrix(id: InternalName, matrix: LMatrix4) LMatrix4
Returns the
ShaderInput
as a matrix. Assertion fails if there is none, or if it is not a matrix orNodePath
.
- getShaderInputNodepath(id: InternalName) NodePath
Returns the
ShaderInput
as a nodepath. Assertion fails if there is none, or if it is not a nodepath.
- getShaderInputPtr(id: InternalName) ShaderPtrData
Returns the
ShaderInput
as a ShaderPtrData struct. Assertion fails if there is none. or if it is not a PTA(double/float)
- getShaderInputTexture(id: InternalName, sampler: SamplerState) Texture
Returns the
ShaderInput
as a texture. Assertion fails if there is none, or if it is not a texture.If sampler is not NULL, the sampler state to use for this texture is assigned to it.
- getShaderInputVector(id: InternalName) LVecBase4
Returns the
ShaderInput
as a vector. Assertion fails if there is none, or if it is not a vector.
- hasShader() bool
If true, the shader field of this attribute overrides the shader field of the parent attribute.
- hasShaderInput(id: InternalName) bool
Returns true if there is a
ShaderInput
of the given name.
- property instance_count int
Returns the number of geometry instances. A value of 0 means not to use instancing at all.
- static make(shader: Shader, priority: int) RenderAttrib
Constructs a new
ShaderAttrib
object with nothing set.
- static makeDefault() RenderAttrib
Returns a
RenderAttrib
that corresponds to whatever the standard default properties for render attributes of this type ought to be.
- static makeOff() RenderAttrib
Constructs a new
ShaderAttrib
object that disables the use of shaders (it does not clear out all shader data, however.)
- static registerWithReadFactory()
Factory method to generate a Shader object
- setFlag(flag: int, value: bool) RenderAttrib
- setInstanceCount(instance_count: int) RenderAttrib
Sets the geometry instance count. Do not confuse this with instanceTo, which is used for animation instancing, and has nothing to do with this. A value of 0 means not to use instancing at all.
- setShader(s: Shader, priority: int) RenderAttrib
- setShaderAuto(shader_switch: BitMask32, priority: int) RenderAttrib
Set auto shader with bitmask to customize use, e.g., to keep normal, glow, etc., on or off
- setShaderAuto(priority: int) RenderAttrib
- setShaderInput(param0: InternalName, param1: object, priority: int) RenderAttrib
- setShaderInput(input: ShaderInput) RenderAttrib
Shader Inputs
- setShaderInputs(args: object, kwargs: object) RenderAttrib
- setShaderOff(priority: int) RenderAttrib
- property shader Shader
Returns the shader object associated with the node. If get_override returns true, but
getShader()
returns NULL, that means that this attribute should disable the shader.