mirror of
https://github.com/korenkonder/ReDIVA.git
synced 2026-10-01 19:28:02 +03:00
Shader: total overhaul of permutations and shader flags
This commit is contained in:
@@ -1243,7 +1243,7 @@ static void draw_pass_shadow_end_make_shadowmap(Shadow* shad, int32_t index, int
|
||||
gl_state_disable_scissor_test();
|
||||
|
||||
rctx->draw_state->shader_index = -1;
|
||||
if (a3 == shad->num_light - 1) {
|
||||
if (a3 == shad->num_shadow - 1) {
|
||||
draw_pass_shadow_filter(&shad->render_textures[3],
|
||||
&shad->render_textures[4], shad->curr_render_textures[0],
|
||||
shad->field_2DC, shad->field_2E0 / (shad->field_208 * 2.0f), false);
|
||||
@@ -1606,11 +1606,11 @@ static void draw_pass_3d_shadow_reset(render_context* rctx) {
|
||||
rctx->obj_scene.set_g_self_shadow_receivers(0, mat4_identity);
|
||||
rctx->obj_scene.set_g_self_shadow_receivers(1, mat4_identity);
|
||||
rctx->draw_state->self_shadow = false;
|
||||
rctx->draw_state->light = false;
|
||||
rctx->draw_state->shadow = false;
|
||||
}
|
||||
|
||||
static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) {
|
||||
if (shad->self_shadow && shad->num_light > 0) {
|
||||
if (shad->self_shadow && shad->num_shadow > 0) {
|
||||
gl_state_active_bind_texture_2d(19, shad->render_textures[3].GetColorTex());
|
||||
gl_state_active_bind_texture_2d(20, shad->render_textures[5].GetColorTex());
|
||||
gl_state_active_texture(0);
|
||||
@@ -1628,9 +1628,9 @@ static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) {
|
||||
gl_state_bind_sampler(19, rctx->render_samplers[0]);
|
||||
gl_state_bind_sampler(20, rctx->render_samplers[0]);
|
||||
|
||||
if (shad->num_light > 0) {
|
||||
rctx->draw_state->light = true;
|
||||
uniform_value[U_LIGHT_1] = shad->num_light > 1 ? 1 : 0;
|
||||
if (shad->num_shadow > 0) {
|
||||
rctx->draw_state->shadow = true;
|
||||
uniform_value[U_STAGE_SHADOW2] = shad->num_shadow > 1 ? 1 : 0;
|
||||
|
||||
float_t shadow_range = shad->get_shadow_range();
|
||||
for (int32_t i = 0; i < 2; i++) {
|
||||
@@ -1667,7 +1667,7 @@ static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) {
|
||||
|
||||
int32_t j = 0;
|
||||
for (int32_t i = 0; i < 2; i++)
|
||||
if (shad->light_enable[i]) {
|
||||
if (shad->shadow_enable[i]) {
|
||||
gl_state_active_bind_texture_2d(6 + j, shad->curr_render_textures[1 + i]->GetColorTex());
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 16.0f);
|
||||
j++;
|
||||
@@ -1690,7 +1690,7 @@ static void draw_pass_3d_shadow_set(Shadow* shad, render_context* rctx) {
|
||||
rctx->obj_scene.g_shadow_ambient1 = { 1.0f - ambient.x, 1.0f - ambient.y, 1.0f - ambient.z, 0.0f };
|
||||
}
|
||||
else {
|
||||
rctx->draw_state->light = false;
|
||||
rctx->draw_state->shadow = false;
|
||||
|
||||
for (int32_t i = 0; i < 2; i++)
|
||||
gl_state_active_bind_texture_2d(6 + i, shad->curr_render_textures[1 + i]->GetColorTex());
|
||||
|
||||
Reference in New Issue
Block a user