habitat_sim.attributes.PbrShaderAttributes class

A metadata template for PBR shader creation and control values and multipliers, such as enabling Image Based Lighting and controlling the mix of direct and indirect lighting contributions. Is imported from .pbr_config.json files.

Methods

def find_value_location(self, key: str) -> typing.List[str]
Returns a list of keys, in order, for the traversal of the nested subconfigurations in this Configuration to get the requested key’s value or subconfig. Key is not found if list is empty.
def get(self, arg0: str, /) -> object
Retrieve the requested value referenced by key argument, if it exists
def get_as_string(self, arg0: str, /) -> str
Retrieves a string representation of the value referred to by the passed key.
def get_keys_and_types(self, /) -> typing.Dict[str, habitat_sim._ext.habitat_sim_bindings.ConfigValType]
Returns a dictionary where the keys are the names of the values this configuration holds and the values are the types of these values.
def get_keys_by_type(self, value_type: habitat_sim._ext.habitat_sim_bindings.ConfigValType, sorted: bool = False) -> typing.List[str]
Retrieves a list of all the keys of values of the specified types. Takes ConfigValType enum value as argument, and whether the keys should be sorted or not.
def get_subconfig(self, name: str) -> habitat_sim._ext.habitat_sim_bindings.Configuration
Get the subconfiguration with the given name.
def get_subconfig_copy(self, name: str) -> habitat_sim._ext.habitat_sim_bindings.Configuration
Get a copy of the subconfiguration with the given name.
def get_subconfig_keys(self, sorted: bool = False) -> typing.List[str]
Retrieves a list of the keys of this configuration’s subconfigurations, specifying whether the keys should be sorted or not
def get_type(self, arg0: str, /) -> habitat_sim._ext.habitat_sim_bindings.ConfigValType
Retrieves the ConfigValType of the value referred to by the passed key.
def get_user_config(self, /) -> habitat_sim._ext.habitat_sim_bindings.Configuration
Returns a reference to the User Config object for this attributes, so that it can be viewed or modified. Any changes to the user_config will require the owning attributes to be re-registered.
def has_key_to_type(self, key: str, value_type: habitat_sim._ext.habitat_sim_bindings.ConfigValType) -> bool
Returns whether passed key points to a value of specified ConfigValType
def has_subconfig(self, arg0: str, /) -> bool
Returns true if specified key references an existing subconfiguration within this configuration.
def has_value(self, key: str) -> bool
Returns whether or not this Configuration has the passed key. Does not check subconfigurations.
def remove(self, arg0: str, /) -> object
Retrieve and remove the requested value, if it exists
def remove_subconfig(self, arg0: str, /) -> habitat_sim._ext.habitat_sim_bindings.Configuration
Removes and returns subconfiguration corresponding to passed key, if found. Gives warning otherwise.
def save_subconfig(self, name: str, subconfig: habitat_sim._ext.habitat_sim_bindings.Configuration) -> None
Save a subconfiguration with the given name.
def set(self, key: str, value: str) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.
def set(self, key: str, value: str) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.
def set(self, key: str, value: int) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.
def set(self, key: str, value: float) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.
def set(self, key: str, value: bool) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.
def set(self, key: str, value: magnum.Quaternion) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.
def set(self, key: str, value: magnum.Vector3) -> None
This method is inherited from Configuration, but should not be used with Attributes due to the possibility of changing the type of a required variable. Use the provided Attributes instead, to change values for this object.

Special methods

def __init__(self, /) -> None
def __init__(self, arg0: str, /) -> None
def __repr__(self, new_line: str = '\n') -> str

Properties

