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

Shape of light does not match vanilla #43

Closed
FewerFlaws opened this issue Dec 31, 2020 · 7 comments
Closed

Shape of light does not match vanilla #43

FewerFlaws opened this issue Dec 31, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@FewerFlaws
Copy link

Is your feature request related to a problem? Please describe.
If I am standing on a torch then pick it up I can see the lit region around me shrink rather suddenly. This, it seems, is because Dynamic Lights creates light in a radius around you whereas vanilla light creates square patterns.

Describe the solution you'd like
Increase the radius of held lights so that the area of the lit circle is the same as the area of the lit square provided by the item when placed. The circular light pattern is a lot more nice to look at. The square pattern of vanilla light sources is fine since they don't move, but it would be weird when carrying a torch to see that the light extends further in cardinal directions.

Describe alternatives you've considered

  • Put a multiplier in the config file so that people can adjust the size of the light to their liking and accoplish the solution I proposed above.
  • Create a fade-in + fade-out effect for light sources as they are created and removed. This seems like a lot of work and a significantly more invasive than this mod is intended to be. A configurable fade-in might be easy and look nice, but doesn't necessarily match vanilla style so isn't important.

Additional context
I use True Darkness, which makes the effect easy to see.

Screenshot 1: There is a torch on the ground and I am standing slightly in front of it. Notice the gold and iron bars.
2020-12-31_05 35 35

Screenshot 2: I've remove the torch on the ground but continue to hold one in my hand. Only the iron bar in the center is still visible.
2020-12-31_05 35 46

Screenshot 3: Just looking straight down so you can see that I was standing basically on top of the torch, but slightly ahead of it.
2020-12-31_05 35 50

@FewerFlaws FewerFlaws added the enhancement New feature or request label Dec 31, 2020
@LambdAurora
Copy link
Owner

There's 2 reasons for the current dynamic lighting radius:

  1. Higher radius would rebuild more chunks which significantly slows down the game a lot. Sodium optimizes that, and once I can use Canvas' dynamic lighting feature with Canvas it'll be fast too, but Vanilla will still struggle a lot.
  2. It kind of also serves as a balance/gameplay measure, it's a bit too cheaty in my opinion to have a the same light radius without ever placing actual light sources. But I can understand why some people would want it though.

So I might implement a slider for the radius, but not sure when I'll do that.

And for the fade-in/fade-out effect it would require more work and updates than I'm comfortable with so the chances of it ever made it into the mod is slim.

@FewerFlaws
Copy link
Author

I prefer not to have a slider because it becomes too easy to crank things up.  But it makes sense for torches in your hand to be just as effective as torches that are placed. Right now they are noticeably less effective.

Vanilla torches provide a light level of 14 blocks, meaning that the lighted region extends 14 blocks out in the cardinal directions.  A total of 365 blocks are lit by a torch.  To light the same number of blocks using a circular pattern, the necessary radius is sqrt(365/pi) blocks long, or 10.779 blocks.  Here's a small chart generalizing this for light levels up to 25 (note that light levels of 15 are the maximum possible with vanilla objects):

Capture

@FewerFlaws
Copy link
Author

This is balanced. I'm not sure how the code works, but it seems like this change would not increase the load significantly. Perhaps I'm mistaken =]

@LambdAurora
Copy link
Owner

A dynamic light source lit up a maximum of 8 chunk sections with a radius of 7.75, if going higher than 7.75 it will go beyond those 8 chunk sections and will cause even more performance issues.

The issue with chunk rebuilds is it recomputes the geometry of a chunk and re-send the whole chunk to the GPU. The more complex the chunk is the more slow it gets (#16).

If I had another way of doing dynamic lighting with maybe a shader pipeline I would be more comfortable with this change.

@FewerFlaws
Copy link
Author

FewerFlaws commented Jan 1, 2021 via email

@LambdAurora
Copy link
Owner

Though, latest Canvas builds have built-in hand-held lighting (but not more yet and the way it's done don't allow me to add proper compatibility yet) but might match better the vanilla pattern? At least there's not the radius issue with performances (and it has colored lighting which is sweet).

@FewerFlaws
Copy link
Author

I've been eyeing up that canvas renderer. Sodium causes flickering on iron bars with its compax vertex formats so I have them disabled. I'm not sure how much performance I'm getting at this point. But performance is my priority; smooth framerates trump texture quality any day. I had no idea about the built in hand-held lighting there. Thanks for the tip =D

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

No branches or pull requests

2 participants