ntoronto / pict3d

3-dimensional picts
GNU Lesser General Public License v3.0
113 stars 23 forks source link

Applying scaling transformations to point lights doesn't scale them #12

Closed ntoronto closed 9 years ago

ntoronto commented 9 years ago

This is usually only a modeling problem, with the workaround "don't do that" or "adjust the light intensity for the scaled result." But freezing a point light makes its shader think its bounds should be much smaller, which creates undesirable artifacts.

#lang racket
(require pict3d)
(combine (scale (freeze (light (pos 0 0 -1)
                               (emitted "yellow" 0.25)))
                0.1)
         (rectangle (pos -2 -2 -1)
                    (pos 2 2 -1/2)))

One solution is to associate an affine transformation with each light, just like spheres. We'd end up with elliptical light sources as well as spherical, which actually isn't a terrible thing.

ntoronto commented 9 years ago

bad-point-light

ntoronto commented 9 years ago

Fixed by 56e3cb404a7dd08cf9de4f647e947243ed61270c.