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

Shadow mapping render pass #11244

Merged
merged 2 commits into from
Jun 6, 2021
Merged

Shadow mapping render pass #11244

merged 2 commits into from
Jun 6, 2021

Conversation

0xLiso
Copy link
Contributor

@0xLiso 0xLiso commented May 5, 2021

This PR implements shadow mapping with PSM (Perspective Shadow Mapping), PCF filtering and "colored shadows".
The implementation it's originally based in the XEffects shadow mapping examples.

How this works:

  1. To be able to make it work with Irrlicht(MT) the Nodes must be added (and removed ) to a Shadow caster list to cast shadows.
  2. The draw function in RenderingCore updated to do the depth pass.
  3. Render all the nodes that casts shadow in a RTT.
    3.1. Render ClientMap depth every 0.2 seconds to avoid excessive drawcalls.
    3.2. Render depth for all dynamic entities
    3.3. Mix both depth textures in the Shadow Texture.
  4. execute standard DrawAll, with the Shadow Texture attached.

The textures used are (3x):
irr::video::ECOLOR_FORMAT::ECF_R32F for depth
irr::video::ECOLOR_FORMAT::ECF_G32R32F for depth+color(encoded)

Both in 16bits if configured, but the tests I did, anything below 32bits causes lot's of precision problems.

To do

This PR is Ready for Review.

  • Calculate sun POV frustum
  • nodes added and removed from shadow caster list
  • Render depth pass
  • Write node and objects shaders
  • Vanish shadow on artificial light.
  • "Colored shadows"
  • Different quality configurations.
  • PCF & Poisson disk filtering.
  • Tweak PSM distortion function for every quality.
  • Wield items shadows.
  • Moon shadows.

