#ifndef _PIUMA_RENDER_OBJECT_H_ #define _PIUMA_RENDER_OBJECT_H_ #include "primitives.h" #include "shader.h" struct r_material { // @Feature: PBR materials r_shader *shader; r_texture *albedo_texture; v4 albedo_factor; r_texture *metallic_texture; f32 metallic_factor; r_texture *roughness_texture; f32 roughness_factor; r_texture *normal_texture; r_texture *emissive_texture; v4 emissive_factor; /* albedo | metallic | --> Disney + UE4 paper roughness / specular | cavity | subsurface | anisotropy | --> Disney paper clearcoat | sheen | ambient occlusion | --> Valve Source2, same as cavity? emission normals */ }; struct r_object { // @Feature: actually support multiple meshes/materials in the implementation code r_mesh **meshes; r_material **mesh_material; m4 *mesh_local_transform; u64 count; v3 scale; v3 position; v3 rotation; bool has_shadow; }; r_object r_object_create(u64 count, r_mesh **meshes, r_material **materials, v3 position = {0,0,0}, v3 rotation = {0,0,0}, v3 scale = {1,1,1}); r_object r_object_allocate(u64 count); void r_object_destroy(r_object *object); m4 r_object_transform_matrix(r_object *object); m4 r_object_mesh_transform_matrix(r_object *object, u64 mesh_i); #endif