from panda3d.core import ShaderBuffer
class ShaderBuffer


Bases: TypedWritableReferenceCount, Namable, GeomEnums

This is a generic buffer object that lives in graphics memory.

New in version 1.10.0.

Inheritance diagram

Inheritance diagram of ShaderBuffer

__init__(param0: ShaderBuffer)
__init__(name: str, size: int, usage_hint: UsageHint)

Creates an uninitialized buffer object with the given size. For now, these parameters cannot be modified, but this may change in the future.

__init__(name: str, initial_data: bytes, usage_hint: UsageHint)

Creates a buffer object initialized with the given data. For now, these parameters cannot be modified, but this may change in the future.

property data_size_bytes int

Returns the buffer size in bytes.

static getClassType() TypeHandle
isPrepared(prepared_objects: PreparedGraphicsObjects) bool

Returns true if the data has already been prepared or enqueued for preparation on the indicated GSG, false otherwise.

prepare(prepared_objects: PreparedGraphicsObjects)

Indicates that the data should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame. This will ensure the data is already loaded into the GSG if it is expected to be rendered soon.

Use this function instead of prepareNow() to preload datas from a user interface standpoint.

prepareNow(prepared_objects: PreparedGraphicsObjects, gsg: GraphicsStateGuardianBase) BufferContext

Creates a context for the data on the particular GSG, if it does not already exist. Returns the new (or old) BufferContext. This assumes that the GraphicsStateGuardian is the currently active rendering context and that it is ready to accept new datas. If this is not necessarily the case, you should use prepare() instead.

Normally, this is not called directly except by the GraphicsStateGuardian; a data does not need to be explicitly prepared by the user before it may be rendered.

release(prepared_objects: PreparedGraphicsObjects) bool

Frees the data context only on the indicated object, if it exists there. Returns true if it was released, false if it had not been prepared.

releaseAll() int

Frees the context allocated on all objects for which the data has been declared. Returns the number of contexts which have been freed.

property usage_hint UsageHint

Returns the buffer usage hint.