mattrdowney / planetaria

A Unity framework for Euclidean 2-sphere games (e.g. 2D virtual reality games) [quasi-MIT license]
Other
10 stars 2 forks source link

Planetaria Baked Lighting #113

Open mattrdowney opened 6 years ago

mattrdowney commented 6 years ago

Ahhhh, this is so cool.

You can give a Color AnimationCurve to set the colors in 360 degrees (e.g. for Ra's sun rays you could do something like a square curve between white and gray).

You have to raycast against geometry to detect where to generate the light information.

You also have to define an (optional) dropoff function.

mattrdowney commented 6 years ago

Research: flood fill algorithm (similar to Invertigo water level)

mattrdowney commented 5 years ago

Notably, any lights that never move can be batched into a single static light. The only limitation is the light resolution (e.g. you probably don't wan't to exceed 6*4096^2 texture resolution for a single point light, which may be an issue for small lights).

Also notably, the shadows can also be baked in with relative simplicity.

Much of my original commentary was intrigue over a PlanetariaCuculoris (more or less) and light/shadow calculations.