Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use separate texture unit for light_texture #42538

Merged
merged 1 commit into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/gles2/rasterizer_canvas_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles2/shaders/canvas.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down