From 44aaa9893ba876d23c7b9e93c2ed83c55f96afd9 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Fri, 16 Sep 2022 15:04:47 +0200 Subject: 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 --- source/blender/draw/intern/draw_manager_data.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/draw') diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index c75049508f9..820242720c8 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -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); -- cgit v1.2.3