Commit Graph

100 Commits

Author SHA1 Message Date
Rémi Verschelde 41b836cb3d
Merge pull request #38450 from lawnjelly/shaper_modulate
GLES2 batching - prevent color baking with MODULATE or COLOR
2020-05-04 15:13:35 +02:00
lawnjelly b08ad9ef64 GLES2 batching - prevent color baking with MODULATE or COLOR
Adding the ability to access MODULATE in the shader breaks when final_modulate is baked into vertex colors (this is a technique used to batch together different colored items). This PR prevents baking vertex colors when MODULATE is detected in the shader.

It also prevents baking when COLOR is read in canvas shaders, which could currently produce the wrong result in the shader if colors were baked. It does not prevent baking if COLOR is only written, which happens in most shaders, and will operate correctly without baking.
2020-05-04 11:19:55 +01:00
Pedro J. Estébanez d8be5a9986 Add MODULATE builtin to canvas item shaders 2020-05-04 00:10:24 +02:00
Rémi Verschelde f2150d1766
Merge pull request #37462 from Chaosus/shader_fix_const_order
[3.2] Fix shader constant sorting
2020-04-29 09:41:49 +02:00
clayjohn 782fd5fab6 Avoid duplicating shader defines in GLES2 2020-04-26 23:28:24 -07:00
Yuri Roubinsky ee93c85ef1 Fix shader constant sorting 2020-03-31 14:32:33 +03:00
fhuya 30d738eda7 Add support for opengl external textures as defined by https://www.khronos.org/registry/OpenGL/extensions/OES/OES_EGL_image_external.txt 2020-03-05 13:09:49 -08:00
Yuri Roubinsky 786b1cc7ff Fix shader crash if using multiple underscores in identifier names
(cherry picked from commit 15358b808b)
2020-02-06 13:02:07 +01: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
Juan Linietsky 0de8309b2c Many fixes to GLES2 renderer, fixed compilation issues in GLES3 shaders. 2018-09-29 13:49:34 -03:00