Canvas Renderer

Canvas Renderer

202k Downloads

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

deli73 opened this issue ยท 2 comments

commented

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

commented

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.

commented

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. :)