Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dithering #9014

Merged
merged 7 commits into from Dec 19, 2023
Merged

Add dithering #9014

merged 7 commits into from Dec 19, 2023

Conversation

HybridDog
Copy link
Contributor

@HybridDog HybridDog commented Oct 3, 2019

Goal:
Add dithering to reduce banding artifacts

How does it work:
Dithering is disabled by default and can be enabled with a setting.
It is applied in the second-stage shader and uses the algorithm supplied by Calinou.

Does it resolve any reported issue?

I don't think there's an issue about this.

If not a bug fix, why is this PR needed? What usecases does it solve?

On some displays, banding is easily noticeable in Minetest.
Dithering before the quantisation to 8 bits can prevent banding artifacts
and an implementation requires only a few lines of code.

How to test

It may be difficult to see banding on some screens because 8x8x8 bit colours are already a lot possible values.

Disabled dithering (current behaviour):
dithering_off
Edited with GIMP to show the bands:
dithering_off_edited

Enabled dithering:
dithering_on
Edited with GIMP to show the dithering pattern:
dithering_on_edited

Please look at the pictures in 1:1 scaling or upscaled by an integer factor without interpolation, and ideally with a black background instead of the white Github page background.

@sfan5 sfan5 added @ Client / Audiovisuals Feature ✨ PRs that add or enhance a feature Shaders labels Oct 3, 2019
@sfan5
Copy link
Member

sfan5 commented Oct 3, 2019

This is just a static dither pattern so I wouldn't call it debanding (though it does have that effect).
The effect is also very subtle, so I'm not sure if this PR is worth it.

@paramat paramat added Feature request Issues that request the addition or enhancement of a feature and removed Feature ✨ PRs that add or enhance a feature labels Oct 3, 2019
@HybridDog
Copy link
Contributor Author

HybridDog commented Oct 3, 2019

This is just a static dither pattern so I wouldn't call it debanding (though it does have that effect).

The dithering is caused by rounding after the values are changed in a chessboard pattern. Do you have a suggestion on how I could call the setting?

The effect is also very subtle, so I'm not sure if this PR is worth it.

In my experience, banding is easy to see when the screen brightness is very high and you look at a stone node in a dim cave.
The dithering is optional and fairly simply (not very much code); nonetheless, it mitigates banding (when I test it).

@Calinou
Copy link
Member

Calinou commented Oct 3, 2019

I don't remember seeing banding in Minetest, but the implementation looks simple enough. Out of curiosity, what's the performance impact like?

@HybridDog
Copy link
Contributor Author

Out of curiosity, what's the performance impact like?

I don't know. How can I measure it?

@Calinou
Copy link
Member

Calinou commented Oct 3, 2019

@HybridDog Measure the FPS in a complex scene before and after enabling it 🙂

@paramat
Copy link
Contributor

paramat commented Oct 3, 2019

I am not convinced it is worth adding, seeing banding is apparently rare (i never have) and when you do it is probably very subtle and not a problem.
👎

@sfan5 sfan5 added Feature ✨ PRs that add or enhance a feature and removed Feature request Issues that request the addition or enhancement of a feature labels Oct 3, 2019
@HybridDog
Copy link
Contributor Author

HybridDog commented Oct 4, 2019

Measure the FPS in a complex scene before and after enabling it slightly_smiling_face

I've tested it and didn't notice any difference. It was about 40 FPS with and without the dithering.

I am not convinced it is worth adding, seeing banding is apparently rare (i never have) and when you do it is probably very subtle and not a problem.

I often see subtle banding in minetest when I look closely. This is not a problem, but the simple debanding effect is optional and it slightly increases the visual quality without noticeable performance loss.

@paramat
Copy link
Contributor

paramat commented Oct 4, 2019

But it also adds to review, testing, bugfixing and maintenance workload, and to code complexity, for near-zero benefit. I think this is what sfan5 means by 'worth it'.

@HybridDog
Copy link
Contributor Author

But it also adds to review, testing, bugfixing and maintenance workload, and to code complexity, for near-zero benefit.

The code for this is very simple, so I think there's not much to review and maintenance, and if there's a bug, you can simply disable the setting or remove the feature. Testing it also shouldn't be difficult.

@benrob0329
Copy link
Member

benrob0329 commented Oct 5, 2019

My issue is that if it significantly increases screenshot size, then it probably also increases video file size. So I'll never use this, and more than likely neither will other content creators because recording MT already produces huge video files.

Then, if it's also disabled by default, and a large portion of our user-base either don't look at settings, or disable shaders anyways, why add it in the first place?

@HybridDog
Copy link
Contributor Author

