Skip to content

Instantly share code, notes, and snippets.

View x2048's full-sized avatar
🇺🇦
https://savelife.in.ua/en/donate-en/

x2048

🇺🇦
https://savelife.in.ua/en/donate-en/
View GitHub Profile
@x2048
x2048 / a.diff
Last active November 1, 2022 21:37
Camera mode
diff --git a/src/client/camera.h b/src/client/camera.h
index 1018af55a..eab1c29f3 100644
--- a/src/client/camera.h
+++ b/src/client/camera.h
@@ -71,7 +71,7 @@ struct Nametag
}
};
-enum CameraMode {CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT};
+enum CameraMode {CAMERA_MODE_NONE = -1, CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT};
@x2048
x2048 / patch.diff
Last active October 4, 2022 19:01
Fix undersampling
diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp
index eb38adbad..13898f8a4 100644
--- a/src/client/render/pipeline.cpp
+++ b/src/client/render/pipeline.cpp
@@ -168,6 +168,13 @@ void TextureBufferOutput::activate(PipelineContext &context)
size = texture->getSize();
}
+ // Use legacy call when there's single texture without depth texture
+ // This binds default depth buffer to the FBO
@x2048
x2048 / README.md
Last active August 28, 2022 12:49
Minetest post-processing pipeline basics

Concepts

  • RenderStep - a single step in the pipeline, such as running the 3D render, changing state or applying a shader. Each step has a source and a target
    • RenderSource - a source for the step, a set of textures that are used in the step
    • RenderTarget - a target for the step, a framebuffer with one or more attached textures / renderbuffers.
  • Pipeline - a sequence of steps and associated objects such as TextBuffers.
  • TextureBuffer - an indexed set of textures that you need, you can create up to 254 textures if the driver permits.
    • TextureBuffer is also a RenderSource and a RenderTarget.
  • Normally you have a single texture buffer that all the steps write to and read from
@x2048
x2048 / shaders.txt
Last active August 5, 2022 22:59
Shaders to be done
# Game-controlled visuals
* Saturation
* Brightness
* Full Blur
# Realism
* DoF
* Godrays
@x2048
x2048 / launch.json
Created August 2, 2022 18:37
F5 debugging Minetest in VS Code
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
@x2048
x2048 / particles.patch
Last active July 13, 2022 20:40
patch 20220713
diff --git a/src/client/particles.cpp b/src/client/particles.cpp
index a1de1bb98..818cdc8cc 100644
--- a/src/client/particles.cpp
+++ b/src/client/particles.cpp
@@ -63,12 +63,6 @@ Particle::Particle(
: ParticleParamTypes::BlendMode::alpha;
switch (blendmode) {
- case ParticleParamTypes::BlendMode::alpha:
- bfsrc = video::EBF_SRC_ALPHA;
@x2048
x2048 / log
Last active May 30, 2022 21:01
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:0 Z:72
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:1 Z:72
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:0 Z:71
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:1 Z:71
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:1 Z:72
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:0 Z:72
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:0 Z:71
2022-05-30 22:55:25: WARNING[Main]: BLOCK DATA: X:125 Y:1 Z:71
2022-05-30 22:55:26: WARNING[Main]: BLOCK DATA: X:125 Y:1 Z:72
2022-05-30 22:55:26: WARNING[Main]: BLOCK DATA: X:125 Y:0 Z:72
@x2048
x2048 / wield_mesh_color.diff
Created May 15, 2022 19:33
Enable color for wield mesh based on wield image
diff --git a/src/client/wieldmesh.cpp b/src/client/wieldmesh.cpp
index d5c191935..25b343573 100644
--- a/src/client/wieldmesh.cpp
+++ b/src/client/wieldmesh.cpp
@@ -386,6 +386,9 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
m_colors.emplace_back();
// overlay is white, if present
m_colors.emplace_back(true, video::SColor(0xFFFFFFFF));
+ // initialize the color
+ if (!m_lighting)
@x2048
x2048 / workflow.diff
Last active April 7, 2022 21:23
Add devtest lua files as dependencies to workflows
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 78027d09c..0c970a757 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,6 +8,8 @@ on:
- 'lib/**.cpp'
- 'src/**.[ch]'
- 'src/**.cpp'
+ - 'builtin/**.lua'
+ - 'games/devtest/**.lua'
@x2048
x2048 / clientmap.cpp.diff
Created April 7, 2022 20:22
Remove commented code in clientmap.cpp
diff --git a/src/client/clientmap.cpp b/src/client/clientmap.cpp
index 8a059c922..99ff0aefb 100644
--- a/src/client/clientmap.cpp
+++ b/src/client/clientmap.cpp
@@ -879,15 +879,6 @@ void ClientMap::updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir,
}
m_drawlist_shadow.clear();
- // We need to append the blocks from the camera POV because sometimes
- // they are not inside the light frustum and it creates glitches.