Commit graph

99 commits

Author SHA1 Message Date
lawnjelly e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
Rémi Verschelde 33b2070d2e Remove obsolete GLES2 backend code
This code currently isn't compiled (and cannot compile).

We plan to re-add OpenGL ES-based renderer(s) in Godot 4.0 alongside Vulkan
(probably ES 3.0, possibly also a low-end ES 2.0), but the code will be quite
different so it's not relevant to keep this old Godot 3.2 code.

The `drivers/gles2` code from the `3.2` branch can be used as a reference for
a potential new implementation.
2020-08-13 10:04:53 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
clayjohn 68915ce20d Add support for 3D textures to GLES2 2020-01-31 10:01:05 -08:00
clayjohn 910f8719a0 Fix array constructor for lightmaps 2020-01-15 17:41:46 -08:00
clayjohn 676f647c74 Add a default POINT_SIZE 2019-12-10 23:08:20 -08:00
clayjohn 334d41d7cc Fix Specular Blinn function 2019-11-22 22:03:26 -08:00
clayjohn 4d6737ec73 Fix bugs introduced by IBL fixes 2019-11-20 22:54:44 -08:00
clayjohn cd40154890 Fix issues with environment mapping 2019-11-19 22:30:48 -08:00
clayjohn 7b3d098b2b Fixed using compressed textures and add work around for firefox webgl mesa sampler limit 2019-10-27 23:53:52 -07:00
Rémi Verschelde 823c3def72 Fix copyright headers and style issues 2019-09-24 11:52:06 +02:00
Juan Linietsky d81ddaf33e Added skin support and simplified APIs to override bone position. 2019-09-18 19:46:32 -03:00
Chaosus 8b4c538ab2 Expose several GLES3 built-ins to GLES2 2019-07-31 19:00:10 +03:00
RaphaelHunter 47df933c27 update algorithm about paking float to vec4 to fix shadow shift and change rgba_shdow options 2019-07-28 11:43:01 +08:00
clayjohn 150487e728 fix gles2 shadow transparency bug 2019-07-21 23:52:19 -07:00
clayjohn 80d732082b scale vertex lit lights by envorionment scale 2019-06-19 16:20:14 -07:00
clayjohn 3365595254 do not compute fog when using unshaded in GLES2 2019-05-23 17:17:27 -07:00
Bastiaan Olij 3ea778e66e Implement shadow to opacity 2019-05-21 20:07:46 +10:00
Rémi Verschelde aa3c5f59f2
Merge pull request #27898 from clayjohn/metallic_radiance
Added radiance when using clear color
2019-05-14 07:32:01 +02:00
clayjohn 5c252092e1 added radiance when using clear color and fixed brdf 2019-05-13 12:26:54 -07:00
Rémi Verschelde 86a74e2cb3
Merge pull request #27798 from clayjohn/gles2-proj-mat-bug
Fixes bug when setting projection matrix in shader GLES2
2019-05-13 17:59:40 +02:00
Guilherme Souza b363125568 Fix SHADOWS_DISABLED flag in GLES2
Signed-off-by: Guilherme Souza <gdsdsilva@inf.ufpel.edu.br>
2019-05-07 12:42:28 -03:00
clayjohn e37d723695 fixes bug when setting projection matrix 2019-04-30 08:36:38 -07:00
Rémi Verschelde a3617f6ca8
Merge pull request #28431 from SouzaGuilherme/master
Adds flag AMBIENT_LIGHT_DISABLED to GLES2
2019-04-29 16:55:36 +02:00
Guilherme Souza 61a844aa61 Adds flag AMBIENT_LIGHT_DISABLED to GLES2
Signed-off-by: Guilherme Souza <gdsdsilva@inf.ufpel.edu.br>
2019-04-25 20:25:05 -03:00
clayjohn 5056b4a02c keep DEPTH from causing compile error in GLES2 2019-03-28 22:14:41 -07: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 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
Rémi Verschelde b811207406 More style cleanup... 2019-03-04 10:11:29 +01: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 0ba75c195e Fix GCC 5 build after #26331 and cleanup style
Also cleanup after 01a3dd3.
2019-02-27 09:01:24 +01:00
Rémi Verschelde e47b4bdc3d
Merge pull request #26286 from kaadmy/gles2_ortho_shadow
Fix orthographic shadow color when using GLES2
2019-02-26 08:50:42 +01:00
Juan Linietsky a32b26dfa2 Several fixes to make GLES2 on HTML5 work much better.
Changed math class error reporting to be a bit less paranoid.
2019-02-25 21:47:29 -03:00
KaadmY e1a34d0728 Fix orthographic shadow color when using GLES2 2019-02-25 13:57:23 -08:00
Hein-Pieter van Braam a83e77fded Explicitly use floating point numbers in the our shaders
We need to be explicit about using floating point numbers in our shaders
for compatibility with mobile GLES drivers.
2019-02-24 23:35:10 +00:00
Juan Linietsky d79c8d7655 Fix vertex lighting in GLES2, closes #25365 2019-02-23 19:53:04 -03:00
Juan Linietsky aab8f443f9 -Support DEPTH_TEXTURE in GLES2, fixes #25106
-Fix use of transparent framebuffers in GLES2
-Fix use of ambient color clearing in GLES2 when no environment exists.
2019-02-22 11:35:39 -03:00
Rémi Verschelde c4b736d7ad Fix code style issues 2019-02-22 09:52:27 +01:00
clayjohn 9b0326d2f3 added shadow_color property to gles2 2019-02-17 23:57:57 -08:00
Juan Linietsky 4af8009b9d Fix fog in GLES2 by using epic hack, closes #25410 2019-02-12 14:35:16 -03:00
Juan Linietsky 2e5ede7a4e Properly discard fragments during depth prepass opaque pass, fixes #23321 2019-01-27 20:20:07 -03:00
Juan Linietsky b32298a660 Ensure WebGL uses highp by default, and fix some wrong mediump usages. Fixes #22962. 2019-01-24 18:58:42 -03:00
Juan Linietsky 2d57ec2460 Fix problem with texture2Dlod, closes #25263 2019-01-23 17:06:37 -03:00
Juan Linietsky 4f4e46edd5 Implement unpacking for compressed vertex formats on GLES2 when not supported, fixes #22957 2019-01-22 21:57:09 -03:00