forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request godotengine#37179 from clayjohn/VULKAN-sky-shader
Implement Sky Shaders
- Loading branch information
Showing
41 changed files
with
2,543 additions
and
1,129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="PhysicalSkyMaterial" inherits="Material" version="4.0"> | ||
<brief_description> | ||
[Sky] [Material] used for a physically based sky. | ||
</brief_description> | ||
<description> | ||
The [PhysicalSkyMaterial] uses the Preetham analytic daylight model to draw a sky based on physical properties. This results in a substantially more realistic sky than the [ProceduralSkyMaterial], but it is slightly slower and less flexible. | ||
The [PhysicalSkyMaterial] only supports one sun. The color, energy, and direction of the sun are taken from the first [DirectionalLight] in the scene tree. | ||
As it is based on a daylight model, the sky fades to black as the sunset ends. If you want a full day/night cycle, you will have to add a night sky by converting this to a [ShaderMaterial] and adding a night sky directly into the resulting shader. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
</methods> | ||
<members> | ||
<member name="dither_strength" type="float" setter="set_dither_strength" getter="get_dither_strength" default="1.0"> | ||
Sets the amount of dithering to use. Dithering helps reduce banding that appears from the smooth changes in color in the sky. Use the lowest value possible, higher amounts may add fuzziness to the sky. | ||
</member> | ||
<member name="exposure" type="float" setter="set_exposure" getter="get_exposure" default="0.1"> | ||
Sets the exposure of the sky. Higher exposure values make the entire sky brighter. | ||
</member> | ||
<member name="ground_color" type="Color" setter="set_ground_color" getter="get_ground_color" default="Color( 1, 1, 1, 1 )"> | ||
Modulates the [Color] on the bottom half of the sky to represent the ground. | ||
</member> | ||
<member name="mie_coefficient" type="float" setter="set_mie_coefficient" getter="get_mie_coefficient" default="0.005"> | ||
Controls the strength of mie scattering for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, mie scattering results in a whiteish color around the sun and horizon. | ||
</member> | ||
<member name="mie_color" type="Color" setter="set_mie_color" getter="get_mie_color" default="Color( 0.36, 0.56, 0.82, 1 )"> | ||
Controls the [Color] of the mie scattering effect. While not physically accurate, this allows for the creation of alien looking planets. | ||
</member> | ||
<member name="mie_eccentricity" type="float" setter="set_mie_eccentricity" getter="get_mie_eccentricity" default="0.8"> | ||
Controls the direction of the mie scattering. A value of [code]1[/code] means that when light hits a particle it passing through straight forward. A value of [code]-1[/code] means that all light is scatter backwards. | ||
</member> | ||
<member name="rayleigh_coefficient" type="float" setter="set_rayleigh_coefficient" getter="get_rayleigh_coefficient" default="2.0"> | ||
Controls the strength of the rayleigh scattering. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. | ||
</member> | ||
<member name="rayleigh_color" type="Color" setter="set_rayleigh_color" getter="get_rayleigh_color" default="Color( 0.056, 0.14, 0.3, 1 )"> | ||
Controls the [Color] of the rayleigh scattering. While not physically accurate, this allows for the creation of alien looking planets. For example, setting this to a red [Color] results in a mars looking atmosphere with a corresponding blue sunset. | ||
</member> | ||
<member name="sun_disk_scale" type="float" setter="set_sun_disk_scale" getter="get_sun_disk_scale" default="1.0"> | ||
Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth. | ||
</member> | ||
<member name="turbidity" type="float" setter="set_turbidity" getter="get_turbidity" default="10.0"> | ||
Sets the thickness of the atmosphere. High turbidity creates a foggy looking atmosphere, while a low turbidity results in a clearer atmosphere. | ||
</member> | ||
</members> | ||
<constants> | ||
</constants> | ||
</class> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="ProceduralSkyMaterial" inherits="Material" version="4.0"> | ||
<brief_description> | ||
A [Material] used with [Sky] to generate a background based on user input parameters. | ||
</brief_description> | ||
<description> | ||
ProceduralSkyMaterial provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are very similar, they are defined by a color at the horizon, another color, and finally an easing curve to interpolate between these two colors. Similarly, the sun is described by a position in the sky, a color, and an easing curve. However, the sun also defines a minimum and maximum angle, these two values define at what distance the easing curve begins and ends from the sun, and thus end up defining the size of the sun in the sky. | ||
The [ProceduralSkyMaterial] uses a lightweight shader to draw the sky and is thus suited for real time updates. When you do not need a quick sky that is not realistic, this is a good option. | ||
The [ProceduralSkyMaterial] supports up to 4 suns. Each sun takes its color, energy, and direction from the corresponding [DirectionalLight] in the scene. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
</methods> | ||
<members> | ||
<member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" default="Color( 0.12, 0.12, 0.13, 1 )"> | ||
Color of the ground at the bottom. Blends with [member ground_horizon_color]. | ||
</member> | ||
<member name="ground_curve" type="float" setter="set_ground_curve" getter="get_ground_curve" default="0.02"> | ||
How quickly the [member ground_horizon_color] fades into the [member ground_bottom_color]. | ||
</member> | ||
<member name="ground_energy" type="float" setter="set_ground_energy" getter="get_ground_energy" default="1.0"> | ||
Amount of energy contribution from the ground. | ||
</member> | ||
<member name="ground_horizon_color" type="Color" setter="set_ground_horizon_color" getter="get_ground_horizon_color" default="Color( 0.37, 0.33, 0.31, 1 )"> | ||
Color of the ground at the horizon. Blends with [member ground_bottom_color]. | ||
</member> | ||
<member name="sky_curve" type="float" setter="set_sky_curve" getter="get_sky_curve" default="0.09"> | ||
How quickly the [member sky_horizon_color] fades into the [member sky_top_color]. | ||
</member> | ||
<member name="sky_energy" type="float" setter="set_sky_energy" getter="get_sky_energy" default="1.0"> | ||
Amount of energy contribution from the sky. | ||
</member> | ||
<member name="sky_horizon_color" type="Color" setter="set_sky_horizon_color" getter="get_sky_horizon_color" default="Color( 0.55, 0.69, 0.81, 1 )"> | ||
Color of the sky at the horizon. Blends with [member sky_top_color]. | ||
</member> | ||
<member name="sky_top_color" type="Color" setter="set_sky_top_color" getter="get_sky_top_color" default="Color( 0.35, 0.46, 0.71, 1 )"> | ||
Color of the sky at the top. Blends with [member sky_horizon_color]. | ||
</member> | ||
<member name="sun_angle_max" type="float" setter="set_sun_angle_max" getter="get_sun_angle_max" default="100.0"> | ||
Distance from center of sun where it fades out completely. | ||
</member> | ||
<member name="sun_angle_min" type="float" setter="set_sun_angle_min" getter="get_sun_angle_min" default="1.0"> | ||
Distance from sun where it goes from solid to starting to fade. | ||
</member> | ||
<member name="sun_curve" type="float" setter="set_sun_curve" getter="get_sun_curve" default="0.05"> | ||
How quickly the sun fades away between [member sun_angle_min] and [member sun_angle_max]. | ||
</member> | ||
</members> | ||
<constants> | ||
</constants> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.