diff options
Diffstat (limited to 'drivers/gles3')
-rw-r--r-- | drivers/gles3/rasterizer_gles3.cpp | 5 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 2 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 29 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 17 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 10 |
5 files changed, 12 insertions, 51 deletions
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index e025992c0b..274782c997 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -247,11 +247,8 @@ void RasterizerGLES3::set_current_render_target(RID p_render_target) { if (p_render_target.is_valid()) { RasterizerStorageGLES3::RenderTarget *rt = storage->render_target_owner.getornull(p_render_target); - if (!rt) { - storage->frame.current_rt = NULL; - } - ERR_FAIL_COND(!rt); storage->frame.current_rt = rt; + ERR_FAIL_COND(!rt); storage->frame.clear_request = false; glViewport(0, 0, rt->width, rt->height); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 05cfba726c..1035e9293a 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2194,7 +2194,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_shadow) { - bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture || p_material->shader->spatial.unshaded; + bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture; bool has_blend_alpha = p_material->shader->spatial.blend_mode != RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX || p_material->shader->spatial.ontop; bool has_alpha = has_base_alpha || has_blend_alpha; bool shadow = false; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 68731308a9..dcf8ef2277 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -4854,35 +4854,6 @@ float RasterizerStorageGLES3::reflection_probe_get_origin_max_distance(RID p_pro return reflection_probe->max_distance; } -/* ROOM API */ - -RID RasterizerStorageGLES3::room_create() { - - return RID(); -} -void RasterizerStorageGLES3::room_add_bounds(RID p_room, const PoolVector<Vector2> &p_convex_polygon, float p_height, const Transform &p_transform) { -} -void RasterizerStorageGLES3::room_clear_bounds(RID p_room) { -} - -/* PORTAL API */ - -// portals are only (x/y) points, forming a convex shape, which its clockwise -// order points outside. (z is 0); - -RID RasterizerStorageGLES3::portal_create() { - - return RID(); -} -void RasterizerStorageGLES3::portal_set_shape(RID p_portal, const Vector<Point2> &p_shape) { -} -void RasterizerStorageGLES3::portal_set_enabled(RID p_portal, bool p_enabled) { -} -void RasterizerStorageGLES3::portal_set_disable_distance(RID p_portal, float p_distance) { -} -void RasterizerStorageGLES3::portal_set_disabled_color(RID p_portal, const Color &p_color) { -} - RID RasterizerStorageGLES3::gi_probe_create() { GIProbe *gip = memnew(GIProbe); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index f612d9e879..b0cb04569e 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -953,23 +953,6 @@ public: virtual float reflection_probe_get_origin_max_distance(RID p_probe) const; virtual bool reflection_probe_renders_shadows(RID p_probe) const; - /* ROOM API */ - - virtual RID room_create(); - virtual void room_add_bounds(RID p_room, const PoolVector<Vector2> &p_convex_polygon, float p_height, const Transform &p_transform); - virtual void room_clear_bounds(RID p_room); - - /* PORTAL API */ - - // portals are only (x/y) points, forming a convex shape, which its clockwise - // order points outside. (z is 0); - - virtual RID portal_create(); - virtual void portal_set_shape(RID p_portal, const Vector<Point2> &p_shape); - virtual void portal_set_enabled(RID p_portal, bool p_enabled); - virtual void portal_set_disable_distance(RID p_portal, float p_distance); - virtual void portal_set_disabled_color(RID p_portal, const Color &p_color); - /* GI PROBE API */ struct GIProbe : public Instantiable { diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index e6476bd6b6..c9e9dacdb5 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1969,6 +1969,14 @@ FRAGMENT_SHADER_CODE #ifdef USE_MULTIPLE_RENDER_TARGETS + +#ifdef SHADELESS + frag_color=vec4(albedo,alpha); + diffuse_buffer=vec4(albedo.rgb,0.0); + specular_buffer=vec4(0.0); + +#else + #if defined(ENABLE_AO) float ambient_scale=0.0; // AO is supplied by material @@ -1984,6 +1992,7 @@ FRAGMENT_SHADER_CODE diffuse_buffer=vec4(emission+diffuse_light+ambient_light,ambient_scale); specular_buffer=vec4(specular_light,metallic); +#endif //SHADELESS normal_mr_buffer=vec4(normalize(normal)*0.5+0.5,roughness); @@ -1991,6 +2000,7 @@ FRAGMENT_SHADER_CODE sss_buffer = sss_strength; #endif + #else //USE_MULTIPLE_RENDER_TARGETS |