canvas icon indicating copy to clipboard operation
canvas copied to clipboard

Held item light sources light based on the camera position rather than the player position

Open deli73 opened this issue 4 years ago • 2 comments
trafficstars

This is probably less obvious with larger light sources, but we noticed this while holding redstone ore, which casts a glow with a very small radius. The light is being cast from the camera location.

(For reference, we are also using the True Darkness and Illuminations mods (though those shouldn't affect this besides true dark making it more obvious), and we have the max light radius set to 10 instead of the default 11. If any additional information is needed, let us know.)

Steps to reproduce:

  1. enter a dark space
  2. hold redstone ore in your hand
  3. enter third-person mode and move the camera near something that can be illuminated
  4. observe the red glow coming from the camera rather than the player's hand

image

deli73 avatar Feb 21 '21 10:02 deli73

This is a current limitation of the low-cost way held lights are currently implemented. Rendering lights from the player perspective when camera is in third person would also lead to obviously incorrect results without an extra pass or some other more elaborate mechanism.

grondag avatar Feb 26 '21 14:02 grondag

I think this could be implemented relatively easily by passing the player's distance to camera as a single float uniform. But I won't be close minded about it especially with the possibility of light list and voxel tracing for dynamic lighting. :)

spiralhalo avatar Jun 27 '21 20:06 spiralhalo