ShaderAttrib
from panda3d.core import ShaderAttrib
- class ShaderAttrib
Bases:
Bases:
RenderAttrib
Inheritance diagram
- auto_shader() bool
If true, then this
ShaderAttrib
does not contain an explicit shader - instead, it requests the automatic generation of a shader.
- clear_all_shader_inputs() RenderAttrib
Clears all the shader inputs on the attrib.
- clear_flag(flag: int) RenderAttrib
- clear_shader() RenderAttrib
- clear_shader_input(id: InternalName) RenderAttrib
- clear_shader_input(id: str) RenderAttrib
- static get_class_type() TypeHandle
- get_instance_count() int
Returns the number of geometry instances. A value of 0 means not to use instancing at all. This value is ignored if F_hardware_instancing is set.
- get_shader() Shader
Returns the shader object associated with the node. If get_override returns true, but get_shader returns NULL, that means that this attribute should disable the shader.
- get_shader_input(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
.
- get_shader_input(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
.
- get_shader_input_buffer(id: InternalName) ShaderBuffer
Returns the
ShaderInput
as aShaderBuffer
. Assertion fails if there is none, or if it is not aShaderBuffer
.
- get_shader_input_matrix(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
.
- get_shader_input_nodepath(id: InternalName) NodePath
Returns the
ShaderInput
as a nodepath. Assertion fails if there is none, or if it is not a nodepath.
- get_shader_input_ptr(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)
- get_shader_input_ptr(id: InternalName, data: ShaderPtrData) bool
Returns the
ShaderInput
as a ShaderPtrData struct. Assertion fails if there is none. or if it is not a PTA(double/float)
- get_shader_input_texture(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.
- get_shader_input_vector(id: InternalName) LVecBase4
Returns the
ShaderInput
as a vector. Assertion fails if there is none, or if it is not a vector.
- has_shader() bool
If true, the shader field of this attribute overrides the shader field of the parent attribute.
- has_shader_input(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. This value is ignored if F_hardware_instancing is set.
- static make(shader: Shader, priority: int) RenderAttrib
Constructs a new
ShaderAttrib
object with nothing set.
- static make_default() RenderAttrib
Returns a
RenderAttrib
that corresponds to whatever the standard default properties for render attributes of this type ought to be.
- static make_off() RenderAttrib
Constructs a new
ShaderAttrib
object that disables the use of shaders (it does not clear out all shader data, however.)
- static register_with_read_factory()
Factory method to generate a Shader object
- set_flag(flag: int, value: bool) RenderAttrib
- set_instance_count(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.
This value should not be set if F_hardware_instancing is also set.
- set_shader(s: Shader, priority: int) RenderAttrib
- set_shader_auto(shader_switch: BitMask32, priority: int) RenderAttrib
Set auto shader with bitmask to customize use, e.g., to keep normal, glow, etc., on or off
- set_shader_auto(priority: int) RenderAttrib
- set_shader_input(param0: InternalName, param1: object, priority: int) RenderAttrib
- set_shader_input(input: ShaderInput) RenderAttrib
Shader Inputs
- set_shader_inputs(args: object, kwargs: object) RenderAttrib
- set_shader_off(priority: int) RenderAttrib
- property shader Shader
Returns the shader object associated with the node. If get_override returns true, but
get_shader()
returns NULL, that means that this attribute should disable the shader.