add MODEL_PBR flag

main
Dominik Madarász 2024-03-20 18:49:26 +01:00
parent 920d8ecad4
commit 363ae843f4
7 changed files with 14 additions and 2 deletions

View File

@ -1333,6 +1333,7 @@ enum MODEL_FLAGS {
MODEL_NO_FILTERING = 8, MODEL_NO_FILTERING = 8,
MODEL_MATCAPS = 16, MODEL_MATCAPS = 16,
MODEL_RIMLIGHT = 32, MODEL_RIMLIGHT = 32,
MODEL_PBR = 64,
}; };
enum SHADING_MODE { enum SHADING_MODE {
SHADING_NONE, SHADING_NONE,

View File

@ -20,8 +20,7 @@ int main() {
// load model // load model
model_t m1 = model("suzanne.obj", MODEL_NO_ANIMATIONS); model_t m1 = model("suzanne.obj", MODEL_NO_ANIMATIONS);
model_t m2 = model("suzanne.obj", MODEL_NO_ANIMATIONS|MODEL_MATCAPS); model_t m2 = model("suzanne.obj", MODEL_NO_ANIMATIONS|MODEL_MATCAPS);
model_t m3 = model("damagedhelmet.gltf", MODEL_NO_ANIMATIONS); model_t m3 = model("damagedhelmet.gltf", MODEL_NO_ANIMATIONS|MODEL_PBR);
model_shading(&m3, SHADING_PBR);
// spawn object1 (diffuse) // spawn object1 (diffuse)
object_t* obj1 = scene_spawn(); object_t* obj1 = scene_spawn();

View File

@ -17563,6 +17563,7 @@ enum MODEL_FLAGS {
MODEL_NO_FILTERING = 8, MODEL_NO_FILTERING = 8,
MODEL_MATCAPS = 16, MODEL_MATCAPS = 16,
MODEL_RIMLIGHT = 32, MODEL_RIMLIGHT = 32,
MODEL_PBR = 64,
}; };
enum SHADING_MODE { enum SHADING_MODE {
@ -373565,6 +373566,9 @@ model_t model_from_mem(const void *mem, int len, int flags) {
glGenBuffers(1, &m.vao_instanced); glGenBuffers(1, &m.vao_instanced);
model_set_state(m); model_set_state(m);
if (flags & MODEL_PBR) {
model_shading(&m, SHADING_PBR);
}
} }
return m; return m;
} }

View File

@ -3538,6 +3538,9 @@ model_t model_from_mem(const void *mem, int len, int flags) {
glGenBuffers(1, &m.vao_instanced); glGenBuffers(1, &m.vao_instanced);
model_set_state(m); model_set_state(m);
if (flags & MODEL_PBR) {
model_shading(&m, SHADING_PBR);
}
} }
return m; return m;
} }

View File

@ -541,6 +541,7 @@ enum MODEL_FLAGS {
MODEL_NO_FILTERING = 8, MODEL_NO_FILTERING = 8,
MODEL_MATCAPS = 16, MODEL_MATCAPS = 16,
MODEL_RIMLIGHT = 32, MODEL_RIMLIGHT = 32,
MODEL_PBR = 64,
}; };
enum SHADING_MODE { enum SHADING_MODE {

View File

@ -20712,6 +20712,9 @@ model_t model_from_mem(const void *mem, int len, int flags) {
glGenBuffers(1, &m.vao_instanced); glGenBuffers(1, &m.vao_instanced);
model_set_state(m); model_set_state(m);
if (flags & MODEL_PBR) {
model_shading(&m, SHADING_PBR);
}
} }
return m; return m;
} }

View File

@ -3630,6 +3630,7 @@ enum MODEL_FLAGS {
MODEL_NO_FILTERING = 8, MODEL_NO_FILTERING = 8,
MODEL_MATCAPS = 16, MODEL_MATCAPS = 16,
MODEL_RIMLIGHT = 32, MODEL_RIMLIGHT = 32,
MODEL_PBR = 64,
}; };
enum SHADING_MODE { enum SHADING_MODE {