summaryrefslogtreecommitdiffstats
path: root/scene/2d/light_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-1/+1
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* doc: Sync classref with current source + fixup some bindingsRémi Verschelde2020-11-041-5/+3
| | | | Includes various changes triggered by the refactoring of method bindings.
* Implement DirectionalLight2Dreduz2020-11-041-138/+171
| | | | | | | Also separated Light2D in PointLight2D and DirectionalLight2D. Used PointLight2D because its more of a point, and it does not work the same as OmniLight (as shape depends on texture). Added a few utility methods to Rect2D I needed.
* Refactored 2D shader and lighting systemreduz2020-10-241-14/+0
| | | | | | | | | | -Removed normal/specular properties from nodes -Create CanvasTexture, which can contain normal/specular channels -Refactored, optimized and simplified 2D shaders -Use atlas for light textures. -Use a shadow atlas for shadow textures. -Use both items aboves to make light rendering stateless (faster). -Reorganized uniform sets for more efficiency.
* Better validate CollisionShape3D config. warning after #38743Rémi Verschelde2020-10-021-1/+2
| | | | Relates to #42479, though I don't think it would crash in the master version.
* Update all get_configuration_warning to retrieve warnings from the parentArrowInAKnee2020-05-161-2/+6
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-5/+9
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-47/+0
| | | | | | | | | | | | | | 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.
* Renaming of servers for coherency.Juan Linietsky2020-03-271-28/+28
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-4/+4
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Modified light rendering to make it more compatible.Juan Linietsky2020-02-111-16/+0
| | | | Modified polygon management to make it more compatible with MoltenVK
* 2D lighting seems more or less complete.Juan Linietsky2020-02-111-4/+2
|
* Texture refactorJuan Linietsky2020-02-111-3/+3
| | | | | | | | -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
* Control/Light2D: Preventing setting 0 as scale as for Node2DRémi Verschelde2020-01-131-0/+4
| | | | | | | Triggers errors in `Transform2D::affine_invert()`. Fixes #26510. Fixes https://github.com/godotengine/godot/issues/24997#issuecomment-457951639.
* Don't compile editor-only function when tools=noGilles Roudière2020-01-091-0/+2
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | 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.
* Improve the node configuration warning displayHugo Locurcio2019-07-091-1/+1
| | | | | | | - Refer to properties explicitly when possible - When multiple warnings are returned, always separate them by one blank line to make them easier to distinguish - Improve grammar and formatting
* Tweak some editor property hints to be more flexible and consistentHugo Locurcio2019-06-161-1/+1
| | | | This partially addresses #19242.
* Light2D height range expanded to -2048 to 2048.Jared2019-04-051-1/+1
|
* Do not restrict light texture type (wont work with atlas, though)Juan Linietsky2019-01-271-1/+1
|
* Fixes to 2D lights, closes #24750Juan Linietsky2019-01-171-1/+1
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+1
| | | | | | 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.
* Only allow StreamTexture, ImageTexture in Light2D, closes #15194Juan Linietsky2018-09-061-1/+1
|
* Fixes the bad calculation of margin & anchors when child of Node2Dgroud2018-06-071-2/+10
|
* Remove the selection rect for nodes that do not require itGilles Roudiere2018-04-031-0/+4
|
* 2D editor GUI input rework. Changes are:Gilles Roudiere2018-02-161-17/+19
| | | | | | | | | | - The input handling is done into several distinct functions, and the code is more consistent. - The actions' history is more precise ("Edited CanvasItem" is now "Rotated CanvasItem","Moved CanvasItem",etc...) - Fixed a little bug about input key events not forwarded correctly to plugins - IK is followed by default when you move a bone node, the alt-key allow you to move it normally
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Rework the canvas_item API for further improves to the canvas item editorGilles Roudiere2017-11-191-4/+4
|
* Fix enums bindingsMaxim Sheronov2017-09-131-0/+7
| | | | | Add missed bindings for enums Move some enums to class to have correct output of api.json
* add shadow_filter variant PCF7letheed2017-09-011-1/+1
|
* Merge pull request #10622 from letheed/patch-1Rémi Verschelde2017-08-281-1/+1
|\ | | | | Allow to disable shadow gradients in Light2D
| * Allow to disable shadow gradients in Light2D Letheed2017-08-241-1/+1
| | | | | | | | | | | | | | | | Currently the shadow gradient can't be disabled and always has a minimum value of 1. I'm not sure why though, the default value seems to be 0 and the rasterizer checks for 0 [here](https://github.com/godotengine/godot/blob/8fc6bb8f771c520c15320c3b4be561abc648d65d/drivers/gles3/rasterizer_canvas_gles3.cpp#L1284) before enabling it. Feels like a bug to me, but if there's a reason for that let me know. As a side effect, this edit effectively changes the default value from 1 to 0 for new projects.
* | Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|/
* Merge pull request #10351 from neikeq/enums-are-for-the-weakJuan Linietsky2017-08-211-4/+4
|\ | | | | ClassDB: Provide the enum name of integer constants
| * ClassDB: Provide the enum name of integer constantsIgnacio Etcheverry2017-08-201-4/+4
| |
* | Merge pull request #10319 from neikeq/pr-engine-editor-hintJuan Linietsky2017-08-201-1/+3
|\ \ | |/ |/| Adds Engine::is_editor_hint() method
| * Removes editor_hint from SceneTreeIgnacio Etcheverry2017-08-191-1/+3
| |
* | Rename Light2D::scale to texture_scale, so it doesn't conflictBojidar Marinov2017-08-141-1/+1
|/
* Removes type information from method bindsIgnacio Etcheverry2017-08-101-2/+2
|
* Add object type hint for docsPoommetee Ketson2017-07-191-2/+2
|
* -Fixed occluder rendering, closes #8560Juan Linietsky2017-06-131-0/+16
| | | | -Ability to smooth out 2D shadow filters
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-198/+165
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename the _MD macro to D_METHODHein-Pieter van Braam2017-02-131-40/+40
| | | | | | This new name also makes its purpose a little clearer This is a step towards fixing #56
* Remove use of _SCS from ADD_METHODHein-Pieter van Braam2017-02-131-20/+20
| | | | This saves typing and is a step towards fixing #56