Skip to content

Known assumptions and naming conventions

Šimon edited this page Jan 1, 2024 · 3 revisions

This list will keep the track of known assumptions that we have made. This also include naming conventions for files and paths.

PBR Texture loading and naming conventions

Location: PBRTextured.h

Class purpose: Load PBR materials from texture

Assumption: The constructor expects to receive path to the folder with PBR materials. eg.: albedo, roughness

Naming convention: We expect that the PBR materials are in the folder named like this

Albedo Metallic Roughness AO
albedo metallic roughness ao

 Example

Path to the albedo material: Assets/Textures/PBR/albedo.png Result: OK

Path to the albedo material: Assets/Textures/PBR/Albedo.png Result: not loaded

Path to the albedo material: Assets/Textures/PBR/ALBEDO.png Result: not loaded

Path to the albedo material: Assets/Textures/PBR/Gold/Gold1/albedo.png Result: OK

PBR Materials shader uniform names

Location: PBRTextured.h & PBRColor.h & PBRFragmentShaders

Class purpose: Load PBR materials from texture or use RGB colors

Assumption: Your shader uniform variables that hold values for different colors or samplers should follow some naming convention

Naming convention for samplers: When instantiating PBRmaterial class you can pass the naming convention format of your liking to the constructor of the class

NOTE: you still have to update uniforms inside shader code to follow your custom prefixes

  • default for samplers are _map
  • default value for non-samplers are _val

we assume that uniform name for the PBR material should begin with the capital letter.

Albedo Metallic Roughness AO
_format_Albedo _format_Metallic _format_Roughness _format_Ao

 Example

Uniform name: _valAlbedo Result: OK

Uniform name: _mapAlbedo Result: OK

Uniform name: _pbrAlbedo Result: OK if the uniform name is updated to _pbrAlbedo

Uniform name: _pbralbedo Result: uniform not found

Uniform name: _alBedo Result: uniform not found

Clone this wiki locally