Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sky cover texture for PhysicalSkyMaterial #61478

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented May 27, 2022

Follow-up to #58018.

This replaces the previous night sky property with more flexible Sky Cover and Sky Cover Modulate properties.

Like ProceduralSkyMaterial, this is designed to be used for night sky but also static cloud covering. However, unlike ProceduralSkyMaterial, sky cover in PhysicalSkyMaterial automatically takes atmospheric scattering into account for its coloring.

Testing project: test_night_sky_2.zip

Preview

Dusk

2022-05-27_23 29 59

Duskier

2022-05-27_23 30 20

Duskiest

2022-05-27_23 31 20

This replaces the previous night sky property with more flexible
Sky Cover and Sky Cover Modulate properties.

Like ProceduralSkyMaterial, this is designed to be used for
night sky but also static cloud covering.
However, unlike ProceduralSkyMaterial, sky cover in
PhysicalSkyMaterial automatically takes atmospheric scattering
into account for its coloring.
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure adding a cloud texture makes much sense for the PhysicalSkyMaterial. It is going to be very hard to hack them in in a way that is relatively easy to author, intuitive to use, and physically plausible.

@@ -722,7 +738,8 @@ void sky() {
float sunAngularDiameterCos2 = cos(LIGHT0_SIZE * sun_disk_scale*0.5);
float sundisk = smoothstep(sunAngularDiameterCos, sunAngularDiameterCos2, cos_theta);
vec3 L0 = (sun_energy * 1900.0 * extinction) * sundisk * LIGHT0_COLOR;
L0 += texture(night_sky, SKY_COORDS).xyz * extinction;
// Multiply by 250 to compensate for color multiplication by 0.04 below and the default exposure (0.1).
L0 += (sky_cover_texture.rgb * sky_cover_modulate.rgb) * sky_cover_texture.a * sky_cover_modulate.a * extinction * 250.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiplying by 250 will make this way overbright when used as a night sky. For physical sky, it doesn't make as much sense to add cloud cover this way as clouds do not contribute direct lighting (like stars). Cloud cover belongs above with the other in scattering terms.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 9, 2023
@clayjohn clayjohn modified the milestones: 4.1, 4.x May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants