Commit graph

80 commits

Author SHA1 Message Date
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
Juan Linietsky
65fd37c149 -Rewrote GLES2 lighting and shadows and optimized state changes, did many optimizations, added vertex lighting.
-Did some fixes to GLES3 too
2018-09-23 12:14:50 -03:00
Rémi Verschelde
277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Rémi Verschelde
52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Thomas Herzog
2fa4b50027 [GLES2] fix wrong shader compiler output
The `f` postfix was working fine on dekstop GL but not on
some mobile drivers.
2018-08-24 12:10:54 +02:00
David Sichma
c101dd5fa6 Keeping track of discard
Shader compilation now keeps track of the discard key word.

Previously only variables were monitored. But discard, which needs
special treatment in some cases, went unnoticed by the compiler as
discard is not a variable but a flow control.

This commit adds monitoring for discard.
2018-08-02 21:55:02 +02:00
karroffel
b64171e79c add initial GLES2 3D renderer 2018-07-27 14:15:46 +02:00
Hein-Pieter van Braam
0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Rémi Verschelde
00dfc9c8eb Shader lang: Properly assign INSTANCE_ID to gl_InstanceID
Note that gl_InstanceID is not supported in OpenGL ES 2.0,
so in the gles2 backend we assign it to 0.

Also clean up some duplicates/commented out code.
Fixes #20088.
2018-07-22 14:26:46 +02:00
nemerle
7d9a55bdc5 A typo in ShaderCompilerGLES2 constructor code '==' used instead of '=' 2018-06-13 15:49:13 +02:00
Juan Linietsky
8a5fb669ae
Merge pull request #17421 from Chaosus/fixshaderbugs
Fix few bugs in shader definitions
2018-04-08 09:33:12 -03:00
Poommetee Ketson
ff070de986 s/2017/2018/g for gles2, websocket, linux appdata 2018-03-21 16:07:51 +07:00
Chaosus
2d428a350e Fix few bugs in shader definitions 2018-03-10 21:00:18 +03:00
karroffel
eac4c984df add GLES 2 renderer for 2D
This commit adds a new rendering backend, GLES2, and adds a
project setting to enable it.

Currently this backend can only be used on the X11 platform,
but integrating into other platforms is planned.
2018-03-01 15:12:30 +01:00
Rémi Verschelde
7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde
bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Rémi Verschelde
df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Rémi Verschelde
5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Rémi Verschelde
2a0ddc1e89 Style: Various fixes to play nice with clang-format 2017-01-16 08:49:52 +01:00
Rémi Verschelde
93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Juan Linietsky
bc26f90581 Type renames:
Matrix32 -> Transform2D
	Matrix3 -> Basis
	AABB -> Rect3
	RawArray -> PoolByteArray
	IntArray -> PoolIntArray
	FloatArray -> PoolFloatArray
	Vector2Array -> PoolVector2Array
	Vector3Array -> PoolVector3Array
	ColorArray -> PoolColorArray
2017-01-11 00:52:51 -03:00