Commit graph

540 commits

Author SHA1 Message Date
SonerSound 20822ee87d Fix inconsistent lighting in GLES2
Issue was possibily being caused by duplicating a light even when that
light was not in the render_light_instances array.

(cherry picked from commit 545bf86d39)
2019-11-12 13:09:35 +01:00
clayjohn bd9cff1b20 allow omnilights and spotlights to use negative in GLES2
(cherry picked from commit 96c3004855)
2019-11-08 15:48:19 +01:00
RaphaelHunter 22c31016c8 fix gles2 canvas shader uniform error,close #31201
(cherry picked from commit 48f28c68bc)
2019-11-08 15:48:19 +01:00
Yuri Roubinski e224c72dd8 Fix hint range step for integer in shaders
(cherry picked from commit 982becfa39)
2019-11-08 15:48:18 +01:00
clayjohn 99adaef47c Fix skip_vertex_transform bug in GLES2 CPUParticles
(cherry picked from commit 97f66900bb)
2019-11-08 15:48:18 +01:00
clayjohn b7c3fd0711 Fix shadow mapping with RGBA textures on html
(cherry picked from commit 6ec7686a0c)
2019-11-08 15:48:18 +01:00
clayjohn 5acb21dd7b check if skeleton texture is already allocated before reallocating
(cherry picked from commit 99de3906ba)
2019-09-27 12:54:54 +02:00
qarmin 3b703d6707 Small fixes, mostly dupicated code
(cherry picked from commit 856a8226a5)
2019-09-24 09:00:45 +02:00
clayjohn 480d87e7c8 do not compute fog when using unshaded in GLES2
(cherry picked from commit 3365595254)
2019-07-17 09:50:54 +02:00
clayjohn 39f3a575d6 fix no depth test and render_priority sorting
(cherry picked from commit 2abe7deae8)
2019-07-17 09:50:37 +02:00
Marcus Brummer 055004c589 Prevent GLES2 bool uniforms from having a precision type set.
When setting the default precision type for uniforms (before compiling
the shader) prevent boolean uniforms from having one set. Booleans can't
have a precision type and on some Android devices this caused a
compilation failure.

Fixes #30317

(cherry picked from commit 10f1e0f63a)
2019-07-17 09:50:16 +02:00
Marcus Brummer c441a2921d Use highp precision for gles2 shader uniforms if not explicitly set.
The use of different default precision values (highp in vertex; mediump
in fragment) for uniform variables caused the shader program to not link properly on some android
devices/emulators.

(cherry picked from commit 502dbc7c4a)
2019-07-17 09:50:00 +02:00
Daniel Rakos a670c66457 Fix texture resource reload bug
If a non-imported texture resource file (e.g. DDS) gets updated the editor
doesn't reload it. The cause of the problem is two-fold:

First, the code of ImageTexture assumes that textures are always imported
from an image, but that's not the case for e.g. DDS. This change thus adds
code to issue a resource reload in case an image reload is not possible
(which is the case for non-imported texture resources).

Second, the code is filled with bogus calls to Image::get_image_data_size()
to determine the mipmap offset when that should be done using
Image::get_image_mipmap_offset(). Previous code literally passed the integer
mip level value to Image::get_image_data_size() where that actually expects
a boolean. Thus this part of the change might actually solve some other
issues as well.

To be pedantic, the texture_get_data() funciton of the rasterizer drivers is
still quite a mess, as it only ever returns the whole mipchain when
GLES_OVER_GL is set (practically only on desktop builds) but this change does
not attempt to resolve that.

(cherry picked from commit e34eb5c26c)
2019-07-17 09:49:34 +02:00
clayjohn c3fd38027e Fixed GLES2 transparency order
(cherry picked from commit 7ae3809f4b)
2019-07-17 09:49:12 +02:00
Guilherme Souza f8f66e5b7a Adds flag AMBIENT_LIGHT_DISABLED to GLES2
Signed-off-by: Guilherme Souza <gdsdsilva@inf.ufpel.edu.br>
(cherry picked from commit 61a844aa61)
2019-07-17 09:48:53 +02:00
clayjohn ebaa06b2be fixes bug when setting projection matrix
(cherry picked from commit e37d723695)
2019-07-17 09:47:32 +02:00
lawnjelly 3433017354 Fixes crash with rigged meshes on some OpenGLES2 devices
Non-tools OpenGLES2 devices that use the USE_SKELETON_SOFTWARE path (i.e. do not support float texture) depend on surface->data being set containing the bone IDs and weights (rasterizer_scene_gles2.cpp, line 1456, RasterizerSceneGLES2::_setup_geometry). However currently if TOOLS_ENABLED is not defined, surface->data is not stored in main memory in rasterizer_storage_gles2.cpp. This causes a crash in rasterizer_scene_gles2.cpp when a rigged object comes into view.

This fix addresses the specific case of skinned objects when USE_SKELETON_SOFTWARE is active, and stores a copy of the bone data, as is done when TOOLS_ENABLED is defined. This fixes the crash by allowing the same mechanism as on desktop, without adding the memory overhead of storing all vertex data where not required.

Fixes #28298

(cherry picked from commit e36e9fdb1c)
2019-07-17 09:43:16 +02:00
Guilherme Souza bb9a8a8132 Fix SHADOWS_DISABLED flag in GLES2
Signed-off-by: Guilherme Souza <gdsdsilva@inf.ufpel.edu.br>
(cherry picked from commit b363125568)
2019-07-11 11:25:31 +02:00
clayjohn 965b13d62a fixed bug in mip map sigma
(cherry picked from commit 670c1b10b2)
2019-04-20 20:24:44 +02:00
JFonS 792beb4b83 Fix hint_range for GLES2 shader uniforms
(cherry picked from commit 059078f075)
2019-04-20 20:17:13 +02:00
Anish Bhobe 16097dd174 Added GLES2 RenderStorage Info calculations.
Proper counting code has been added to update info struct.

Extra: Added the render_info_capture calculations.
Fixes: #27273
(cherry picked from commit 4839b17f93)
2019-04-20 20:08:54 +02:00
clayjohn 2b3f2ee372 keep DEPTH from causing compile error in GLES2
(cherry picked from commit 5056b4a02c)
2019-04-03 17:00:21 +02:00
marxin e3ae29e666 Enable warnings=extra on clang and GCC testers.
And remove 2 warnings from warnings=extra.

(cherry picked from commit e7f22ebdcd)
2019-04-03 16:52:01 +02:00
Rémi Verschelde ac483345c4 GLES2: Convert unsupported float texture types to 8-bit types 2019-03-12 12:14:37 +01:00
Rémi Verschelde 3ebde6fac3 GLES2: Fix comments in previous commit that broke rendering (!)
Do NOT use "[vertex]" in a comment...

Kids, don't try to learn OpenGL on a production branch right before
a stable release.
2019-03-12 00:26:56 +01:00
Rémi Verschelde 74e224f2c7 GLES2: Add comments around EXT_shader_texture_lod check
To avoid reintroducing bugs as I did in #26928 and #26932.

texture2DLodEXT and textureCubeLodEXT are only for the fragment shader with
https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_shader_texture_lod.txt
In the vertex shader, texture2DLod and textureCubeLod are built-in.
2019-03-11 23:18:21 +01:00
Rémi Verschelde 764671d2d0 Revert "GLES2: Ensure extension checks for texture2DLod"
This reverts commit f5f565e3e4.
2019-03-11 23:12:49 +01:00
Rémi Verschelde 4cdb2d0502 Revert "GLES2: Fix regression on texture2DLod extension checks"
This reverts commit 8c2d38152f.
2019-03-11 23:12:39 +01:00
Rémi Verschelde 8c2d38152f GLES2: Fix regression on texture2DLod extension checks
These can't be done after any non-preprocessor token.
2019-03-11 21:59:20 +01:00
Rémi Verschelde bc3c6338cf
Merge pull request #26928 from akien-mga/gles2-texture2DLod-ext-check
GLES2: Ensure extension checks for texture2DLod
2019-03-11 20:51:36 +01:00
Juan Linietsky d9235be54b Enable seamless cubemap only if extension is present. 2019-03-11 16:49:04 -03:00
Rémi Verschelde f5f565e3e4 GLES2: Ensure extension checks for texture2DLod
In canvas.glsl and scene.glsl, we were using texel2DFetch from stdlib.glsl,
which uses texture2DLod. In both cases, the stdlib.glsl include came before
the define of texture2DLod.

Might fix issues for drivers that don't support GL_EXT_shader_texture_lod.
2019-03-11 19:34:31 +01:00
clayjohn 13eee31461 increase size of radiance map in gles2 2019-03-10 22:08:08 -07:00
clayjohn 63bb6808e6 gles2 reallocate texture when transparent is set 2019-03-09 10:56:51 -08:00
Juan Linietsky 7141c73ae8 Use glCopyTexSubImage2D instead of glCopyTexImage2D, should be safer and faster.
May be a solution to #26500
2019-03-07 00:14:13 -03:00
Rémi Verschelde b753223ac2
Merge pull request #26567 from clayjohn/pixel_snap_artifact
Fixed pixel snap precision artifact
2019-03-04 16:58:08 +01:00
clayjohn b804c491b7 fixed pixel snap precision artifact 2019-03-04 07:18:02 -08:00
Rémi Verschelde b811207406 More style cleanup... 2019-03-04 10:11:29 +01:00
Juan Linietsky 34dd772054 Properly redraw if something animated is visible 2019-03-03 13:43:54 -03:00
Juan Linietsky 2f32a75d2e Skeletons can now choose between using local or world coords for processing, fixes #26468 2019-03-03 12:24:00 -03:00
Rémi Verschelde e930fb9a6e Fix typo in 7bad170
And cleanup.
2019-03-02 00:45:01 +01:00
Juan Linietsky 7bad1706c2 -Fix prepass state not being reset, closes #26348
-Send zero values for shader if no default exists
2019-03-01 19:28:24 -03:00
Juan Linietsky 834a984b08 Fixed RGTC (and other compressed) texture supports in GLES2. Fixes #26414 an probably others. 2019-03-01 18:18:55 -03:00
Juan Linietsky ff34cd58ff Skeleton was not providing prober AABB in GLES2, fixed. 2019-03-01 17:41:15 -03:00
Juan Linietsky 51b80f6857 Fixed some crashers, closes #26393 2019-03-01 17:24:57 -03:00
Juan Linietsky 8a9119ad7f Fix non initialized variable. 2019-03-01 16:45:38 -03:00
Rémi Verschelde 3ece0004fa Remove unused include from previous commit 2019-03-01 20:12:35 +01:00
Juan Linietsky 3f681b0681 Clean up blend shape support in GLES2 and GLES3. 2019-03-01 16:01:44 -03:00
Juan Linietsky 8799f69b2c Strive for maximum compatibility in GLES2 regarding depth buffers. 2019-03-01 11:21:21 -03:00
Juan Linietsky 5efd693384 Massive improvement to GLES2 performance, rewrote most ShaderGLES2 class.
This fixes #26337
2019-02-27 23:49:34 -03:00