Commit graph

649 commits

Author SHA1 Message Date
Juan Linietsky
9b0dd4f571 A lot of progress with canvas rendering, still far from working. 2020-02-11 11:53:27 +01:00
Juan Linietsky
836c2109a0 Changed my mind on Vulkan image API, images should now include mipmaps
This should make it easier to obtain the data directly from an Image
2020-02-11 11:53:27 +01:00
Juan Linietsky
3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Juan Linietsky
9ffe57a10e Modify RenderingDevice to use RIDs, now that they are O(1) 2020-02-11 11:53:26 +01:00
Juan Linietsky
4f163972bb Refactored RID/RID_Owner to always use O(1) allocation.
* Implements a growing chunked allocator
* Removed redudant methods get and getptr, only getornull is supported now.
2020-02-11 11:53:26 +01:00
Juan Linietsky
1522d8c3ee Added support for push constants 2020-02-11 11:53:26 +01:00
Juan Linietsky
fd188ddd51 Initial work on Vulkan:
-Added VulkanContext
-Added an X11 implementation
-Added a rendering device abstraction
-added a Vulkan rendering device abstraction
-Engine does not work, only shows Godot logo (run it from bin/)
2020-02-11 11:53:26 +01:00
Rémi Verschelde
3a5f45a6d1 Merge pull request #35682 from nathanwfranke/canvas-cull-control-fix
Fix bug where canvas culls things at origin with size 0
2020-02-08 14:14:10 +01:00
nathanwfranke
e5cb557b73 Fix bug where Control at origin with 0 size not rendered
Make a new method instead to make the code more elegant


Move Function down a bit
2020-02-07 14:43:27 -06:00
Rémi Verschelde
cdce912de7
Merge pull request #35986 from Chaosus/shader_index
Allow non-constants for indexing builtin types in shaders
2020-02-07 20:45:57 +01:00
Rémi Verschelde
a4b8dbdc0b
Merge pull request #35142 from clayjohn/GLES2-add-3d-textures
Add support for 3D textures to GLES2
2020-02-07 18:36:24 +01:00
Yuri Roubinsky
8469a383ec Allow non-constants for indexing builtin types in shaders 2020-02-07 18:41:26 +03:00
Yuri Roubinsky
3a70566b15 Prevent shader crash if invalid builtin used after array member accessor 2020-02-07 15:21:15 +03:00
Marcel Admiraal
5af3b4ca27 Remove duplicate ERR_PRINT macro. 2020-02-05 11:13:24 +01:00
Yuri Roubinsky
2c4367441c Prevent shader crash when name conflict with "dus" and "__" occured 2020-02-01 12:38:52 +03:00
clayjohn
68915ce20d Add support for 3D textures to GLES2 2020-01-31 10:01:05 -08:00
Yuri Roubinsky
3473a195fc Hides high-level functions from GLES2 shader autocompletion 2020-01-23 12:41:21 +03:00
Rémi Verschelde
46820527de
Merge pull request #35360 from Chaosus/restrict_uint_gles2
Disallow uint/uvec usage on GLES2 platform
2020-01-23 10:12:30 +01:00
Rémi Verschelde
37897dba80
Merge pull request #35406 from lawnjelly/ortho-shadow
Replace CameraMatrix::get_viewport_size with get_viewport_half_extents, shadow culling with ortho camera and other affected issues
2020-01-22 22:02:09 +01:00
lawnjelly
eaf8e5ce52 Change CameraMatrix::get_viewport_size to get_viewport_half_extents
Fixes #26637.
Fixes #19900.

The viewport_size returned by get_viewport_size was previously incorrect, being half the correct value. The function is renamed to get_viewport_half_extents, and now returns a Vector2.

Code which called this function has also been modified accordingly.

This PR also fixes shadow culling when using ortho cameras, because the correct input for CameraMatrix::set_orthogonal should be the full HEIGHT from get_viewport_half_extents, and not half the width.

