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

Mapping caves: Incorporate lighting into rendering #117

Open
PeterNerlich opened this issue Jul 19, 2020 · 2 comments
Open

Mapping caves: Incorporate lighting into rendering #117

PeterNerlich opened this issue Jul 19, 2020 · 2 comments
Labels
Backend enhancement New feature or request

Comments

@PeterNerlich
Copy link
Contributor

PeterNerlich commented Jul 19, 2020

This will probably be heavily discussed if not flat out discarded because of the computational overhead, but hear me out on the advantages I think it would bring:

  • Surface: Probably no benefit. We want to see all nodes brightly because they are hit by sunlight, while nodes that are not are hidden (since we already see the nodes above them and terminate there)
  • Sub surface layers: Huge benefit! (In my opinion) — Having huge caves mapped on layers is fun, but is a) disorienting and b) gives resources away: When in those caves ingame, I only see what is lit by torches. I use them to orient myself and find my way around. In the map, every node is displayed brightly and I can hardly make out the torches. It is also difficult getting an idea of the terrain, as the height differences are not contrasted well for that purpose and it is very difficult to discriminate between cave territory and solid rock:
    2020-07-19 minetest map dmeo
    This also discloses many resources on the surface of the cave as well as inside walls, which I would regard equivalent with "x-ray vision" and similar unfair gameplay.

I would appreciate a map that looked more like this:

2020-07-19 minetest map dmeo-lights

Here I manually overlayed everything with a black layer at ~95% alpha, made the solid rock areas completely black and placed the light cones where the torches are (meaning lighting differences due to varying height are ignored). This already induces a strong association with how the cave is perceived in game.

I hope that this lighting information can be taken from the game directly (if I interpret https://dev.minetest.net/light right).
If unlit areas should still be vaguely rendered (as in the impression above), there would need to be still another check for when the first node which is tried is not transparent, to determine whether it is solid rock or just part of a surface. For that, either load the map block above just to check, or generally ignore the first row of nodes when rendering (both of which feel wrong).

Another thought for me is then that in caves it would be cool to ignore the ceiling: If the rendering already starts out in solid rock, treat it like air until either real air and then the floor is found or we reach the bottom of the layer to render and really make it black.
While this would be fun, I imagine this would add a huge performance impact — while in the image above we often terminate right away with a black pixel, here we often scan the whole layer depth whether there is anything there.

@BuckarooBanzay
Copy link
Member

This will probably be heavily discussed if not flat out discarded because of the computational overhead, but hear me out on the advantages I think it would bring:

Ideas are always welcome 👍

Surface: Probably no benefit. We want to see all nodes brightly because they are hit by sunlight, while nodes that are not are hidden (since we already see the nodes above them and terminate there)

A "night" time view would be interesting though, especially from the surface

I hope that this lighting information can be taken from the game directly (if I interpret https://dev.minetest.net/light right).

Yes, all the information should be in the mapblock data itself

All this sounds very interesting but i think it crosses paths with what i'm trying to achieve with https://github.com/BuckarooBanzay/mtworldview/ (when i have time and motivation to work on that again)

I'm marking this as "enhancement" but it may need some base-work for pluggable renderers first

@heavygale
Copy link

A "night" time view would be interesting though, especially from the surface

I like that idea, maybe as a overlay so it can be faded in and out instead of hard cuts between a night and a day map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants