Commit graph

680 commits

Author SHA1 Message Date
Juan Linietsky 6d4d55cd42 Do not use depth prepass if effects are disabled, fixes #25267 2019-01-25 15:58:07 -03:00
Bastiaan Olij fe72e69c79
Revert "Fix GLES3 error 502 on iOS" 2019-01-26 01:51:41 +11:00
Juan Linietsky 677d4400de Ensure contact shadows are only used when lights use them. 2019-01-25 11:41:25 -03:00
Bastiaan Olij da7f9e1ed1 Fix GLES3 error 502 on iOS 2019-01-26 00:52:54 +11:00
Juan Linietsky 42764ed252
Revert "Fix errors on iOS" 2019-01-24 17:15:52 -03:00
Rémi Verschelde 148e62102b
Merge pull request #25257 from karroffel/tex3d-get-data-fix
implemented texture_get_data() for TextureLayered
2019-01-24 16:19:21 +01:00
thomas.herzog dddfe9a2df implemented texture_get_data() for TextureLayered 2019-01-23 16:12:29 +01:00
Bastiaan Olij cab45f2f26 Fix errors on iOS 2019-01-23 13:38:19 +11:00
Juan Linietsky 46af4b0a4b Changes to GLES2 renderer to not use cube shadows if not available, fixes #25132 2019-01-22 10:05:23 -03:00
Rémi Verschelde d4ab9d1d6e
Merge pull request #25115 from marxin/fix-19633-proper
Fix #19633 by proper store to &ubo_data.shadow_matrix[1234].
2019-01-21 17:40:56 +01:00
Rémi Verschelde 769341e180 Cleanup after @reduz :)
Fixes #25172.
2019-01-21 11:12:55 +01:00
marxin d9eb6a5b20 Fix #19633 by proper store to &ubo_data.shadow_matrix[1234].
It is not valid in C++ to store into shadow_matrix1[16] with shadow_matrix1[16 * j]
(for j > 0). Even though there's a valid space in a struct after shadow_matrix1.
Knowing that GCC performs aggressive optimizations that eventually lead
to a wrong code. Code has been changed into union where one can either
use shadow_matrix[4 * 16], or individual shadow_matrix1, shadow_matrix2, etc. GCC pragma
is not needed any longer.
2019-01-19 10:25:01 +01:00
Rémi Verschelde 50c8019dcd Fix excluding GCC pragmas from Clang
Why the heck does Clang define __GNUC__...
2019-01-19 08:17:32 +01:00
Rémi Verschelde a9fcd574f4 Only define GCC pragmas for GCC 2019-01-19 08:00:17 +01:00
Juan Linietsky e3ef52a270
Merge pull request #25101 from hpvb/fix-19633
Work around a GCC optimizer bug at -O3
2019-01-18 12:32:30 -03:00
Hein-Pieter van Braam 6793908a3f Work around a GCC optimizer bug at -O3
This bug has been reported upstream, once it gets fixed we'll add some
version guards to only disable this for specific GCC versions.