Future improvements.

  • Check if mesh generation is able to remove the shadows encoded in the map

  • Depth shaders using standard MT shader.cpp style (I wasn't able to make it work), so we can make things like shadows for waving plants and leaves.

  • Reduce drawcalls.

How to test

Go to settings tabs, enable shaders, select quality from Dynamic Shadows dropdown.

The default values are:
Ultra low:
-shadow_map_max_distance: 80 blocks
-shadow_map_texture_size: 512
-shadow_map_color: false
-filter level: 0

Low:
-shadow_map_max_distance: 120 blocks
-shadow_map_texture_size: 1024
-shadow_map_color: false
-filter level: 1

Medium:
-shadow_map_max_distance: 350 blocks
-shadow_map_texture_size: 2048
-shadow_map_color: false
-filter level: 1

High:
-shadow_map_max_distance: 350 blocks
-shadow_map_texture_size: 2048
-shadow_map_color: true
-filter level: 2

Ultra High:
-shadow_map_max_distance: 450 blocks
-shadow_map_texture_size: 4096
-shadow_map_color: true
-filter level: 2

The values Ultra Low and Low only work when the map doesn't have too big elements, and even with normal maps it could have some artifacts.

This PR is high demanding because the amount of drawcalls so it's only recommended for slightly modern hardware.

The configuration can be changed within the "All Settings" section -> shadow

Examples:

Configuration:
image

Examples:
image

image

image

image

@ExeVirus
Copy link
Contributor

ExeVirus commented May 5, 2021

Tested with high performance Win10 64 bit CPU, extremely stable. Tested also with low end windows laptops (2), got mediocre performance and after turning quality down, was not that compelling. It should be off by default for new players in my opinion therefore in my opinion.

@kilbith
Copy link
Contributor

kilbith commented May 5, 2021

Bringing @lhofhansl @numberZero @hecktest @sofar in

@sfan5 sfan5 added Feature ✨ PRs that add or enhance a feature @ Client / Audiovisuals Non-trivial A large amount of work is required to address this (sometimes to the point of being infeasible). Shaders labels May 5, 2021
@NathanSalapat
Copy link
Contributor

Seems to work well on my system. Putting shadows up to Ultra high did drop FPS to about 30, I usually get about 60. At Medium settings I didn't see any FPS drop, and the shadows still looked quite nice.

@TSafa-23
Copy link

TSafa-23 commented May 5, 2021

Works well, little visual artifacts, works well on even slightly older machines. On certain maps and settings it will even run close in performance to default.

@nerzhul
Copy link
Member

nerzhul commented May 5, 2021

that sounds very promising. How it work in caved with torchs ?

@@ -468,6 +468,8 @@ void Mapgen::lightSpread(VoxelArea &a, std::queue<std::pair<v3s16, u8>> &queue,
void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax, v3s16 full_nmin, v3s16 full_nmax,
bool propagate_shadow)
{
if (g_settings->getBool("enable_dynamic_shadows"))
propagate_shadow = false;
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a problem.

The mapgen runs on the server, it must not change its results based on purely visual settings set on the client (never mind the fact that this can't work with multiple clients).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, we can remove it without a problem. It's just we'll get double shadows (ShadowMap and propagated one) in remote servers and in local ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't mesh generation be able to remove the shadows encoded in the map?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. I'm going to take a look on that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to future improvements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi again, I tried to fix this, but as far as I know the static shadow can't be removed in client or at least I don't know how to do it.

src/client/shader.cpp Outdated Show resolved Hide resolved
@0xLiso
Copy link
Contributor Author

0xLiso commented May 5, 2021

that sounds very promising. How it work in caved with torchs ?

using the value "nightRatio" stored at vertex alpha channel that give the ratio between sunlight and artificial light.

This is also used to dilute shadows with torch even at day.

You can see that here. The green is sunlight to 1, and red is all artificial light

image

and same with torches:
image

Copy link
Member

@nerzhul nerzhul left a comment

Choose a reason for hiding this comment

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

very very nice feature PR, i added first recommandations/fixes

src/client/game.cpp Outdated Show resolved Hide resolved
src/client/game.cpp Outdated Show resolved Hide resolved
src/client/render/core.cpp Outdated Show resolved Hide resolved
src/client/render/core.h Show resolved Hide resolved
src/client/render/core.cpp Outdated Show resolved Hide resolved
@@ -113,6 +120,14 @@ class RenderingEngine
return m_device->run();
}

static ShadowRenderer *get_shadow_renderer()
Copy link
Member

Choose a reason for hiding this comment

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

i'm working on removing the global Renderer singleton. Can you make this function non static & call it properly from other objects ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm been working on this this and I think it's not possible without changing current MT shader implementation. We have to have access shadowRenderer data from MainShaderConstantSetter and the only way to do it is by the singleton,

@sfan5
Copy link
Member

sfan5 commented May 5, 2021

I gave this a very quick look and the first advice I can give is this:

  • Read https://dev.minetest.net/Code_style_guidelines
    Our clang-format config isn't quite up-to-date with it but does a good job so please run it on the files that had significant changes.
  • Don't include irrlicht.h directly, use irrlichttypes.h
    • that header will also provide f32, v3f + other types and set using namespace irr; for you
  • class variables should not start with _

src/client/tile.h Outdated Show resolved Hide resolved
src/client/shader.cpp Outdated Show resolved Hide resolved
@0xLiso
Copy link
Contributor Author

0xLiso commented May 5, 2021

IDK why Lua_lint is giving error. The unused variable "ddhandled" is actually used, and it was in there before.

@LoneWolfHT
Copy link
Contributor

LoneWolfHT commented May 5, 2021

Great to finally see a PR!
Would you be able to collect a https://www.bountysource.com/ bounty on this once this is merged?

Did some quick messing around:

  • Weird stairs bug: image Full Building: image

CobbleTower.we.zip (Building I used to reproduce bug, saved with WorldEdit)

PS: Will there be/Is there a way to prevent nodes you register from casting shadows?

@0xLiso
Copy link
Contributor Author

0xLiso commented May 6, 2021

Great to finally see a PR!
Would you be able to collect a https://www.bountysource.com/ bounty on this once this is merged?

Thank you, I don't even know what is that XD.

Did some quick messing around:

* Weird stairs bug: ![image](https://user-images.githubusercontent.com/28972859/117208550-1b5c2000-adaa-11eb-8601-6bb5ba786dd0.png) Full Building: ![image](https://user-images.githubusercontent.com/28972859/117209137-cff64180-adaa-11eb-919c-a325d5de86ac.png)

CobbleTower.we.zip (Building I used to reproduce bug, saved with WorldEdit)

I just test it and for some reason the cobblestone stairs are slightly darker than cobblestone, even without shadows:

Without shadows:
image

With shadows:
image

PS: Will there be/Is there a way to prevent nodes you register from casting shadows?

No right now, but we can add it if it's desired.

@LoneWolfHT
Copy link
Contributor

It looks like you don't re-enable default shadows when the dynamic ones are disabled

@0xLiso
Copy link
Contributor Author

0xLiso commented May 6, 2021

It looks like you don't re-enable default shadows when the dynamic ones are disabled

I'll take a deep look on this.

But the default shadows are not disabled. I have to find how to disable them in other part:

#11244 (comment)

@lhofhansl
Copy link
Contributor

This is really awesome. Glad to see MT graphics improving. Tried it works well! Thanks for working on this!

I did notice some problems with the direction of the sunlight:
screenshot_20210506_191019

Note that even though the sun is behind the back of the player is dark and the grass became black too.
(See shadow strength to 1 to see effect better)

@Andrey2470T
Copy link
Contributor

Andrey2470T commented May 7, 2021

Nice! At Medium, it works enough well (FPS ranges from 40 - 50), except dense rainforests where it drops almost half. Making at High, FPS ~ 30 in plains, from 20 - 25 in forests, however, it may become even much less. At Ultra High, it ranges from 1 -5 FPS. I have GeForce GTX 1050 video card, maybe it is weak or better optimisation is needed.

Also, I see some artifacts remain still that I discovered in earlier testings like the ripple and the shadow sharpening.

Also, is artificial light emitted by torches, mese posts and etc to affect casting shadows from objects not in your plans?

@0xLiso
Copy link
Contributor Author

0xLiso commented May 11, 2021

This is really awesome. Glad to see MT graphics improving. Tried it works well! Thanks for working on this!

I did notice some problems with the direction of the sunlight:
screenshot_20210506_191019

Note that even though the sun is behind the back of the player is dark and the grass became black too.
(See shadow strength to 1 to see effect better)

Thank you for your feedback, the problem is that billboards don't have normals, so the shader set them to shadowed. It's fixed now.

Nice! At Medium, it works enough well (FPS ranges from 40 - 50), except dense rainforests where it drops almost half. Making at High, FPS ~ 30 in plains, from 20 - 25 in forests, however, it may become even much less. At Ultra High, it ranges from 1 -5 FPS. I have GeForce GTX 1050 video card, maybe it is weak or better optimisation is needed.

Also, I see some artifacts remain still that I discovered in earlier testings like the ripple and the shadow sharpening.

Don't worry about your GPU, the performance is limited by the number of drawcalls, and this is a CPU bottleneck. To draw the shadows for the huge elements we have in MT, we need to render from a high distance, and that generates too many drawcalls. It can be solved by changing the way MT renders, making a much better occlusion algorithm o reducing the shadow render distance that can be done in "All Settings" -> Dynamic Shadows -> Shadow map max distance. But this will generate more artifacts .

Also, is artificial light emitted by torches, mese posts and etc to affect casting shadows from objects not in your plans?

If you are talking about removing shadows when there is an artificial light, yes. If you are talking about casting shadows from an artificial light, no. To do that, we should change the renderer to do dynamic lighting and multipass render.

Here you can see the shadow disappears when is inside the torch light.

imagen

@0xLiso
Copy link
Contributor Author

0xLiso commented May 11, 2021

I gave this a very quick look and the first advice I can give is this:

  • Read https://dev.minetest.net/Code_style_guidelines
    Our clang-format config isn't quite up-to-date with it but does a good job so please run it on the files that had significant changes.

  • Don't include irrlicht.h directly, use irrlichttypes.h

    • that header will also provide f32, v3f + other types and set using namespace irr; for you
  • class variables should not start with _

Suggestions added.

@sfan5 sfan5 added the Rebase needed The PR needs to be rebased by its author. label May 11, 2021
@lhofhansl
Copy link
Contributor

Thank you for your feedback, the problem is that billboards don't have normals, so the shader set them to shadowed. It's fixed now.

Nice. Yep. That part is fixed.
There is still something wrong with the player normals, though. In the photo above also notice that the back of the player if black - even though the sun is coming directly from behind.

@lhofhansl
Copy link
Contributor

lhofhansl commented May 12, 2021

There're also some artifacts:

screenshot_20210511_195122

See the round'ish bright dark effects.

Again, thanks for working on this! Just trying to find bugs.

Edit: Filtering set to 2, texture size 2048.

@0xLiso
Copy link
Contributor Author

0xLiso commented May 12, 2021

There're also some artifacts:

See the round'ish bright dark effects.

Again, thanks for working on this! Just trying to find bugs.

Edit: Filtering set to 2, texture size 2048.

I think is fixed now.

@lhofhansl
Copy link
Contributor

Did a pass, nothing stood out as wrong.
We can probably tweak the pre-sets a bit more and get rid of the 16 bit option (way too many artifacts), but that can be done in followup if needed.

src/client/content_cao.cpp Outdated Show resolved Hide resolved
src/client/game.cpp Outdated Show resolved Hide resolved
src/client/game.cpp Show resolved Hide resolved
@nerzhul
Copy link
Member

nerzhul commented Jun 3, 2021

there is remaining changes, i think we are fine now. Time to bench it, but honestly i think if we have major performance issue it's clearly not especially this code, but the client code design

@lhofhansl
Copy link
Contributor

honestly i think if we have major performance issue

@nerzhul What specifically? You mean the number of draw-calls? Or other general performance issues.

@nerzhul
Copy link
Member

nerzhul commented Jun 4, 2021

@lhofhansl yep general performance issue when enabling this.

@VanessaE
Copy link
Contributor

VanessaE commented Jun 4, 2021

Here are my thoughts on this PR. Updated today, using your repo directly rather than applying the PR over upstream. All screenshots were taken with the in-game time locked at 08:00. This is Debian Bullseye with XFCE 4.18, on a Phenom II X6 1055T processor at 2.8 GHz, with 16 GB DDR1333 RAM and an R9 280X GPU (using the amdgpu driver supplied by Debian). Maybe not the most modern system in the world, but definitely not weak either.

  • There's still a bit of a "curve" to the leading and trailing (i.e. east and west) edges of the shadows, while side edges (north and south) look mostly fine:
    image

  • In some nodes, a transparent texture can get discolored. For example, here are basic_signs:sign_wall_glass and basic_signs:sign_wall_obsidian_glass. The shadow for the former has pink artifacts, while the latter falls over entirely. The clear one uses an indexed grayscale image, while the obsidian one is RGB mode, both with only simple on-or-off transparency in use (in the image above, you can also see the yard version of the clear one):
    image

  • I've mentioned this in chat previously: colored shadows work mostly okay for nodes where the color is baked into the texture (the above notwithstanding), but not on nodes which use param2 coloring, such as doyousketch2's stained_glass mod (https://github.com/minetest-mods/stained_glass):
    image

  • I might also suggest reducing the shadow intensity in the presets. Easily changed in the "All settings" menu, of course, but in my opinion, 0.5 makes the vertical, shaded-side of nodes and such too dark, as if there's very little scattered, ambient light. 0.35 looks better, but then for some folks, this might cause shadows cast onto horizontal surfaces i.e. flat ground to not be dark enough. Maybe a separate setting is needed for vertical surfaces?

    This is the shaded side of some signs, with the intensity set to 0.35:
    image

    And on the sun-facing side:
    image

  • The algorithm that blurs a shadow according to its distance from the node seems to have an odd "pixelating" glitch when it comes to transparent nodes. It's a little better with the shadow filter quality set to 2, but at 1 it's... grainy. I haven't tested in any real detail but I assume the filter radius also plays into this.
    For example, here's some minetest_game default:glass with the filter quality set to 1:
    image

    And with the filter quality set to 2:
    image

  • I am still seeing a thin "gap" between nodes and shadows they cast, even on simple stuff like default:sandstone:
    image

  • While overall FPS is comparable to mainline without shadows, dtime jitter is still pretty high.
    Depending on how much I'm moving around, looking around, how much stuff is visible, how far out my view range is set for, etc...... with shadows enabled, it rids at close to 100% at best, and exceeds 175% at times. Without shadows, jitter varies between 20 and 80%. This high jitter leads to a "jumpy" feel, especially when traveling in a straight line at a constant speed (with the landscape already loaded). These are my settings:
    image

@0xLiso
Copy link
Contributor Author

0xLiso commented Jun 5, 2021

Here are my thoughts on this PR. Updated today, using your repo directly rather than applying the PR over upstream. All screenshots were taken with the in-game time locked at 08:00. This is Debian Bullseye with XFCE 4.18, on a Phenom II X6 1055T processor at 2.8 GHz, with 16 GB DDR1333 RAM and an R9 280X GPU (using the amdgpu driver supplied by Debian). Maybe not the most modern system in the world, but definitely not weak either.

* There's still a bit of a "curve" to the leading and trailing (i.e. east and west) edges of the shadows, while side edges (north and south) look mostly fine:

Yes to fix the curve we need to tweak the distance, but at the same time if we reduce the distance more glitches will appear from distant shadows (blocks disappearing mostly)

* In some nodes, a transparent texture can get discolored.  For example, here are `basic_signs:sign_wall_glass` and `basic_signs:sign_wall_obsidian_glass`.   The shadow for the former has pink artifacts, while the latter falls over entirely.  The clear one uses an indexed grayscale image, while the obsidian one is RGB mode, both with only simple on-or-off transparency in use (in the image above, you can also see the yard version of the clear one):

uhmmm I'll take a look on that. Tnx

* I've mentioned this in chat previously: colored shadows work mostly okay for nodes where the color is baked into the texture (the above notwithstanding), but not on nodes which use param2 coloring, such as doyousketch2's stained_glass mod (https://github.com/minetest-mods/stained_glass):

Yes, I think this is because those nodes are been render as normal blocks not as transparent ones. I think.

* I might also suggest reducing the shadow intensity in the presets.   Easily changed in the "All settings" menu, of course, but in my opinion, 0.5 makes the vertical, shaded-side of nodes and such too dark, as if there's very little scattered, ambient light.  0.35 looks better, but then for some folks, this might cause shadows cast onto horizontal surfaces i.e. flat ground to not be dark enough.  Maybe a separate setting is needed for vertical surfaces?
  This is the shaded side of some signs, with the intensity set to 0.35:
  ![image](https://user-images.githubusercontent.com/1733537/120869251-04088200-c564-11eb-9e42-4a9432cff1bc.png)
  And on the sun-facing side:

Uhm.. I think you have some settings from a previous install, the current default values are:

// Effects Shadows
settings->setDefault("enable_dynamic_shadows", "false");
settings->setDefault("shadow_strength", "0.2");
settings->setDefault("shadow_map_max_distance", "200.0");
settings->setDefault("shadow_map_texture_size", "2048");
settings->setDefault("shadow_map_texture_32bit", "true");
settings->setDefault("shadow_map_color", "false");
settings->setDefault("shadow_filters", "1");
settings->setDefault("shadow_poisson_filter", "true");
settings->setDefault("shadow_update_time", "0.2");
settings->setDefault("shadow_soft_radius", "1.0");
settings->setDefault("shadow_sky_body_orbit_tilt", "0.0");
* The algorithm that blurs a shadow according to its distance from the node seems to have an odd "pixelating" glitch when it comes to transparent nodes.  It's a little better with the shadow filter quality set to 2, but at 1 it's... grainy.  I haven't tested in any real detail but I assume the filter radius also plays into this.

I can't help with this, @x2048 '??

* While overall FPS is comparable to mainline without shadows, dtime jitter is still pretty high.
  Depending on how much I'm moving around, looking around, how much stuff is visible, how far out my view range is set for, etc...... with shadows enabled, it rids at close to 100% at best, and exceeds 175% at times.  Without shadows, jitter varies between 20 and 80%.  This high jitter leads to a "jumpy" feel, especially when traveling in a straight line at a constant speed (with the landscape already loaded).  These are my settings:

In my linux machine it about 3-14%, but I'm not sure what value is about :)

And @VanessaE , thank you very much for your review :)

Also, thank you @sfan5 for your fixes.

@VanessaE
Copy link
Contributor

VanessaE commented Jun 5, 2021

Yes, I think this is because those nodes are been render as normal blocks not as transparent ones. I think.

The registration looks pretty normal to me:

minetest.register_node("stained_glass:stained_glass", {
	description = "Stained Glass",
	drawtype = "glasslike_framed_optional",
	tiles = { "stained_glass.png", "stained_glass_detail.png" },
	paramtype = "light",
	paramtype2 = "color",
	palette = "unifieddyes_palette_extended.png",
	sunlight_propagates = true,
	use_texture_alpha = "blend",
	light_source = myglow,
	is_ground_content = true,
	walkable = true,
	groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
	sounds = default.node_sound_glass_defaults(),
	on_construct = unifieddyes.on_construct,
	on_dig = unifieddyes.on_dig,
})

Uhm.. I think you have some settings from a previous install, the current default values are:

...something that doesn't apply in my case, because I changed them to reasonable values (as pictured at the bottom of my last comment) before commenting about the shadow darkness. 😃 Plus, in my previous tests, I had them set to 0.4.

In my linux machine it about 3-14%, but I'm not sure what value is about :)

It means how much drawtime difference there is from one frame to the next. If a frame takes say 20ms to draw, then the next one takes 40ms, then 20ms for the next one after, that's a jitter of 100%. At least that's how I interpret the number. Either way, it's much worse with shadows turned on.

@LoneWolfHT
Copy link
Contributor

I get a segfault when leaving a world (exit to menu)
image

@x2048
Copy link
Contributor

x2048 commented Jun 5, 2021

* The algorithm that blurs a shadow according to its distance from the node seems to have an odd "pixelating" glitch when it comes to transparent nodes.  It's a little better with the shadow filter quality set to 2, but at 1 it's... grainy.  I haven't tested in any real detail but I assume the filter radius also plays into this.

I can't help with this, @x2048 '??

Yes, I'll take a look. @VanessaE, thank you for a good example to test :)

  • I've mentioned this in chat previously: colored shadows work mostly okay for nodes where the color is baked into the texture (the above notwithstanding), but not on nodes which use param2 coloring, such as doyousketch2's stained_glass mod (https://github.com/minetest-mods/stained_glass).

These are most likely colored with glVertexColor and need to be accounted for when we map the colored shadow. Grep for inVertexColor in the shaders to see how it's used.

@sfan5 sfan5 merged commit c47313d into minetest:master Jun 6, 2021
@sfan5
Copy link
Member

sfan5 commented Jun 6, 2021

Any further improvements or needed fixes can be made in a future PR.

@0xLiso found another bug, with WorldEdit's region cube the shadow renders in some random spot:
b

@LoneWolfHT Also I tested and couldn't reproduce your crash.

@AbduSharif
Copy link

Congratulations on the merge guys.

@0xLiso
Copy link
Contributor Author

0xLiso commented Jun 6, 2021

WoW PR merged. :) Thank you all for your help. @sfan5 I'll take a look on that.

@Jipok
Copy link

Jipok commented Jun 6, 2021

Is this normal?

screenshot

image

Medium level of shadows. GPU: NVIDIA GeForce GTX 1050 Ti Mobile Driver: nvidia-460

@0xLiso
Copy link
Contributor Author

0xLiso commented Jun 6, 2021

Is this normal?
screenshot
Medium level of shadows. GPU: NVIDIA GeForce GTX 1050 Ti Mobile Driver: nvidia-460

Yes, that's because the shadow has exactly the same angle that the blocks and creates that kind of glitch.

2 possible solutions are, change shadow tilt by something between 15.0 and 30.0 in the advanced settings, or if you don't want hard shadows, you can increase the soft shadow range by something like 5.0

imagen

@lhofhansl
Copy link
Contributor

Yeah!

Let's do further improvements in individual PRs.
(And if someone wanted to tackle reflective water I'd be quite supportive of it :) )

@Andrey2470T
Copy link
Contributor

(And if someone wanted to tackle reflective water I'd be quite supportive of it :) )

I would like to see the specular lighting in MT (the reflective water is enough specific feature) with a support of setting materials for each node + yes, reflections of the environment. That would allow to make a mirror on water and on glass surfaces for example. Currently I'm learning OpenGL and GLSL, so I want to try to make that in MT, but that will rather take much time as I'm a quite newbie in it and I don't guarantee I can do that.

@Extex101
Copy link

Extex101 commented Jun 6, 2021

Incredible work guys! Congrats on the merge!

benrob0329 pushed a commit to benrob0329/minetest that referenced this pull request Jun 7, 2021

Co-authored-by: x2048 <codeforsmile@gmail.com>
@LoneWolfHT
Copy link
Contributor

Looks like the segfault was due to a conflict with @SmallJoker 's free_rotation PR

@LoneWolfHT
Copy link
Contributor

Just got another segfault when a mistake in some mod code caused a game crash, I'm using latest master with no code changes made
image

@Jipok
Copy link

Jipok commented Jun 7, 2021

2 possible solutions are, change shadow tilt by something between 15.0 and 30.0 in the advanced settings, or if you don't want hard shadows, you can increase the soft shadow range by something like 5.0

Well, the trees are better. But are animal shadows normal? Why stripes?

cringe_shadow.mp4

But in general, shadowing improves the picture very well.

@neoh4x0r
Copy link
Contributor

neoh4x0r commented Jun 8, 2021

The drawer visuals from the drawers mod https://github.com/minetest-mods/drawers are not displayed correctly.

With Shadows Disabled:
with shadows disabled

With Shadows Enabled:
with shadows enabled

@0xLiso
Copy link
Contributor Author

0xLiso commented Jun 8, 2021

The drawer visuals from the drawers mod https://github.com/minetest-mods/drawers are not displayed correctly.

First of all... LoL.

Can you create an issue for that? this PR is closed and these bugs can be easily forgotten.

@minetest minetest locked as resolved and limited conversation to collaborators Jun 8, 2021
@rubenwardy
Copy link
Member

Locking this PR as it has been merged. Please report any bugs in new issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@ Client / Audiovisuals Feature ✨ PRs that add or enhance a feature Non-trivial A large amount of work is required to address this (sometimes to the point of being infeasible). Shaders >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet