summaryrefslogtreecommitdiff
path: root/scene/resources/sky_material.cpp
AgeCommit message (Collapse)Author
2022-09-13Move debanding into internal sky shader code so that it is applied after ↵clayjohn
everything else. This ensures that the debanding does not scale with exposure or any other effect.
2022-08-31Implement Physical Light Units as an optional setting.clayjohn
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value. In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
2022-08-26Rename `str2var` to `str_to_var` and similarMicky
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
2022-05-24Use IGN instead of white noise for sky ditheringclayjohn
2022-05-24Merge pull request #60803 from Chaosus/shader_hint_renameRémi Verschelde
Rename `hint_albedo`, `hint_white/black` in shaders
2022-05-19Use suffixes for units in nodes and resourcesAaron Franke
2022-05-09Rename `hint_albedo`, `hint_white/black` in shadersYuri Roubinsky
2022-04-09Add dithering to ProceduralSkyMaterial to combat bandingHugo Locurcio
Dithering was already present in PhysicalSkyMaterial. This brings it to ProceduralSkyMaterial as well, with the same algorithm and default intensity.
2022-04-05Merge pull request #58062 from Calinou/panoramaskymaterial-default-blackRémi Verschelde
2022-02-13Default PanoramaSkyMaterial texture to black instead of whiteHugo Locurcio
This prevents blinding the user while the user is still setting up the panorama sky texture.
2022-02-12Add sky cover texture for ProceduralSkyMaterialHugo Locurcio
This brings PhysicalSkyMaterial's Night Sky functionality to ProceduralSkyMaterial, but in a more powerful and general fashion. This can be used to display stars at night, or clouds at day and night. For clouds, it won't be physically accurate, but it can look good still. The Sky Cover Modulate property can be used to adjust the sky cover's colors and opacity in real-time, which is useful for day/night or weather transitions.
2022-02-12Tweak default ProceduralSkyMaterial and PhysicalSkyMaterial appearanceHugo Locurcio
- Tweak colors to be less saturated and more balanced (in terms of hue). The cool blue sky is balanced by a warm brown ground, which makes reflections look closer to how they'd look like when using an HDRI panorama texture. - Make the ground color dark on both ProceduralSkyMaterial and PhysicalSkyMaterial to reduce indoor light leaking, especially when using GI. - Tweak the PhysicalSkyMaterial colors to be as close as possible to ProceduralSkyMaterial (with the default sun orientation). - Tweak editor environment defaults to be identical to the default ProceduralSkyMaterial colors. Previously, the default editor sky color was different from the colors of a newly created ProceduralSkyMaterial resource. Both new skies were tested without GI, with SDFGI and with VoxelGI. They were tuned to look best when using ACES tonemapping with a whitepoint set to 6, but they still look good with other tonemapping operators.
2022-01-25Merge pull request #53954 from Chaosus/fix_quit_errorsRémi Verschelde
2022-01-14Add shader cache and filter variable to PanoramaSkyMaterialBrennen Green
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-21Convert PhysicalSkyMaterial colors to SRGBclayjohn
2021-11-20Fix ProceduralSkyMaterial colors due to double sRGB -> linear conversionHugo Locurcio
2021-10-18Fix errors on quitting from an empty projectYuri Roubinsky
2021-10-07Don't allow translucent colors in built-in sky material propertiesHugo Locurcio
The colors' alpha channel is ignored, so there's no point in exposing it in the editor.
2021-10-04Hide render_priority except when using SpatialMaterialsclayjohn
2021-08-16Merge pull request #50159 from Calinou/standardmaterial3d-add-shader-commentRémi Verschelde
Add a comment at the top of generated shaders
2021-08-16Add a comment at the top of generated shadersHugo Locurcio
This comment is useful to determine the origin of ShaderMaterials converted from built-in material types (such as CanvasItemMaterial or StandardMaterial3D). The Godot version is also included in case the shader needs to be regenerated with a newer engine version.
2021-08-12Use hint_albedo in SkyMaterialsclayjohn
2021-07-21Make Sky initialize shaders only oncereduz
* Create the shader on demand. * Makes sure compilation happens only once, then shader is cached. * Speeds up scene loading times. * Speeds up editor initialization.
2021-07-19Use C++11 raw literals for shader code to improve readabilityHugo Locurcio
In files that have lots of branching, `\t` was replaced with a tab character instead.
2021-07-07Fix Command Queue Crashreduz
* No longer allow sending an object (texture) to the server as material parameter * Keep a parameter cache locally in ShaderMaterial
2021-05-25Added constants PI, TAU and E to the shader languageJoosep Jääger
2021-04-14Refactor GLSL shader compilationreduz
-Used a more consistent set of keywords for the shader -Remove all harcoded entry points -Re-wrote the GLSL shader parser, new system is more flexible. Allows any entry point organization. -Entry point for sky shaders is now sky(). -Entry point for particle shaders is now process().
2021-02-04Rewrote how barriers work for faster renderingreduz
-Added more finegrained control in RenderingDevice API -Optimized barriers (use less ones for thee same) -General optimizations -Shadows render all together unbarriered -GI can render together with shadows. -SDFGI can render together with depth-preoass. -General fixes -Added GPU detection
2021-02-02Add check for sun in PhysicalSkyclayjohn
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-09Increase dithering in the PhysicalSkyMaterial shader to combat bandingHugo Locurcio
Banding should now be much less visible when using the default PhysicalSkyMaterial settings.
2020-05-16Add night sky to PhysicalSkyMaterialclayjohn
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
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.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-04-17Add light size to Sky Shadersclayjohn
2020-03-28Fix copyright headers for recently added filesRémi Verschelde
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-03-24Replace subpass textures with color in sky shaderclayjohn
2020-03-21Working sky shader implementationclayjohn
2020-03-19Add shader based background modeBastiaan Olij