This fixes #19633
2019-01-18 16:31:37 +01:00
Rémi Verschelde 6384dd8f2c
Merge pull request #25070 from RedMser/shader_errors_linefix
Fix shader compile error line numbers starting at 0
2019-01-18 11:15:44 +01:00
Emanuele Fornara e1be09d8fd Fix enum scope 2019-01-17 20:29:01 +01:00
RedMser a285a1cfdf Fix shader compile error line numbers starting at 0. 2019-01-17 19:25:08 +01:00
Juan Linietsky 7478f468b2 Fixes to 2D lights, closes #24750 2019-01-17 10:40:36 -03:00
Juan Linietsky ca03d7e0d7 Ensure canvas copy texscreen will not crash if render target is configured without copy buffers. Closes #24749. 2019-01-15 15:14:43 -03:00
Juan Linietsky 9ed34d4423 Use GLES2 approach to vertex shading in GLES3, which has been more developed. Fixes #21852 2019-01-14 20:41:12 -03:00
Rémi Verschelde d8f0087dc8
Merge pull request #24568 from Shinryuuji/fix-wrong-texture-array-target
Fix wrong default target for sampler2DArray
2019-01-04 16:14:29 +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 99c4faf837
Merge pull request #24575 from nekomatata/android-curve-texture
Fixed CurveTexture with GLES3 on Android
2019-01-04 15:31:08 +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
PouleyKetchoupp a1160ff8e7 Fixed CurveTexture with GLES3 on Android 2018-12-30 19:49:55 +01:00
Bastiaan Olij 9f266cf7e5 Override GL_position 2018-12-29 23:56:50 +11:00
Bastiaan Olij 9055386de9 Fix texture type not being initialised 2018-12-29 23:44:28 +11:00
Juan Linietsky a366d45856 -Implented 2D Mesh support for GLES2
-Implemented 2D Skeleton deform for GLES2
-Implement Multimesh support for GLES2, closes #20524, closes #21839
2018-12-27 20:41:04 -03:00
Shinryuuji 7bfddbec3a Fix wrong default target for sampler2DArray 2018-12-23 15:25:46 +01:00
PouleyKetchoupp ab7759dbd1 Fixed fragment shader compilation error on android (S0001: Cannot compare 'float' with 'int') 2018-12-21 20:31:10 +01:00
Bastiaan Olij f3dd3c0830 Adding option to re-orient our sky 2018-12-15 19:41:34 +11:00
QbieShay 7c55228f5c fixed uv missing in vertex shader of canvas. 2018-12-13 07:48:30 +01:00
Rémi Verschelde c8a5400654
Merge pull request #24241 from Rubonnek/move-to-initializer-list
Moved member variables to initializer list
2018-12-12 09:25:34 +01:00
Wilson E. Alvarez 08f22f1cf0
Moved member variables to initializer list 2018-12-11 18:33:01 -05:00
Rémi Verschelde 37e198c320
Merge pull request #23483 from clayjohn/fragment_camera_view
Make VIEW vector available in fragment shader
2018-12-11 20:44:41 +01:00
clayjohn 2042d6214e make VIEW vector available in fragment 2018-12-11 09:44:38 -08:00
Rémi Verschelde 022ae53191
Merge pull request #23126 from QbieShay/nine_uv
UV for ninepatch now maps to the proper  ninepatch mapped UV.
2018-12-11 16:05:20 +01:00
Bastiaan Olij 0b4b477674 Remapped ACTIVE to shader_active, now works 2018-12-01 21:10:04 +11:00
Rémi Verschelde b47d4e1ba5
Merge pull request #24017 from eska014/rt-squish
Enable squish decompression in runtime builds
2018-11-28 12:40:43 +01:00
Leon Krause 93bed8cf57 Check for WebGL RGTC extension 2018-11-28 11:12:26 +01:00
Rémi Verschelde dd06f6ee70 Fix style issues and signature mismatch 2018-11-28 10:21:07 +01:00
Juan Linietsky af8d941c55 Added luminance capping to avoid glitches on small dots. closes #17996 2018-11-28 01:22:20 -03:00
Juan Linietsky e6bc152de8 NORMALMAP was not working (no normal being used detected), fixes #9263 2018-11-27 18:05:20 -03:00
Rémi Verschelde c5ebf38490 Prevent GLAPIENTRY redefine in rasterizer, now included in glad.h
We otherwise had conflicting defines since 1a41daf3.
2018-11-23 21:19:59 +01:00
Juan Linietsky a397d3a46a Avoid voxel cone trace from going full 180 degrees, fixes #20716 2018-11-23 08:42:35 -03:00
QbieShay 09faac9e01 Added PROCESSED_UV for accessing ninepatch processed uv in the shader 2018-11-22 19:06:43 +01:00
Juan Linietsky 631cf676c3 Removed noperspective (not in GLSL ES 3.0), do not write smooth if not specified. Fixes #20435 2018-11-21 23:07:09 -03:00
Juan Linietsky f150c5b4a0 Clean up code to make intention clear, fixes #20361 2018-11-21 22:32:05 -03:00
Juan Linietsky 78624ad22c Ensure double sided normalmaps work, fixes #23760 2018-11-21 08:48:33 -03:00
Rémi Verschelde 296834955f Remove debug print in RasterizerStorageGLES3 2018-11-20 07:58:26 +01: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 a78b42c058 Don't post process on tiny render targets, fixes #19628 2018-11-19 22:05:55 -03:00
Juan Linietsky d5ad1ca1ae Fix crash on canvas with BG_MODE_KEEP, closes #19590 2018-11-19 21:41:18 -03:00
Juan Linietsky d304228003 Do not draw particles if they are not processing at all, fixes #19507 2018-11-19 20:34:29 -03:00
Juan Linietsky 634aa4fc24 Ensure bone AABBs are properly transformed to affect mesh AABB, fixes #19281 2018-11-19 10:43:29 -03:00
Juan Linietsky 455f297671 Properly reset canvas state after drawing, fixes #18860 2018-11-18 16:34:20 -03:00
Rémi Verschelde 60ee61c7ff
Merge pull request #23742 from JFonS/fix_23698
Use hint_color when getting shader default params
2018-11-18 12:05:02 +01:00
Wilson E. Alvarez f8e0051420 Removed unnecessary assignments 2018-11-17 20:40:55 -05:00
Juan Linietsky 8aa38c9ad8 Fix shader bug likely introduced recently. 2018-11-16 14:30:34 -03:00
Juan Linietsky e77afb8507 Ensure environment radiance is not used on refprobe interiors, fixes #17868 2018-11-16 11:46:21 -03:00
Juan Linietsky bb9127a78b Removed unnecesary normal multiplication (only culling was really needed), fixes #17776 2018-11-16 10:52:31 -03:00
Juan Linietsky 40e4f5bef4 Proxies were being mishandled, leading to the now fixed #17651 2018-11-16 09:33:33 -03:00
JFonS fb92c7b0fa Use hint_color when getting shader default params 2018-11-16 12:20:23 +01:00
Juan Linietsky 4d88721e62 Do not error on empty shader, just treat it as invalid by default. Fixes #15998. 2018-11-14 10:58:16 -03:00
Juan Linietsky 55f5f4757e
Merge pull request #23248 from dlasalle/fog
Add parameters for fog end depth and use alpha as density.
2018-11-14 10:24:55 -03:00
Juan Linietsky 43b9ed64c8
Merge pull request #23702 from JFonS/fix_2d_particles_scale
Make 2D particles work OOTB (again)
2018-11-14 10:16:50 -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
Dominique LaSalle 6eae6247e4 Add parameter for fog max depth and use alpha as density. 2018-11-13 17:19:11 -08:00
JFonS cbfb7bd613 Make 2D particles work OOTB (again) 2018-11-13 23:25:05 +01:00
Rémi Verschelde 8849d3b47d
Merge pull request #22639 from tagcup/opt
Avoid some unnecessary calculations in scene.glsl.
2018-11-12 21:22:57 +01:00
Rémi Verschelde 3bc7dfc856
Merge pull request #23254 from ibrahn/gles2-var-init-cleanup
Cleaning up some uninitialised variables in GLES2 stuff.
2018-11-12 20:47:19 +01:00
Juan Linietsky f00b522705 Avoid double underscore from breaking glsl compiler, fixes #12880 2018-11-10 10:48:18 -03:00
Rémi Verschelde 17b776e549
Merge pull request #23502 from Rubonnek/simplified-logic
Simplified boolean logic in GLES2/3 rasterizers
2018-11-05 08:31:14 +01:00
JFonS 85ce4a67ed Remove animation loop from ParticlesMaterial + improvements to CPUParticles2D
Remove animation loop from ParticlesMaterial and move it to
SpatialMaterial for 3D particles and Particles2D for the 2D case.