My issue is that if it significantly increases screenshot size, then it probably also increases video file size.

It should only affect lossless compression.

Then, if it's also disabled by default, and a large portion of our user-base either don't look at settings, or disable shaders anyways, why add it in the first place?

It is just a small feature, so there's not much to be added.
Since the shaders path can be configured, it is alternatively possible to add the dithering to a custom shader fragment code.

@HybridDog HybridDog closed this Oct 6, 2019
@Calinou
Copy link
Member

Calinou commented Jan 16, 2021

If anyone is interested in reviving this PR or distributing a third-party shader to provide this feature, note that you can use a more effective algorithm which is still pretty cheap: godotengine/godot#42942

// From http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
// and https://www.shadertoy.com/view/MslGR8 (5th one starting from the bottom)
// NOTE: `frag_coord` is in pixels (i.e. not normalized UV).
vec3 screen_space_dither(vec2 frag_coord) {
	// Iestyn's RGB dither (7 asm instructions) from Portal 2 X360, slightly modified for VR.
	vec3 dither = vec3(dot(vec2(171.0, 231.0), frag_coord));
	dither.rgb = fract(dither.rgb / vec3(103.0, 71.0, 97.0));

	// Subtract 0.5 to avoid slightly brightening the whole viewport.
	return (dither.rgb - 0.5) / 255.0;
}

// ...

#ifdef USE_DEBANDING
	// For best results, debanding should be done before tonemapping.
	// Otherwise, we're adding noise to an already-quantized image.
	color += screen_space_dither(gl_FragCoord.xy);
#endif

@HybridDog HybridDog reopened this Oct 22, 2023
@HybridDog HybridDog changed the title Add a debanding option to fragment shaders Add dithering Oct 22, 2023
@HybridDog
Copy link
Contributor Author

HybridDog commented Oct 22, 2023

I have rebased this and applied Calinou's suggestion, which works a lot better than a simple checkerboard pattern.

@Calinou
Copy link
Member

Calinou commented Oct 23, 2023

Tested locally, it works as expected.

debanding webp

Cropped section of the image with Colors > Auto > Equalize in GIMP and 3× nearest-neighbor scaling:

debanding_crop webp

It may be worth enabling this setting by default, as it'll help a lot once #13881 are implemented (you can notice banding on the screenshots I posted there).

Also, I suggest renaming the setting to debanding as dithering may be confused for a setting that intentionally makes the game look worse (e.g. palletization shaders that aim for a PS1-like look).

@HybridDog
Copy link
Contributor Author

It may be worth enabling this setting by default, as it'll help a lot once #13881 are implemented (you can notice banding on the screenshots I posted there).

Done. I assume that on OLED screens, which have almost infinite contrast, banding may be very visible in Minetest when playing in a dark cave, but I haven't tested it.

Dithering may also reduce hypothetical subtle screen flickering caused by rounding and numerical precision limits, for example a background colour alternating between #B9EBE9 and #B9ECE9. A similar but, as far as I know, stronger flickering happened in the past (#8416).

Also, I suggest renaming the setting to debanding as dithering may be confused for a setting that intentionally makes the game look worse (e.g. palletization shaders that aim for a PS1-like look).

I've renamed it. I think debanding is a more generic term and it includes not only dithering but also, for example, algorithms which remove banding after the quantisation, such as AdaDeband.

@Calinou
Copy link
Member

Calinou commented Oct 23, 2023

Done. I assume that on OLED screens, which have almost infinite contrast, banding may be very visible in Minetest when playing in a dark cave, but I haven't tested it.

I'm using a LG C2 42" which is an OLED display 🙂

The debanding shader looks great on it, but I can certainly notice banding when it's disabled.

builtin/settingtypes.txt Outdated Show resolved Hide resolved
@Desour
Copy link
Member

Desour commented Oct 25, 2023

Tested, works.
Left is without dithering, right is with:
screenshot_20231025_171321

Interestingly, this also in a way improves screenshots. This is how the screenshot looks like if I look at it with an image viewer that transforms the colors to my screen's color space (which is not srgb):
2023-10-25-173059_1920x1080_scrot


Considering how simple this change is, I support it.

Code looks fine.

@Calinou Is it actually fine to use the code from those slides, copyright-wise? (IANAL)

Copy link
Member

@Desour Desour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and works.

Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation in #9014 (comment).

I don't usually notice banding while playing Minetest, but if I look for it, it is very obvious. This PR fixes the obvious cases of banding. In a direct before/after comparison, it also improves the image quality in scenes where I didn't notice any banding.


The debanding doesn't work on my Android phone ("ogles2" Irrlicht video driver). The reason seems to be a lack of precision: it works if I add precision highp float; at the beginning of the shader. For testing, I took two screenshots with 50x dithering applied:

Screenshot of broken 50x dithering (this PR)
Screenshot of broken 50x dithering

Screenshot of working 50x dithering (this PR with precision highp float;)
Screenshot of working 50x dithering

I see two possible solutions:

  1. Disable debanding by default on Android.

    This might also be a good idea because Godot had a problem with this debanding code on mobile, which apparently still hasn't been solved:

    Debanding breaks rendering on mobile (GLES3) godotengine/godot#49989
    "Use Debanding" option on iOS causes rendering issue godotengine/godot#56443
    Enabling debanding on mobile results in partially black screen (GLES3) godotengine/godot#45366

  2. On OpenGL ES, use precision highp float; if available (#ifdef GL_FRAGMENT_PRECISION_HIGH). Disable debanding otherwise.

@grorp grorp added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Dec 8, 2023
@Calinou
Copy link
Member

Calinou commented Dec 9, 2023

This might also be a good idea because Godot had a problem with this debanding code on mobile, which apparently still hasn't been solved:

We could probably add highp where required to fix it. This means debanding will run slower, but it's better to have it run slower than to be broken. We can still choose debanding to be disabled by default on mobile for performance reasons.

I'm not aware of a high-quality mediump-friendly debanding shader.

@HybridDog
Copy link
Contributor Author

Thanks for testing.
I have added the check for GL_FRAGMENT_PRECISION_HIGH and highp qualifiers but I don't know if it works.

I'm not aware of a high-quality mediump-friendly debanding shader.

On the lower left corner the dithering doesn't look broken (there are slight differences due to camera movement):
lower_left_borders

The reason is probably that gl_FragCoord is smaller there.
It may be possible to make the dithering work with low floating-point precision by adding modulo operations, e.g.

	frag_coord = vec2(mod(frag_coord.x, 33.0), mod(frag_coord.y, 33.0));

However, I don't know which effect this has on performance and quality.

Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. The debanding now works on my Android device (and it also still works on my desktop computer).

The reason is probably that gl_FragCoord is smaller there. It may be possible to make the dithering work with low floating-point precision by adding modulo operations, e.g.

	frag_coord = vec2(mod(frag_coord.x, 33.0), mod(frag_coord.y, 33.0));

However, I don't know which effect this has on performance and quality.

That doesn't seem to be worth it.

We can still choose debanding to be disabled by default on mobile for performance reasons.

I am in favor of that.

client/shaders/second_stage/opengl_fragment.glsl Outdated Show resolved Hide resolved
minetest.conf.example Outdated Show resolved Hide resolved
HybridDog and others added 6 commits December 16, 2023 15:27
On some displays, banding is easily noticeable in Minetest.
Dithering before the quantisation to 8 bits can prevent banding artifacts
and an implementation requires only a few lines of code.

Dithering is disabled by default and can be enabled with a setting.
It is applied in the second-stage shader and uses the algorithm supplied by Calinou.
This change also adds the setting to defaultsettings.cpp.
Co-authored-by: DS <ds.desour@proton.me>
@HybridDog
Copy link
Contributor Author

I have changed the setting now so that dithering can be enabled on OpenGL only (and not OpenGL ES).

@grorp
Copy link
Member

grorp commented Dec 16, 2023

I have changed the setting now so that dithering can be enabled on OpenGL only (and not OpenGL ES).

Why is the enum value called glsl_only? Shouldn't it be opengl_only?

Anyway, I'd prefer if the setting stayed a boolean and you just added settings->setDefault("debanding", "false"); to the "Altered settings for Android" section of defaultsettings.cpp (reasons: 1. simplicity, 2. consistency with other graphics settings).

@HybridDog
Copy link
Contributor Author

HybridDog commented Dec 18, 2023

Why is the enum value called glsl_only? Shouldn't it be opengl_only?

If I remember correctly, I mistakenly thought that OpenGL is a broad term which includes OpenGL ES, whereas GLSL is not a broad term and thus does not include the OpenGL ES Shading Language. opengl_only sounds better in my opinion.

Anyway, I'd prefer if the setting stayed a boolean and you just added settings->setDefault("debanding", "false"); to the "Altered settings for Android" section of defaultsettings.cpp (reasons: 1. simplicity, 2. consistency with other graphics settings).

I also prefer a simple bool setting but I think it's not possible to set a different default value in settingtypes.txt on Android, so if I understand it correctly, either the desktop or the Android settings menu would show the wrong default value.
I have changed it back to bool nonetheless and added the line to defaultsettings.cpp since other settings also only have the desktop default in settingtypes.txt.

@grorp
Copy link
Member

grorp commented Dec 18, 2023

so if I understand it correctly, either the desktop or the Android settings menu would show the wrong default value.

No, luckily the settings menu (implicitly) gets its default values from defaultsettings.cpp and only uses settingtypes.txt as a fallback. (This is because Settings:get also returns default values from defaultsettings.cpp.)

Ah, maybe you're referring to the default value in the tooltip of the reset button. In that case, I guess you're right.

@HybridDog
Copy link
Contributor Author

No, I haven't looked at the settings code thoroughly and accidentally assumed that it would show the default value from settingtypes.txt.

Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your incredible patience!

@grorp grorp added >= Two approvals ✅ ✅ and removed Action / change needed Code still needs changes (PR) / more information requested (Issues) One approval ✅ ◻️ labels Dec 19, 2023
@grorp grorp merged commit b1aec1b into minetest:master Dec 19, 2023
13 checks passed
kawogi pushed a commit to kawogi/minetest that referenced this pull request Dec 19, 2023
@HybridDog HybridDog deleted the m_debanding branch December 20, 2023 08:51
siboehm added a commit to Astera-org/minetest that referenced this pull request Jan 17, 2024
Add ZMQ

Worlds shittiest minetest interface

CI MacOS install zmq

Handshakes, plus send Screenshots back

cleanup

Extract all command names

Move remote handler into own file

hook mouse

.

non-working protobuf commit

switch to capnproto

Send image with capnp

Send reward

Multi keypress in the client

support all possible keys

Add environment.yml

Commit unmodified eluther gym env

Fail to close the inventory

Minetester define action and obs space

Gymnasium basic work

gym env check bounds

switch dummy client to pygame

More work on gym client

more progress

First working gym client

Rm old client

Combine isRemote() and isRandom()

Make client port configurable

fix camera mode and sneak

.

fix remote cli flag

vscode

Add basic reward mod

Parse reward from HUD in C++

.

Cmake changes to get Linux building

README: add linux packages for capnp

minor linux changes

save png HACK

.

Linux CI deps

tri again

tri again

gitmodules

submodules

submodules

.

First draft

env start xvfb

more headless

fix screenshot startup issue

add handshaker for debugging

create a new world when starting a game

Now `minetest --gameid <foo> --go` should work.
Previously it would fail because a world was not specified, and the
default one did not exist.

Change-Id: Ic6001f73713d59930e96c3f2a30395f5b0b8cbb9

Improve Irrlicht instructions (minetest#14055)

Specify the version when cloning.
Move instructions from CMakeLists to docs/compiling/.

Check if liquid can flow into empty node before picking it as source (minetest#14057)

Fix unittest failure for release versions (minetest#14067)

GUIFormspecMenu: Fix race condition between quit event and cleanup in Game (minetest#14010)

To not instantly free GUIFormSpec upon close/quit, Game periodically
cleans up the remaining instance on the next frame.

When a new formspec is received and processed after closing the previous formspec
but before the cleanup in Game, the formspec would be closed regardless.
This now re-creates the formspec when the old one is already pending for removal.

Add sound volume when unfocused setting (minetest#14083)

This adds a new setting to set sound volume multiplier when Minetest window is unfocused/inactive (sound_volume_unfocused, located in Settings > Graphics and Audio > Audio > Volume when unfocused).

If the window is not focused, the sound volume will be multiplied by sound_volume_unfocused setting. The sound volume will be set back to sound_volume again when the window is focused.

Avoid movement jitter (minetest#13093)

This allows the client and server to agree on the position of objects and attached players even when there is lag.

Try to fix safeWriteToFile producing empty files on Windows (minetest#14085)

Use win32 APIs to write the temporary file before copying to the final
destination. Because we've observed the final file being empty, we
suspect that std::ostream::flush is not flushing.

Also add a test for it.

Remove use_texture_alpha compatibility code for nodeboxes & meshes (minetest#13929)

Warning: inform about entity name when bug detected about attachement (minetest#13354)

Clean up porting.h a bit

Improve clock_gettime usage

- correctly use value of _POSIX_MONOTONIC_CLOCK
- drop special path for macOS: it supports clock_gettime since macOS 10.12

Reduce test framework macrosity

Delete clang-format files and comments (minetest#14079)

Fix Windows architecture reporting in sysinfo

Upload artifacts in MinGW CI

Get rid of VERSION_EXTRA for buildbot

This is probably a leftover of when CMake didn't automatically
detect the revision from git.

Hash-check buildbot dependencies

Inventory: prevent item loss when stacking oversized ItemStacks (minetest#14072)

Remove usage of removed "PP" macro

This fixes a compilation error introduced by e7be135.

Allow running individual benchmarks

mirrors and reuses the option from 2f6a9d1

Try to benchmark common MapBlock usage

Allocate data seperately from MapBlock class again

This effectively reverts commit b3503e7.

Change MapBlock content cache to a vector

Get rid of parent pointer in MapBlock

Elide MapBlock::contents_cached

Reduce size of some MapBlock members

Also adds assertions to catch refcounting errors (on a debug build).

Reorder members of MapBlock for performance

Before and after as obtained via `pahole -C MapBlock bin/minetest`:
/* size: 336, cachelines: 6, members: 23 */
/* sum members: 329, holes: 4, sum holes: 7 */
vs.
/* size: 336, cachelines: 6, members: 23 */
/* sum members: 329, holes: 2, sum holes: 7 */

There is not much to be gained by packing but I made sure
to move the most important data (mainly for the client) into
the first cache line.

Update porting.h to fix build errors on macOS 14 / Xcode 15

Allow cheaper culling checks at a distance (minetest#14073)

* Allow cheaper culling checks at a distance
* Pick a random ray, so that far missing block will eventually be shown

Extract Game::drawScene from Game::updateFrame

Add `touch_controls` boolean to `get_player_window_information()` (minetest#14092)

MinGW toolchain refresh

Add dithering (minetest#9014)

Android: Pause rendering while the app is paused (minetest#14058)

Hand roll UTF-16 conversion in CGUITTFont (minetest#14121)

Extend bone override capabilities (minetest#12388)

Fix touch input on Linux

The code relied on touch IDs being consecutive. This is true on Android, but not on Linux.
Therefore, touch input on Linux was broken since 53886dc.

Enable segment heap on Windows

Fix TouchScreenGUI ignoring server-sent pitch changes

Manually configurable minimum protocol version (minetest#14054)

Partially address minetest#13483.  Server operators can set a minimum
protocol version to match the game requirements (or any other
restriction they may want), and it's applied as an additional
constraint on top of the baseline compatibility range, optional
strict_protocol_version_checking, and any kick-on-join used by
the game/mods.

Fix on_(grant|revoke) not being run by mods

Split windows from linux CI workflows

Fix set_bone_position regression (error on passing none)

Initial implementation of 'Godrays'

Make volumetric light effect strength server controllable

- Make volumetric light effect strength server controllable
- Separate volumetric and bloom shader pipeline
- Require bloom to be enable, scale godrays with bloom

Touchscreen: Make server-sent overrides of button textures work (minetest#14145)

Support specifying game in config

In minetest.conf:

```
game_dir = /path/to/game
```

Change-Id: I790cc6ea91aa988e82e0a1fda23ab4ae2f8026a3

Link with -latomic

Rework server stepping and dtime calculation

Address some clang-tidy warnings

Update clang-tidy workflow

Fix minor issue with log_deprecated()

Remove non-existent textures from texture_packs.md

These textures were removed 5 years ago by 326eeca.

Make the loading screen progress bar respect "gui_scaling"

MacOS: Add codesigning instructions to docs (minetest#14060)

Optimize and improve built-in PNG writer (minetest#14020)

Update CMakeLists.txt to fix MacOS build (minetest#14160)

Co-authored-by: sfan5 <sfan5@live.de>

Support both mouse and touch input in GUIs in a single binary  (minetest#14146)

Avoid short overflow with large viewing ranges (minetest#14175)

Rename `hud_elem_type` to `type` (minetest#14065)

Fix AsyncRunStep() skipping steps when dtime < 1 ms

Clean up OS-specific initialization

Clean up gettext initialization

Enable some runtime hardening on win32

Perform server occlusion check before a block is loaded or generated (minetest#14148)

Do not emerge blocks in the active_object_send_range_blocks range (minetest#14152)

The active object range is about active objects (not blocks). Activate blocks (and hence any object "in" them) in the cone define by the active object range (and fov) when they are loaded (i.e. visible), otherwise ignore them.

Extend sanity checks in ActiveBlockList::update

also fixes the space indentation

Add missing header for gcc-14

https://gcc.gnu.org/gcc-14/porting_to.html

Signed-off-by: Alfred Wingate <parona@protonmail.com>

Method add_pos for object/player (minetest#14126)

Comply with base64 license terms (minetest#14199)

Remove reference to defunct gitlab docker image

see minetest#14164

Fix tonemapping effect

Apply saturation even if tonemapping is disabled

Legible Lua profiler (minetest#14142)

Replace clientmap's MeshBufListList with a hashmap

Use AL_SOFT_direct_channels_remix extension for non-positional stereo sounds (minetest#14195)

Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar (minetest#14206)

Remove server's address and port from pause menu (minetest#14082)

Touchscreen: Recognize double-taps as double-clicks  (minetest#14187)

Fix GameUI text staying visible during shutdown. (minetest#14197)

Don't run CDB update_detector more than once (minetest#14214)

Remove controls listed in the pause menu (no touchscreen) (minetest#13282)

Add "--needed" to Arch command to avoid reinstalling packages

Fix logic in porting::attachOrCreateConsole()

No functional change but now the comment is actually correct.

Add unittest to check thread_local destructor brokenness

Avoid unused argument spam with MinGW-clang

Fix native thread handle usage on win32

Fix some console window behavior on Windows

Ensure deterministic client occlusion culling and minor improvements (minetest#14212)

* Ensure deterministic client occlusion culling
* Increase culling optimize distance slightly
* More accurate culling when sampling

Android: Add selection dialog (drop down/combo box) (minetest#13814)

- The handling of IGUIComboBox uses the new setAndSendSelected() method.
- getDialogState() is now getInputDialogState() and returns the state of the input dialog.
- getLastDialogType() is added and returns current/last shown dialog's type.
- getInputDialogState() now returns an enum instead of int.
- getAndroidUIInput() now returns void instead of bool.
- New data types (enum) are added:
  (1) GameActivity.DialogType (Java) and porting::AndroidDialogType (C++)
  (2) GameActivity.DialogState (Java) and porting::AndroidDialogState (C++)
- When showing a text input dialog, there is no custom accept button text any more.
- showDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- showInputDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- getDialogValue()/getInputDialogValue() is now getDialogMessage()/getInputDialogMessage().

Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>

Extend capabilities of Address class

Some minor cleanups for UDPSocket class

Rework client connecting and enable fallback address use

Fix dividing by zero crashes in texture modifiers

slimmer gitignore

Bit of cleanup

ruff

First ZMQ Req returns image

.

add a basic env test

Document env setup

ci

ci

ci

ci

.

ci

ci

ci

ci

ci

make build a bit faster maybe

ci

ci

ci

ci

pytest

pytest again

add channels

pytest

forgot to setup env

cleanup minetest env

pytest timeout & logging

.

doc

.

pytest

Rm wrong comment & stdout printing

ci

ci

Better macos instructions

rm android and windows ci

rm docker ci

try fix macos ci

try fix clang tidy

ci

macos submodules

macos submodules

macos submodules 1

macos submodules 1

macos submodules 1

macos submodules 1

macos submodules 1

Add test world

macos submodules 11

macos build again

move reward mod

move world

.

no mdofi
siboehm added a commit to Astera-org/minetest that referenced this pull request Jan 17, 2024
Add ZMQ

Worlds shittiest minetest interface

CI MacOS install zmq

Handshakes, plus send Screenshots back

cleanup

Extract all command names

Move remote handler into own file

hook mouse

.

non-working protobuf commit

switch to capnproto

Send image with capnp

Send reward

Multi keypress in the client

support all possible keys

Add environment.yml

Commit unmodified eluther gym env

Fail to close the inventory

Minetester define action and obs space

Gymnasium basic work

gym env check bounds

switch dummy client to pygame

More work on gym client

more progress

First working gym client

Rm old client

Combine isRemote() and isRandom()

Make client port configurable

fix camera mode and sneak

.

fix remote cli flag

vscode

Add basic reward mod

Parse reward from HUD in C++

.

Cmake changes to get Linux building

README: add linux packages for capnp

minor linux changes

save png HACK

.

Linux CI deps

tri again

tri again

gitmodules

submodules

submodules

.

First draft

env start xvfb

more headless

fix screenshot startup issue

add handshaker for debugging

create a new world when starting a game

Now `minetest --gameid <foo> --go` should work.
Previously it would fail because a world was not specified, and the
default one did not exist.

Change-Id: Ic6001f73713d59930e96c3f2a30395f5b0b8cbb9

Improve Irrlicht instructions (minetest#14055)

Specify the version when cloning.
Move instructions from CMakeLists to docs/compiling/.

Check if liquid can flow into empty node before picking it as source (minetest#14057)

Fix unittest failure for release versions (minetest#14067)

GUIFormspecMenu: Fix race condition between quit event and cleanup in Game (minetest#14010)

To not instantly free GUIFormSpec upon close/quit, Game periodically
cleans up the remaining instance on the next frame.

When a new formspec is received and processed after closing the previous formspec
but before the cleanup in Game, the formspec would be closed regardless.
This now re-creates the formspec when the old one is already pending for removal.

Add sound volume when unfocused setting (minetest#14083)

This adds a new setting to set sound volume multiplier when Minetest window is unfocused/inactive (sound_volume_unfocused, located in Settings > Graphics and Audio > Audio > Volume when unfocused).

If the window is not focused, the sound volume will be multiplied by sound_volume_unfocused setting. The sound volume will be set back to sound_volume again when the window is focused.

Avoid movement jitter (minetest#13093)

This allows the client and server to agree on the position of objects and attached players even when there is lag.

Try to fix safeWriteToFile producing empty files on Windows (minetest#14085)

Use win32 APIs to write the temporary file before copying to the final
destination. Because we've observed the final file being empty, we
suspect that std::ostream::flush is not flushing.

Also add a test for it.

Remove use_texture_alpha compatibility code for nodeboxes & meshes (minetest#13929)

Warning: inform about entity name when bug detected about attachement (minetest#13354)

Clean up porting.h a bit

Improve clock_gettime usage

- correctly use value of _POSIX_MONOTONIC_CLOCK
- drop special path for macOS: it supports clock_gettime since macOS 10.12

Reduce test framework macrosity

Delete clang-format files and comments (minetest#14079)

Fix Windows architecture reporting in sysinfo

Upload artifacts in MinGW CI

Get rid of VERSION_EXTRA for buildbot

This is probably a leftover of when CMake didn't automatically
detect the revision from git.

Hash-check buildbot dependencies

Inventory: prevent item loss when stacking oversized ItemStacks (minetest#14072)

Remove usage of removed "PP" macro

This fixes a compilation error introduced by e7be135.

Allow running individual benchmarks

mirrors and reuses the option from 2f6a9d1

Try to benchmark common MapBlock usage

Allocate data seperately from MapBlock class again

This effectively reverts commit b3503e7.

Change MapBlock content cache to a vector

Get rid of parent pointer in MapBlock

Elide MapBlock::contents_cached

Reduce size of some MapBlock members

Also adds assertions to catch refcounting errors (on a debug build).

Reorder members of MapBlock for performance

Before and after as obtained via `pahole -C MapBlock bin/minetest`:
/* size: 336, cachelines: 6, members: 23 */
/* sum members: 329, holes: 4, sum holes: 7 */
vs.
/* size: 336, cachelines: 6, members: 23 */
/* sum members: 329, holes: 2, sum holes: 7 */

There is not much to be gained by packing but I made sure
to move the most important data (mainly for the client) into
the first cache line.

Update porting.h to fix build errors on macOS 14 / Xcode 15

Allow cheaper culling checks at a distance (minetest#14073)

* Allow cheaper culling checks at a distance
* Pick a random ray, so that far missing block will eventually be shown

Extract Game::drawScene from Game::updateFrame

Add `touch_controls` boolean to `get_player_window_information()` (minetest#14092)

MinGW toolchain refresh

Add dithering (minetest#9014)

Android: Pause rendering while the app is paused (minetest#14058)

Hand roll UTF-16 conversion in CGUITTFont (minetest#14121)

Extend bone override capabilities (minetest#12388)

Fix touch input on Linux

The code relied on touch IDs being consecutive. This is true on Android, but not on Linux.
Therefore, touch input on Linux was broken since 53886dc.

Enable segment heap on Windows

Fix TouchScreenGUI ignoring server-sent pitch changes

Manually configurable minimum protocol version (minetest#14054)

Partially address minetest#13483.  Server operators can set a minimum
protocol version to match the game requirements (or any other
restriction they may want), and it's applied as an additional
constraint on top of the baseline compatibility range, optional
strict_protocol_version_checking, and any kick-on-join used by
the game/mods.

Fix on_(grant|revoke) not being run by mods

Split windows from linux CI workflows

Fix set_bone_position regression (error on passing none)

Initial implementation of 'Godrays'

Make volumetric light effect strength server controllable

- Make volumetric light effect strength server controllable
- Separate volumetric and bloom shader pipeline
- Require bloom to be enable, scale godrays with bloom

Touchscreen: Make server-sent overrides of button textures work (minetest#14145)

Support specifying game in config

In minetest.conf:

```
game_dir = /path/to/game
```

Change-Id: I790cc6ea91aa988e82e0a1fda23ab4ae2f8026a3

Link with -latomic

Rework server stepping and dtime calculation

Address some clang-tidy warnings

Update clang-tidy workflow

Fix minor issue with log_deprecated()

Remove non-existent textures from texture_packs.md

These textures were removed 5 years ago by 326eeca.

Make the loading screen progress bar respect "gui_scaling"

MacOS: Add codesigning instructions to docs (minetest#14060)

Optimize and improve built-in PNG writer (minetest#14020)

Update CMakeLists.txt to fix MacOS build (minetest#14160)

Co-authored-by: sfan5 <sfan5@live.de>

Support both mouse and touch input in GUIs in a single binary  (minetest#14146)

Avoid short overflow with large viewing ranges (minetest#14175)

Rename `hud_elem_type` to `type` (minetest#14065)

Fix AsyncRunStep() skipping steps when dtime < 1 ms

Clean up OS-specific initialization

Clean up gettext initialization

Enable some runtime hardening on win32

Perform server occlusion check before a block is loaded or generated (minetest#14148)

Do not emerge blocks in the active_object_send_range_blocks range (minetest#14152)

The active object range is about active objects (not blocks). Activate blocks (and hence any object "in" them) in the cone define by the active object range (and fov) when they are loaded (i.e. visible), otherwise ignore them.

Extend sanity checks in ActiveBlockList::update

also fixes the space indentation

Add missing header for gcc-14

https://gcc.gnu.org/gcc-14/porting_to.html

Signed-off-by: Alfred Wingate <parona@protonmail.com>

Method add_pos for object/player (minetest#14126)

Comply with base64 license terms (minetest#14199)

Remove reference to defunct gitlab docker image

see minetest#14164

Fix tonemapping effect

Apply saturation even if tonemapping is disabled

Legible Lua profiler (minetest#14142)

Replace clientmap's MeshBufListList with a hashmap

Use AL_SOFT_direct_channels_remix extension for non-positional stereo sounds (minetest#14195)

Don't apply gui_scaling & DPI twice to table[] / textlist[] scrollbar (minetest#14206)

Remove server's address and port from pause menu (minetest#14082)

Touchscreen: Recognize double-taps as double-clicks  (minetest#14187)

Fix GameUI text staying visible during shutdown. (minetest#14197)

Don't run CDB update_detector more than once (minetest#14214)

Remove controls listed in the pause menu (no touchscreen) (minetest#13282)

Add "--needed" to Arch command to avoid reinstalling packages

Fix logic in porting::attachOrCreateConsole()

No functional change but now the comment is actually correct.

Add unittest to check thread_local destructor brokenness

Avoid unused argument spam with MinGW-clang

Fix native thread handle usage on win32

Fix some console window behavior on Windows

Ensure deterministic client occlusion culling and minor improvements (minetest#14212)

* Ensure deterministic client occlusion culling
* Increase culling optimize distance slightly
* More accurate culling when sampling

Android: Add selection dialog (drop down/combo box) (minetest#13814)

- The handling of IGUIComboBox uses the new setAndSendSelected() method.
- getDialogState() is now getInputDialogState() and returns the state of the input dialog.
- getLastDialogType() is added and returns current/last shown dialog's type.
- getInputDialogState() now returns an enum instead of int.
- getAndroidUIInput() now returns void instead of bool.
- New data types (enum) are added:
  (1) GameActivity.DialogType (Java) and porting::AndroidDialogType (C++)
  (2) GameActivity.DialogState (Java) and porting::AndroidDialogState (C++)
- When showing a text input dialog, there is no custom accept button text any more.
- showDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- showInputDialog()/showDialogUI() for text input is now showTextInputDialog()/showTextInputDialogUI().
- getDialogValue()/getInputDialogValue() is now getDialogMessage()/getInputDialogMessage().

Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>

Extend capabilities of Address class

Some minor cleanups for UDPSocket class

Rework client connecting and enable fallback address use

Fix dividing by zero crashes in texture modifiers

slimmer gitignore

Bit of cleanup

ruff

First ZMQ Req returns image

.

add a basic env test

Document env setup

ci

ci

ci

ci

.

ci

ci

ci

ci

ci

make build a bit faster maybe

ci

ci

ci

ci

pytest

pytest again

add channels

pytest

forgot to setup env

cleanup minetest env

pytest timeout & logging

.

doc

.

pytest

Rm wrong comment & stdout printing

ci

ci

Better macos instructions

rm android and windows ci

rm docker ci

try fix macos ci

try fix clang tidy

ci

macos submodules

macos submodules

macos submodules 1

macos submodules 1

macos submodules 1

macos submodules 1

macos submodules 1

Add test world

macos submodules 11

macos build again

move reward mod

move world

.

no mdofi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Audiovisuals Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature Shaders >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants