fix sorting

main
Dominik Madarász 2024-08-24 08:22:19 +02:00
parent a9e6680d05
commit fe31cf69db
3 changed files with 6 additions and 6 deletions

View File

@ -385912,7 +385912,7 @@ void model_draw_call(model_t m, int shader, int pass, vec3 cam_pos, mat44 model_
if (rs_idx > RENDER_PASS_OVERRIDES_BEGIN) {
for(int i = 0; i < q->nummeshes; i++) {
array_push(drawcalls, (drawcall_t){i, 0});
array_push(drawcalls, (drawcall_t){i, -1});
}
} else {
if(pass == -1 || pass == RENDER_PASS_OPAQUE) {
@ -385922,7 +385922,7 @@ void model_draw_call(model_t m, int shader, int pass, vec3 cam_pos, mat44 model_
drawcall_t call;
call.mesh = i;
call.tex = m.textures[i];
call.distance = 0;
call.distance = -1;
if (m.shading == SHADING_PBR)
call.tex = m.materials[i].layer[MATERIAL_CHANNEL_ALBEDO].map.texture ? m.materials[i].layer[MATERIAL_CHANNEL_ALBEDO].map.texture->id : m.materials[i].layer[MATERIAL_CHANNEL_DIFFUSE].map.texture ? m.materials[i].layer[MATERIAL_CHANNEL_DIFFUSE].map.texture->id : texture_checker().id;
array_push(drawcalls, call);

View File

@ -4272,7 +4272,7 @@ void model_draw_call(model_t m, int shader, int pass, vec3 cam_pos, mat44 model_
if (rs_idx > RENDER_PASS_OVERRIDES_BEGIN) {
for(int i = 0; i < q->nummeshes; i++) {
array_push(drawcalls, (drawcall_t){i, 0});
array_push(drawcalls, (drawcall_t){i, -1});
}
} else {
if(pass == -1 || pass == RENDER_PASS_OPAQUE) {
@ -4282,7 +4282,7 @@ void model_draw_call(model_t m, int shader, int pass, vec3 cam_pos, mat44 model_
drawcall_t call;
call.mesh = i;
call.tex = m.textures[i];
call.distance = 0;
call.distance = -1;
if (m.shading == SHADING_PBR)
call.tex = m.materials[i].layer[MATERIAL_CHANNEL_ALBEDO].map.texture ? m.materials[i].layer[MATERIAL_CHANNEL_ALBEDO].map.texture->id : m.materials[i].layer[MATERIAL_CHANNEL_DIFFUSE].map.texture ? m.materials[i].layer[MATERIAL_CHANNEL_DIFFUSE].map.texture->id : texture_checker().id;
array_push(drawcalls, call);

View File

@ -21071,7 +21071,7 @@ void model_draw_call(model_t m, int shader, int pass, vec3 cam_pos, mat44 model_
if (rs_idx > RENDER_PASS_OVERRIDES_BEGIN) {
for(int i = 0; i < q->nummeshes; i++) {
array_push(drawcalls, (drawcall_t){i, 0});
array_push(drawcalls, (drawcall_t){i, -1});
}
} else {
if(pass == -1 || pass == RENDER_PASS_OPAQUE) {
@ -21081,7 +21081,7 @@ void model_draw_call(model_t m, int shader, int pass, vec3 cam_pos, mat44 model_
drawcall_t call;
call.mesh = i;
call.tex = m.textures[i];
call.distance = 0;
call.distance = -1;
if (m.shading == SHADING_PBR)
call.tex = m.materials[i].layer[MATERIAL_CHANNEL_ALBEDO].map.texture ? m.materials[i].layer[MATERIAL_CHANNEL_ALBEDO].map.texture->id : m.materials[i].layer[MATERIAL_CHANNEL_DIFFUSE].map.texture ? m.materials[i].layer[MATERIAL_CHANNEL_DIFFUSE].map.texture->id : texture_checker().id;
array_push(drawcalls, call);