Added animation to CPUParticles2D as well as the "Convert to
CPUParticles2D" to the PAarticles2D menu.
2018-11-04 15:58:12 +01:00
Wilson E. Alvarez e4884cfc75
Simplified boolean logic in GLES2/3 rasterizers 2018-11-04 09:14:50 +00:00
Ibrahn Sahir 352b3c9c93 Cleaning up some uninitialised variables in GLES2 stuff.
Initialise keep_original_textures and use_fast_texture_filter in storage
config. Removed any other variables from storage config that were both unused
and uninitialised to avoid future confusion (if they're needed it's
easier to spot an uninitialised variable problem in a PR that adds the
variable again rather than just uses it).

Copied storage Texture struct constructor from GLES3 implementation
(except where variables were already initialised with different values).
Gives us sensible tested defaults for previously uninitialised vars.

Added assignments for state.current_main_tex based on same in GLES3.
2018-11-02 14:09:32 +00:00
Juan Linietsky 9c195b57a0
Merge pull request #23125 from JFonS/fix_texture_get_data
Implement rasterizer texture_get_data on OpenGL ES
2018-11-01 12:56:31 -03:00
JFonS edcccaf8c1 Implement rasterizer texture_get_data on OpenGL ES 2018-11-01 11:30:49 +01:00
Leon Krause 92e7c8daf0 Use BufferSubData instead of MapBufferRange in HTML5 platform
WebGL does not support MapBufferRange or UnmapBuffer.
Also used in non-ES platforms where an extra-copy is avoided.
2018-10-29 21:01:39 +01:00
Rémi Verschelde 1169196f04
Merge pull request #22779 from Superwaitsum/LimitSettings
Limit several project settings
2018-10-25 11:38:06 +02:00
Superwaitsum e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Dominique LaSalle f39d14dd61 Fix gles3 shader to actually multiply specular light by rev_amount for fog calculations. 2018-10-22 21:09:34 -07:00
Dualtagh Murray b902a2f2a7 Fixing warnings generated by MSVC
Fixes #22684.
2018-10-19 11:45:24 +02:00
Rémi Verschelde 8b56ea3138
Merge pull request #22800 from QbieShay/depth_write
Added the ability to write to gl_FragDepth.
2018-10-11 17:31:50 +02:00
Ferenc Arn 35ea827e83 Avoid some unnecessary calculations in scene.glsl. 2018-10-11 10:34:37 -04:00
Juan Linietsky 14494dddd0 Fixes to CPU particles for performance and avoiding NaNs. 2018-10-08 00:55:43 -03:00
Juan Linietsky e0871b0f52 Baker fixes 2018-10-07 11:18:44 -03:00
Rémi Verschelde bf6dcb9105
Merge pull request #22722 from akien-mga/fix-warnings
Fix more "may be used initialized" warnings from GCC 7
2018-10-07 11:07:13 +02:00
Aaron Franke 4f7b33cdcf Remove redundant "== false" code
Some of this code has been re-organized.
f
2018-10-06 16:20:41 -04:00
QbieShay ac04e14a51 Added the ability to write to gl_FragDepth. It doesn't affect the depth prepass. 2018-10-06 19:34:50 +02:00
Rémi Verschelde 3e9740ac93 Fix more "may be used initialized" warnings from GCC 7
Fixes the following GCC 7 warnings:
```
core/cowdata.h:269:47: warning: 'alloc_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/error_macros.h:163:26: warning: 'nearest_point' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1579:5: warning: 'colormap_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1582:12: warning: 'size_height' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1590:23: warning: 'size_width' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1599:29: warning: 'pixel_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/math/face3.cpp:207:15: warning: 'tri_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/math/face3.cpp:209:15: warning: 'tri_min' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:665:22: warning: 'best_used_frame' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_storage_gles3.cpp:865:27: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_storage_gles3.cpp:980:29: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::frag_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::id' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::vert_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/plugins/script_editor_plugin.cpp:1980:31: warning: 'se' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/scene_tree_dock.cpp:840:30: warning: 'new_node' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'a1' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lll' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lul' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4260:9: warning: 'a2' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4261:9: warning: 'a3' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4265:3: warning: 'enable_lin' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4294:3: warning: 'enable_ang' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4311:34: warning: 'll' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4311:34: warning: 'ul' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1655:47: warning: 'cone_dirs' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1656:73: warning: 'cone_weights' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/gui/texture_progress.cpp:181:6: warning: 'cp' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/gui/texture_progress.cpp:181:6: warning: 'cq' may be used uninitialized in this function [-Wmaybe-uninitialized]
servers/physics/shape_sw.cpp:1056:19: warning: 'support_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-10-04 18:54:20 +02:00
Rémi Verschelde 6ab78d9ffb Fix some more warnings reported by CI
Fixes the following Clang 7 warnings:
```
core/io/marshalls.cpp:872:10: warning: unused variable 'f' [-Wunused-variable]

core/ustring.cpp:1831:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
core/ustring.cpp:1832:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]

drivers/gles3/rasterizer_gles3.cpp:82:24: warning: unused function '_gl_debug_print' [-Wunused-function,34]

main/main.cpp:118:13: warning: unused variable 'auto_build_solutions' [-Wunused-variable]

modules/csg/csg_gizmos.cpp:225:46: warning: 'current' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-10-03 14:13:42 +02:00
Rémi Verschelde 45842c0ea9
Merge pull request #22627 from akien-mga/gles2-pixel-snap
GLES2: Implement pixel snap 2D option
2018-10-02 19:09:34 +02:00
Rémi Verschelde ac2a4771d5 GLES2: Implement pixel snap 2D option 2018-10-02 15:53:24 +02:00
Rémi Verschelde 8c9c1d6882
Merge pull request #21436 from CptPotato/tonemap-fixes
tonemapping fixes
2018-10-02 15:42:15 +02:00
Rémi Verschelde 4d693fc3f0
Merge pull request #22455 from Calinou/reverse-cull-face-update-light
Update lights when their reverse cull face mode is toggled
2018-10-02 15:23:24 +02:00
Rémi Verschelde 9c93a401b9
Merge pull request #22483 from tagcup/fresnel
Restore the Fresnel term in the BRDF.
2018-10-02 15:18:31 +02:00
Bastiaan Olij a6df366b23 Moving lens distortion shader into drivers and adding GLES2 support 2018-10-02 17:14:43 +10:00