Eevee: Add support for Nishita sky texture

Sun Disc is currently not supported because it'll need special handling - on the one hand, I'm not sure if Eevee would handle a 1e6 coming out of a background shader without issues, and on the other hand it won't actually cast sharp shadows anyways.
I guess we'd want to internally add a sun to the lamps if Sun Disc is enabled, but getting that right is tricky since the user could e.g. swap RGB channels in the node tree and the lamp wouldn't match that.
Anyways, that can be handled later, the sky itself is already a start.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D13522
This commit is contained in:
Lukas Stockner
2022-09-16 15:04:47 +02:00
committed by Jeroen Bakker
parent 2eb19eeb19
commit 44aaa9893b
10 changed files with 218 additions and 10 deletions

View File

@@ -1631,6 +1631,10 @@ void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial
/* Color Ramp */
DRW_shgroup_uniform_texture(grp, tex->sampler_name, *tex->colorband);
}
else if (tex->sky) {
/* Sky */
DRW_shgroup_uniform_texture_ex(grp, tex->sampler_name, *tex->sky, tex->sampler_state);
}
}
GPUUniformBuf *ubo = GPU_material_uniform_buffer_get(material);