Safe Haskell | Safe-Infered |
---|
Generate a realistic sky.
- type Atmosphere = [AtmosphereLayer]
- type SkyFilter = (Vector3D -> RGB) -> Maybe (RGB -> RGB)
- data AtmosphereComposition
- data AtmosphereLayer = AtmosphereLayer {}
- rawSkyFilter :: SkyFilter
- dynamicSkyFilter :: RSdouble -> RSdouble -> SkyFilter
- earth_atmosphere :: Atmosphere
- atmosphereAbsorbtion :: Atmosphere -> Point3D -> Vector3D -> RGB
- atmosphereScattering :: Atmosphere -> [(Vector3D, RGB)] -> Point3D -> Vector3D -> RGB
- absorbtionFilter :: RGB -> RGB
- atmosphereScatteringMaterial :: Atmosphere -> [(Vector3D, RGB)] -> SkyFilter -> MaterialM attr ()
Documentation
type Atmosphere = [AtmosphereLayer]Source
An atmosphere, consisting of zero or more layers of different composition.
type SkyFilter = (Vector3D -> RGB) -> Maybe (RGB -> RGB)Source
An adaptive color filter, used to set adaptive white and black points.
Returns Nothing
if the result is a constant black.
data AtmosphereComposition Source
A specific scattering model for an AtmosphereLayer
Air | Uses Rayleigh scattering, as though an oxygen-nitrogen atmosphere. |
Vapor | Uses Mie scattering (approximate) to give an effect similar to what we would expect from some kind of suspended water vapor. |
Dust RGB | Macroscopic colored dust spheres. |
Fog RGB | Unrealistic colored fog, might be appropriate for some kind of poison gas atmosphere. |
data AtmosphereLayer Source
A single layer of atmosphere.
AtmosphereLayer | |
|
dynamicSkyFilter :: RSdouble -> RSdouble -> SkyFilterSource
A SkyFilter
that takes a maximum black point and a minimum white point, and applies
these to black and white points determined by probabalistic means, and then generates a
linear filter based on those points. For well chosen parameters this will hopefully
produce an appealing sky at any time of day or twilight.
earth_atmosphere :: AtmosphereSource
An atmosphere that is fairly typical of the earth.
atmosphereAbsorbtion :: Atmosphere -> Point3D -> Vector3D -> RGBSource
Aggrigated absorbtion from multiple AtmosphereLayers
.
atmosphereScattering :: Atmosphere -> [(Vector3D, RGB)] -> Point3D -> Vector3D -> RGBSource
Aggrigated scattering from multiple AtmosphereLayers
and multiple suns.
absorbtionFilter :: RGB -> RGBSource
Takes a filter color and modifies it on a logarithmic scale. Helps when dealing with very dense color filters. In particular, atmosphereScatteringMaterial uses this.
atmosphereScatteringMaterial :: Atmosphere -> [(Vector3D, RGB)] -> SkyFilter -> MaterialM attr ()Source
Generate a material for a sky sphere. This material includes both scattering and absorbtion information. The material assumes the origin as the eye point, tracing to the geometric point at each vertex. Therefore, this material need not be applied to an exact sphere.