csv_info: str get
Comma-separated informational string describing this Attributes template
direct_diffuse_scale: float get set
Directly manipulate the value of the direct lighting diffuse scale. Note, no range checking is performed on this value, so irrational results are possible if this value is set negative or greater than 1. Only used when both direct and image-basedlighting is present
direct_light_intensity: float get set
Sets the global direct lighting multiplier to control overall direct light brightness. This is used to balance PBR and Phong lighting of the same scene. Default value is 3.14
direct_specular_scale: float get set
Directly manipulate the value of the direct lighting specular scale. Note, no range checking is performed on this value, so irrational results are possible if this value is set negative or greater than 1. Only used when both direct and image-basedlighting is present
enable_direct_lights: bool get set
Whether the specified direct lights are used to illuminate the scene.
enable_ibl: bool get set
Whether Image-based Lighting is used to illuminate the scene.
file_directory: str get
Directory where file-based templates were loaded from.
gamma: float get set
The gamma value for the pbr shader. This value is used for the approximation mapping from sRGB to linear and back. Default value is 2.2
handle: str get set
Name of attributes template.
ibl_brdfLUT_filename: str get
The filename or resource handle for the BRDF Lookup Table used for by the consumers of this config for image-based lighting.
ibl_diffuse_scale: float get set
Directly manipulate the value of the image-based lighting diffuse scale. Note, no range checking is performed on this value, so irrational results are possible if this value is set negative or greater than 1. Only used when both direct and image-basedlighting is present
ibl_environment_map_filename: str get
The filename or resource handle for the Environment Map used by the consumers of this config for image-based lighting.
ibl_specular_scale: float get set
Directly manipulate the value of the image-based lighting specular scale. Note, no range checking is performed on this value, so irrational results are possible if this value is set negative or greater than 1. Only used when both direct and image-basedlighting is present
ibl_to_direct_diffuse_balance: float get set
The balance between the direct lighting and image-based lighting diffuse results, with value values of [0,1]. Any value <= 0 means only direct lighting diffuse results are rendered, >=1 means only image-based lighting results are rendered. Only used when both direct and image-basedlighting is present
ibl_to_direct_specular_balance: float get set
The balance between the direct lighting and image-based lighting specular results, with value values of [0,1]. Any value <= 0 means only direct lighting specular results are rendered, >=1 means only image-based lighting results are rendered. Only used when both direct and image-basedlighting is present
map_ibl_txtr_to_linear: bool get set
Whether we should use shader-based srgb->linear approximation remapping of environment map textures used by IBL in PBR rendering.
map_mat_txtr_to_linear: bool get set
Whether we should use shader-based srgb->linear approximation remapping of applicable color textures in PBR rendering.
map_output_to_srgb: bool get set
Whether we should use shader-based linear->srgb approximation remapping of shader output in PBR rendering.
num_user_configs: int get
The number of currently specified user-defined configuration values and subconfigs (does not recurse subordinate subconfigs).
skip_anisotropy_layer_calc: bool get set
Whether the anisotropy layer calculations should be skipped. If true, disables calcs regardless of material setting.
skip_calc_missing_tbn: bool get set
Whether the fragment shader should skip the tangent frame calculation if precomputed tangents are not provided. This calculation provides a tangent frame to be used for normal textures and anisotropy calculations. If precomputed tangents are missing and this calculation is not enabled, any normal textures will be ignored, which will adversely affect visual fidelity.
skip_clearcoat_calc: bool get set
Whether the clearcoat layer calculations should be skipped. If true, disables calcs regardless of material setting.
skip_specular_layer_calc: bool get set
Whether the specular layer calculations should be skipped. If true, disables calcs regardless of material setting.
template_class: str get
Class name of Attributes template.
template_id: int get
System-generated ID for template. Will be unique among templates of same type.
tonemap_exposure: float get set
The exposure value for tonemapping in the pbr shader. This value scales the color before the tonemapping is applied. Default value is 4.5
top_level_num_configs: int get
Holds the total number of subconfigs this Configuration holds at the base level (does not recurse subconfigs).
top_level_num_entries: int get
Holds the total number of values and subconfigs this Configuration holds at the base level (does not recurse subconfigs).
top_level_num_values: int get
Holds the total number of values this Configuration holds at the base level (does not recurse subconfigs).
total_num_configs: int get
Holds the total number of subconfigs this Configuration holds across all levels (recurses subconfigs).
total_num_entries: int get
Holds the total number of values and subconfigs this Configuration holds across all levels (recurses subconfigs).
total_num_user_configs: int get
The total number of currently specified user-defined configuration values and subconfigs found by also recursing all subordinate subconfigs.
total_num_values: int get
Holds the total number of values this Configuration holds across all levels (recurses subconfigs).
use_burley_diffuse: bool get set
If true, the PBR shader uses a diffuse calculation based on Burley, modified to be
more energy conserving.
https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf
otherwise, the shader will use a standard Lambertian model, which is easier to calculate but doesn’t look as nice, and sometimes can appear washed out.
use_direct_tonemap: bool get set
Whether tonemapping is enabled for direct lighting results, remapping the colors to a slightly different colorspace.
use_ibl_tonemap: bool get set
Whether tonemapping is enabled for image-based lighting results, remapping the colors to a slightly different colorspace.
use_mikkelsen_tbn_calc: bool get set
Whether the more expensive calculation by Mikkelsen from https://jcgt.org/published/0009/03/04/paper.pdf should be used for the TBN calc. If false, a less expensive method based on https://github.com/KhronosGroup/Vulkan-Samples/blob/main/shaders/pbr.frag that gives empirically validated equivalent results will be used instead.