Undo #25557 (was not right anyway), fixes #26258

This commit is contained in:
Juan Linietsky 2019-03-11 14:58:09 -03:00
parent 7b67c5857f
commit 0eb61c3106
2 changed files with 3 additions and 8 deletions

View file

@ -2349,10 +2349,6 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
state.used_screen_texture = true; state.used_screen_texture = true;
} }
if (p_material->shader->spatial.uses_depth_texture) {
state.used_depth_texture = true;
}
if (p_depth_pass) { if (p_depth_pass) {
if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test) if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test)
@ -3169,7 +3165,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
current_material_index = 0; current_material_index = 0;
state.used_sss = false; state.used_sss = false;
state.used_screen_texture = false; state.used_screen_texture = false;
state.used_depth_texture = false;
//fill list //fill list
for (int i = 0; i < p_cull_count; i++) { for (int i = 0; i < p_cull_count; i++) {
@ -3634,7 +3630,6 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
if (storage->frame.current_rt->buffers.active) { if (storage->frame.current_rt->buffers.active) {
//transfer to effect buffer if using buffers, also resolve MSAA //transfer to effect buffer if using buffers, also resolve MSAA
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo);
glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST); glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
@ -4191,7 +4186,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glColorMask(1, 1, 1, 1); glColorMask(1, 1, 1, 1);
if (state.used_contact_shadows || state.used_depth_texture) { if (state.used_contact_shadows) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo);
glReadBuffer(GL_COLOR_ATTACHMENT0); glReadBuffer(GL_COLOR_ATTACHMENT0);

View file

@ -204,7 +204,7 @@ public:
bool cull_disabled; bool cull_disabled;
bool used_sss; bool used_sss;
bool used_screen_texture; bool used_screen_texture;
bool used_depth_texture;
bool used_depth_prepass; bool used_depth_prepass;
bool used_depth_prepass_and_resolved; bool used_depth_prepass_and_resolved;