class
Eagle::Environment
- Eagle::Environment
- Reference
- Object
Overview
Scene-wide 3D settings: sky, ambient light, fog and shadows. The active one is
Scene3D.environment.
env = Scene3D.environment
env.fog(15, 60, Color.gray(0.7)) # fade to gray between 15 and 60 units
env.sky = false
env.background = Color::BLACK # space
env.shadow_distance = 25 # sharper shadows over a smaller area
Defined in:
eagle/graphics3d/renderer3d.crInstance Method Summary
-
#ambient : Color
Light that reaches everything, even in shadow.
-
#ambient=(ambient : Color)
Light that reaches everything, even in shadow.
-
#background : Color
Flat background color when the sky is off.
-
#background=(background : Color)
Flat background color when the sky is off.
-
#fog(start : Number, finish : Number, color : Color | Nil = nil) : self
Turns on fog between start and finish, optionally changing its color.
-
#fog_color : Color
Color distant things fade toward.
-
#fog_color=(fog_color : Color)
Color distant things fade toward.
-
#fog_end : Float32
Distance where fog is total.
-
#fog_end=(fog_end : Float32)
Distance where fog is total.
-
#fog_start : Float32
Distance where fog begins.
-
#fog_start=(fog_start : Float32)
Distance where fog begins.
-
#shadow_bias : Float32
Offset that stops surfaces from shadowing themselves ("shadow acne").
-
#shadow_bias=(shadow_bias : Float32)
Offset that stops surfaces from shadowing themselves ("shadow acne").
-
#shadow_distance : Float32
How far from the camera shadows are drawn.
-
#shadow_distance=(shadow_distance : Float32)
How far from the camera shadows are drawn.
-
#shadow_size : Int32
Shadow map resolution in pixels.
-
#shadow_size=(shadow_size : Int32)
Shadow map resolution in pixels.
-
#shadows=(shadows : Bool)
Master switch for shadows.
-
#shadows? : Bool
Master switch for shadows.
-
#sky=(sky : Bool)
Draw the gradient sky.
-
#sky? : Bool
Draw the gradient sky.
-
#sky_bottom : Color
Color below the horizon.
-
#sky_bottom=(sky_bottom : Color)
Color below the horizon.
-
#sky_colors(top : Color, horizon : Color, bottom : Color) : self
Sets the three sky colors at once.
-
#sky_horizon : Color
Sky color at the horizon.
-
#sky_horizon=(sky_horizon : Color)
Sky color at the horizon.
-
#sky_top : Color
Sky color overhead.
-
#sky_top=(sky_top : Color)
Sky color overhead.
Instance Method Detail
Light that reaches everything, even in shadow. Raise it if shadows look too black.
Light that reaches everything, even in shadow. Raise it if shadows look too black.
Turns on fog between start and finish, optionally changing its color. Returns self.
Distance where fog is total. Fog is off when this is not greater than #fog_start.
Distance where fog is total. Fog is off when this is not greater than #fog_start.
Offset that stops surfaces from shadowing themselves ("shadow acne"). Raise it slightly if you see stripes, and lower it if shadows detach from objects.
Offset that stops surfaces from shadowing themselves ("shadow acne"). Raise it slightly if you see stripes, and lower it if shadows detach from objects.
How far from the camera shadows are drawn. Smaller values give sharper shadows.
How far from the camera shadows are drawn. Smaller values give sharper shadows.
Shadow map resolution in pixels. Higher is sharper and slower.
Sets the three sky colors at once. Returns self.