It also fixes state.ubo_data.viewport_size in rasterizer_scene_gles3.cpp to be the width and the height of the viewport in pixels as stated in the documentation, rather than the current value which is half the viewport extents in worldspace, presumed to be a bug.
2020-01-22 18:22:00 +00:00
Rémi Verschelde
4faaf6089a Remove unused #if 0'ed code 2020-01-21 21:41:54 +01:00
Yuri Roubinsky
4c456ef979 Disallow uint/uvec usage on GLES2 platform 2020-01-20 18:59:35 +03:00
Yuri Roubinsky
3dea1c725e Clears completion_class in shaders (may cause troubles if not). 2020-01-19 16:35:54 +03:00
Yuri Roubinsky
1eb8d5e142 Added missing form of array constructor in shaders 2020-01-18 11:41:55 +03:00
Yuri Roubinsky
5098232ee6 Disabled array initialization, const array and arr.length in shaders 2020-01-16 11:46:11 +03:00
clayjohn
3579187f90 Make texture_debug_usage thread safe 2020-01-12 15:22:54 -08:00
Yuri Roubinsky
1e154e0947 Fix nested break/return in shader switch statement 2020-01-10 11:57:56 +03:00
Rémi Verschelde
5edd1a27d2
Merge pull request #34671 from Chaosus/shader_hex_support
Support for hex numbers in shaders
2020-01-08 10:01:49 +01:00
Hugo Locurcio
0cad2c0cd1
Add VisualServer methods to get the video adapter name and vendor
These methods can be used in scripts to retrieve the OpenGL
`GL_RENDERER` and `GL_VENDOR` strings (respectively).

This closes #28404.
2020-01-06 00:37:56 +01:00
Rémi Verschelde
fa82664419
Merge pull request #34726 from nekomatata/polygon2d-antialiasing-fix
Fixed antialiasing option for Polygon2D with concave/hollow shapes
2020-01-03 14:17:05 +01:00
PouleyKetchoupp
1591677eb8 Fixed antialiasing option for Polygon2D
Some cases were not handled properly for Polygon2D after making changes in common code to fix Line2D antialiasing. Added an option for drawing polygons to differentiate the two use cases.

Fixes #34568
2020-01-01 11:40:14 +01: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
Yuri Roubinsky
99b92c885f Support for hex numbers in shaders 2019-12-29 12:19:10 +03:00
Rémi Verschelde
2845e6a21a
Merge pull request #34040 from qarmin/unused_variable_more_precise_numbers
Removed unused variables, add some constants numbers
2019-12-10 08:25:31 +01:00
Rafał Mikrut
ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Rémi Verschelde
e77c34ab4a
Merge pull request #34061 from Chaosus/fix_shader_const
Fix expressions for global constants in shaders
2019-12-03 08:53:55 +01:00
Rémi Verschelde
10bae7c05b
Merge pull request #33857 from nekomatata/polygon-2d-antialiasing
Fixed antialiased option for Polygon2D
2019-12-03 07:51:16 +01:00
Yuri Roubinsky
8b8faf03d5 Fix expressions for global constants in shaders 2019-12-02 19:00:21 +03:00
PouleyKetchoupp
e6ebc43d72 Fixed antialiased option for Polygon2D / Line2D
Polygon2D:
The property wasn't used anymore after switching from canvas_item_add_polygon() to canvas_item_add_triangle_array() for drawing.

Line2D:
Added the same property as for Polygon2D & fixed smooth line drawing to use indices correctly.

Fixes #26823
2019-11-28 22:57:27 +01:00
Bojidar Marinov
2952dc3fe2
Fix crash when disabling a YSort node
Fixes #33932
2019-11-27 10:47:11 +02:00
Marcel Admiraal
6c3be2ca74 Fix Visual Studio throwing C4146 warning. 2019-11-18 15:14:04 +00:00
PouleyKetchoupp
530665197f Fixed Particles restart after visibility has been set to off and on again
Make sure particles are processed during the same frame when visibility is set to on, in case they are still active from before and need to be restarted.

Fixed #33476
2019-11-09 09:51:17 +01:00
Rémi Verschelde
341f37aaed
Merge pull request #33153 from raphael10241024/fix_occluder
fix occluders positions error under canvas_layer
2019-11-05 14:41:28 +01:00
Yuri Roubinsky
5e44b5be81 Prevents usage of unsupported texture shader types in GLES2 2019-11-03 13:41:15 +03:00
Yuri Roubinsky
6b7f8558d9 Removed switch operator from GLES2 shader back-end 2019-11-02 12:43:32 +03:00
Yuri Roubinsky
1b003f3d64 Prevents shader crash on GLES2 if unsupported built-in has been used 2019-10-31 09:21:44 +03:00
Yuri Roubinsky
76eb486413 Added check if field name in the shader is equal to builtin 2019-10-29 15:37:19 +03:00
RaphaelHunter
c4cea10402 fix occluders positions error under canvas_layer, close #32880 2019-10-29 14:51:58 +08:00
Yuri Roubinsky
ef6161532d Fix shader crash if non-boolean expression inserted into "if" 2019-10-28 08:35:33 +03:00
Hugo Locurcio
701581d1d3
Improve error messages related to shader_type
The list of allowed shader types is now displayed if any
`shader_type`-related error is emitted.

This makes it easier to remember which shader types are allowed
when creating a new shader.
2019-10-26 17:43:14 +02:00