panda3d.core.ShaderAttrib

class ShaderAttrib

Bases: RenderAttrib

Inheritance diagram

Inheritance diagram of ShaderAttrib

autoGlossOn() → bool
autoGlowOn() → bool
autoNormalOn() → bool
autoRampOn() → bool
autoShader() → bool

If true, then this ShaderAttrib does not contain an explicit shader - instead, it requests the automatic generation of a shader.

autoShadowOn() → bool
property class_slot
Return type

int

clearAllShaderInputs() → RenderAttrib

Clears all the shader inputs on the attrib.

Return type

RenderAttrib

clearFlag(flag: int) → RenderAttrib
Return type

RenderAttrib

clearShader() → RenderAttrib
Return type

RenderAttrib

clearShaderInput(id: InternalName) → RenderAttrib
Return type

RenderAttrib

clearShaderInput(id: str) → RenderAttrib
Return type

RenderAttrib

static getClassSlot() → int
static getClassType() → TypeHandle
Return type

TypeHandle

getFlag(flag: int) → bool
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 get_shader returns NULL, that means that this attribute should disable the shader.

Return type

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.

Return type

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.

Return type

ShaderInput

getShaderInputBuffer(id: InternalName) → ShaderBuffer

Returns the ShaderInput as a ShaderBuffer. Assertion fails if there is none, or if it is not a ShaderBuffer.

Return type

ShaderBuffer

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 or NodePath.

Return type

LMatrix4

getShaderInputNodepath(id: InternalName) → NodePath

Returns the ShaderInput as a nodepath. Assertion fails if there is none, or if it is not a nodepath.

Return type

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)

Return type

ShaderPtrData

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.

Return type

Texture

getShaderInputVector(id: InternalName) → LVecBase4

Returns the ShaderInput as a vector. Assertion fails if there is none, or if it is not a vector.

Return type

LVecBase4

getShaderPriority() → int
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

Returns the number of geometry instances. A value of 0 means not to use instancing at all.

Return type

int

static make(shader: Shader, priority: int) → RenderAttrib

Constructs a new ShaderAttrib object with nothing set.

Return type

RenderAttrib

static makeDefault() → RenderAttrib

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Return type

RenderAttrib

static makeOff() → RenderAttrib

Constructs a new ShaderAttrib object that disables the use of shaders (it does not clear out all shader data, however.)

Return type

RenderAttrib

static registerWithReadFactory() → None

Factory method to generate a Shader object

setFlag(flag: int, value: bool) → RenderAttrib
Return type

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.

Return type

RenderAttrib

setShader(s: Shader, priority: int) → RenderAttrib
Return type

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

Return type

RenderAttrib

setShaderAuto(priority: int) → RenderAttrib
Return type

RenderAttrib

setShaderInput(param0: InternalName, param1: object, priority: int) → RenderAttrib
Return type

RenderAttrib

setShaderInput(input: ShaderInput) → RenderAttrib
Return type

RenderAttrib

setShaderInput(input: ShaderInput) → RenderAttrib

Shader Inputs

Return type

RenderAttrib

setShaderInputs(args: object, kwargs: object) → RenderAttrib
Return type

RenderAttrib

setShaderOff(priority: int) → RenderAttrib
Return type

RenderAttrib

property 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.

Return type

Shader