dmurdoch / rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
https://dmurdoch.github.io/rgl/
GNU General Public License v2.0
84 stars 20 forks source link

Lights are not infinitely distant #403

Open dmurdoch opened 6 months ago

dmurdoch commented 6 months ago

The help page for light3d describes some lights specified by direction as being infinitely distant, and others specified by position. However, that is not how they are currently implemented.

Currently all lights are rendered as if they are at a finite distance. This is most visible with fov = 0, as shown in #401 . With a positive fov, the finite position is moved away from the scene, but it is never infinite.

This may be unavoidable to some extent. I think the old OpenGL 1.2 used in rgl only supports one kind of lighting: finite or infinite, not separate settings for each light. (I'm not sure about that.) But lighting using shaders as in rglwidget() or the eventual update to rgl would allow a mixture of types.