FrameBufferProperties

from panda3d.core import FrameBufferProperties
class FrameBufferProperties

Bases:

A container for the various kinds of properties we might ask to have on a graphics frameBuffer before we create a GSG.

Inheritance diagram

Inheritance diagram of FrameBufferProperties

__eq__(other: FrameBufferProperties) bool
__getstate__() object
__init__()
__init__(param0: FrameBufferProperties)
__ne__(other: FrameBufferProperties) bool
__setstate__(state: object)
property accum_bits int
add_properties(other: FrameBufferProperties)

Sets any properties that are explicitly specified in other on this object. Leaves other properties unchanged.

property alpha_bits int
property aux_float int
property aux_hrgba int
property aux_rgba int
property back_buffers int
property blue_bits int
clear()

Unsets all properties that have been specified so far, and resets the FrameBufferProperties structure to its initial empty state.

property color_bits int

Getter Setter

Sets the number of requested color bits as a single number that represents the sum of the individual numbers of red, green and blue bits. Panda won’t care how the individual bits are divided up.

See also set_rgba_bits(), which allows you to specify requirements for the individual components.

property coverage_samples int

If coverage samples are specified, and there is hardware support, we use coverage multisampling. multisampling

property depth_bits int

Individual queries.

Individual queries.

assigners.

Individual queries.

assigners.

property float_color bool
property float_depth bool
property force_hardware bool
property force_software bool
get_accum_bits() int
get_alpha_bits() int
get_aux_float() int
get_aux_hrgba() int
get_aux_mask() int

Converts the aux bitplanes of the framebuffer into a RenderBuffer::Type.

get_aux_rgba() int
get_back_buffers() int
get_blue_bits() int
get_buffer_mask() int

Converts the non-aux bitplanes of the framebuffer into a RenderBuffer::Type.

get_color_bits() int
get_coverage_samples() int

If coverage samples are specified, and there is hardware support, we use coverage multisampling.

static get_default() FrameBufferProperties

Returns a FrameBufferProperties structure with all of the default values filled in according to the user’s config file.

get_depth_bits() int

Individual queries.

get_float_color() bool
get_float_depth() bool
get_force_hardware() bool
get_force_software() bool
get_green_bits() int
get_indexed_color() bool
get_multisamples() int
get_quality(reqs: FrameBufferProperties) int

Assumes that these properties are a description of a window.

Measures how well this window satisfies a specified set of requirements. A higher quality number means that more requirements were satisfied. A quality of zero means that the window is unsuitable.

The routine deducts a lot if the window fails to provide a requested feature. It deducts less if the window provides a feature, but at a degraded level of functionality (ie, the user asks for rgba8, color, but the window only provides rgba4). The routine also deducts a small amount for unnecessary features. For example, if the window has an accumulation buffer when one is not requested will reduce quality slightly. Maximum quality is obtained when the window exactly matches the request.

If you want to know whether the window satisfies all of the requirements, use the “subsumes” function.

get_red_bits() int
get_rgb_color() bool
get_srgb_color() bool
get_stencil_bits() int
get_stereo() bool
property green_bits int
property indexed_color bool
is_any_specified() bool

Returns true if any properties have been specified, false otherwise.

is_basic() bool

Returns true if the properties are extremely basic. The following count as basic: rgb or rgba, depth. If anything else is specified, the properties are non-basic.

is_single_buffered() bool
is_stereo() bool
property multisamples int
output(out: ostream)

Generates a string representation.

property red_bits int
property rgb_color bool
set_accum_bits(n: int)
set_all_specified()

Marks all bits as having been specified.

set_alpha_bits(n: int)
set_aux_float(n: int)
set_aux_hrgba(n: int)
set_aux_rgba(n: int)
set_back_buffers(n: int)
set_blue_bits(n: int)
set_color_bits(n: int)

Sets the number of requested color bits as a single number that represents the sum of the individual numbers of red, green and blue bits. Panda won’t care how the individual bits are divided up.

See also set_rgba_bits(), which allows you to specify requirements for the individual components.

set_coverage_samples(n: int)

If coverage samples are specified, and there is hardware support, we use coverage multisampling

set_depth_bits(n: int)

Individual assigners.

set_float_color(n: bool)
set_float_depth(n: bool)
set_force_hardware(n: bool)
set_force_software(n: bool)
set_green_bits(n: int)
set_indexed_color(n: bool)
set_multisamples(n: int)
set_one_bit_per_channel()

If any of the depth, color, alpha, accum, or stencil properties is set to more than one, then they are reduced to one.

set_red_bits(n: int)
set_rgb_color(n: bool)
set_rgba_bits(r: int, g: int, b: int, a: int)

Convenience method for setting the red, green, blue and alpha bits in one go.

set_srgb_color(n: bool)
set_stencil_bits(n: int)
set_stereo(n: bool)
setup_color_texture(tex: Texture) bool

Sets the texture up for render-to-texture matching these framebuffer properties.

Returns true if there was a format that had enough bits, false otherwise. Of course, this is no guarantee that a particular graphics back-end supports rendering to textures of that format.

setup_depth_texture(tex: Texture) bool

Sets the texture up for render-to-texture matching these framebuffer properties.

Returns true if there was a format that had enough bits, false otherwise. Of course, this is no guarantee that a particular graphics back-end supports rendering to textures of that format.

property srgb_color bool
property stencil_bits int
property stereo bool
subsumes(other: FrameBufferProperties) bool

Returns true if this set of properties makes strictly greater or equal demands of the framebuffer than the other set of framebuffer properties.

verify_hardware_software(props: FrameBufferProperties, renderer: str) bool

Validates that the properties represent the desired kind of renderer (hardware or software). If not, prints out an error message and returns false.