Commit graph

101 commits

Author SHA1 Message Date
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
69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Yuri Roubinsky
bc30f541e6 Fix shader constant sorting 2020-04-11 12:40:17 +03:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Juan Linietsky
a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
Yuri Roubinsky
6b99bda1e8 Added support for arrays as shader struct members 2020-02-12 17:10:20 +03:00
Yuri Roubinsky
6f162395ff Implementation of 'struct' for shaders 2020-02-11 20:00:42 +03:00
clayjohn
68915ce20d Add support for 3D textures to GLES2 2020-01-31 10:01:05 -08:00
Yuri Roubinsky
15358b808b Fix shader crash if using multiple underscores in identifier names 2020-01-31 09:11:17 +03:00
Yuri Roubinsky
5098232ee6 Disabled array initialization, const array and arr.length in shaders 2020-01-16 11:46:11 +03:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
clayjohn
676f647c74 Add a default POINT_SIZE 2019-12-10 23:08:20 -08:00
Yuri Roubinsky
6b7f8558d9 Removed switch operator from GLES2 shader back-end 2019-11-02 12:43:32 +03:00
Rémi Verschelde
28265fb526
Merge pull request #31202 from azagaya/light-data
Create shadow_vec for altering shadow computation
2019-09-19 20:03:04 +02:00
Chaosus
1333ea2a2d Implement shader array support for varyings 2019-09-14 18:23:25 +03:00
azagaya
b835868067 Create shadow_vec for altering shadow computation
In 2.1 and 3.0, light_vec could be modified for altering shadow_computations.
But it broke shadows when rotating light. shadow_vec would do the same, but without breaking
shadows in rotated lights if not used.

Add inverse light transformation to shadow vec, so it's not affected when rotating lights;

Added usage define for shadow vec.

For shadow vec working properly when rotating a light, it's needed to multiply it by light_matrix normalized. Added usage define in order to don't do that if shadow_vec not used.
2019-09-06 13:55:49 -03:00
Rémi Verschelde
ebbf63a87c
Merge pull request #31746 from clayjohn/skip-vertex-transform-gles2
Fix skip_vertex_transform bug in GLES2 CPUParticles
2019-08-29 08:37:12 +02:00
clayjohn
97f66900bb Fix skip_vertex_transform bug in GLES2 CPUParticles 2019-08-28 11:57:33 -07:00
Rémi Verschelde
816ddd7817
Merge pull request #31556 from Chaosus/gles2_inverse
Implemented inverse shader function to GLES2
2019-08-26 13:52:03 +02:00
Yuri Roubinski
4dda253ee0 Implements switch to shaders 2019-08-23 14:43:09 +03:00
Yuri Roubinski
4dcee2035a Implemented inverse shader function to GLES2 2019-08-22 08:22:49 +03:00
Yuri Roubinski
9abf5578ee Fix ternary operator shader compiler expression 2019-08-19 08:40:54 +03:00
Yuri Roubinski
a525e3c5ce Implemented do/while loops for shaders 2019-08-13 18:39:55 +03:00
Yuri Roubinski
b24b3497d6 Implemented local shader constants 2019-08-05 10:35:53 +03:00
Chaosus
8b4c538ab2 Expose several GLES3 built-ins to GLES2 2019-07-31 19:00:10 +03:00
clayjohn
3f25dde6b4 added round function to gles2 2019-07-29 11:17:08 -07:00
Chaosus
9379cbc774 Added local array initializer 2019-07-16 07:13:37 +03:00
Chaosus
c37379456f Implemented local shader arrays 2019-07-15 15:57:39 +03:00
Marcus Brummer
10f1e0f63a 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
2019-07-05 01:00:02 +02:00
Chaosus
c2d4abf62e Added constant support to shaders
Co-authored-by: DavidSichma <sichmada@gmail.com>
2019-06-01 13:41:07 +03:00
Rémi Verschelde
b9ee3f3d64
Merge pull request #29014 from mbrlabs/gles2_precision_fix
Use highp precision in the gles2 fragment shader if available
2019-05-27 12:18:47 +02:00
Marcus Brummer
502dbc7c4a 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.
2019-05-25 14:26:08 +02:00
Bastiaan Olij
3ea778e66e Implement shadow to opacity 2019-05-21 20:07:46 +10:00
Juan Linietsky
74d0ed2236 Many separate fixes to ensure non power of 2 textures work on GLES2, closes #25897 and many others 2019-02-24 22:36:53 -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
5fc86026ca Fix typos with codespell
Using codespell 1.14.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
doubleclick
lod
nd
numer
que
te
unselect
EOF
$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-02-13 09:23:29 +01:00
Hein-Pieter van Braam
d308eb091a Fix many asan and ubsan reported issues
This allows most demos to run without any ubsan or asan errors. There
are still some things in thirdpart/ and some things in AudioServer that
needs a look but this fixes a lot of issues. This should help debug less
obvious issues, hopefully.

This fixes #25217 and fixes #25218
2019-01-30 06:43:56 +01:00
Rémi Verschelde
b77b536582 Cleanup and identify ShaderCompilerGLES[23] differences 2019-01-28 19:28:00 +01:00
Rémi Verschelde
1148a33b20 GLES2: Define LIGHT Spatial shader builtin
Fixes #25421.
2019-01-28 17:27:20 +01:00
RedMser
a285a1cfdf Fix shader compile error line numbers starting at 0. 2019-01-17 19:25:08 +01:00
Rémi Verschelde
1504c96112
Merge pull request #24539 from BastiaanOlij/override_gl_position
Override GL_position
2019-01-04 15:40:05 +01:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde
d1f3b622f0 Fix missing/malformed license headers 2019-01-01 12:46:36 +01:00
Bastiaan Olij
9f266cf7e5 Override GL_position 2018-12-29 23:56:50 +11:00
Rémi Verschelde
e2caaf1b6d
Merge pull request #23899 from BastiaanOlij/fix_particle_active
Remapped ACTIVE to shader_active, now works
2018-12-02 21:26:12 +01:00
Bastiaan Olij
0b4b477674 Remapped ACTIVE to shader_active, now works 2018-12-01 21:10:04 +11:00
clayjohn
fd7607bf82 fixed gles2 camera_matrix bug 2018-11-30 10:20:16 -08:00
Juan Linietsky
78eae047c6 Fixed how floats are printed to the GLSL shader, closes #19803 2018-11-19 23:41:18 -03:00
Juan Linietsky
984063cf0b Cleaned up and fixed the base_changed function in rasterizers, also fixes #15617 2018-11-14 09:32:39 -03:00
Juan Linietsky
f00b522705 Avoid double underscore from breaking glsl compiler, fixes #12880 2018-11-10 10:48:18 -03:00