Use separate texture unit for light_texture

This commit is contained in:
clayjohn 2020-10-03 12:15:58 -07:00
parent 66cbcc1b7e
commit 081d016e60
2 changed files with 3 additions and 3 deletions

View File

@ -2604,7 +2604,7 @@ void RasterizerCanvasGLES2::_canvas_render_item(Item *p_ci, RenderItemState &r_r
_set_uniforms();
state.canvas_shader.use_material((void *)material_ptr);
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 4);
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 6);
RasterizerStorageGLES2::Texture *t = storage->texture_owner.getornull(light->texture);
if (!t) {
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);
@ -3000,7 +3000,7 @@ void RasterizerCanvasGLES2::render_joined_item(const BItemJoined &p_bij, RenderI
_set_uniforms();
state.canvas_shader.use_material((void *)material_ptr);
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 4);
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 6);
RasterizerStorageGLES2::Texture *t = storage->texture_owner.getornull(light->texture);
if (!t) {
glBindTexture(GL_TEXTURE_2D, storage->resources.white_tex);

View File

@ -333,7 +333,7 @@ uniform highp float light_height;
uniform highp float light_outside_alpha;
uniform highp float shadow_distance_mult;
uniform lowp sampler2D light_texture; // texunit:-4
uniform lowp sampler2D light_texture; // texunit:-6
varying vec4 light_uv_interp;
varying vec2 transformed_light_uv;