diff options
Diffstat (limited to 'source/blender/draw/engines/eevee_next/shaders')
-rw-r--r-- | source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl index 9422cb726b7..4b53375575c 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl @@ -345,7 +345,7 @@ vec3 coordinate_screen(vec3 P) else { /* TODO(fclem): Actual camera transform. */ window.xy = project_point(ProjectionMatrix, transform_point(ViewMatrix, P)).xy * 0.5 + 0.5; - window.xy = window.xy * CameraTexCoFactors.xy + CameraTexCoFactors.zw; + window.xy = window.xy * camera_buf.uv_scale + camera_buf.uv_bias; } return window; } diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh index 78d52d4b90e..b632564a9ca 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_material_info.hh @@ -20,6 +20,8 @@ GPU_SHADER_CREATE_INFO(eevee_sampling_data) GPU_SHADER_CREATE_INFO(eevee_utility_texture) .sampler(RBUFS_UTILITY_TEX_SLOT, ImageType::FLOAT_2D_ARRAY, "utility_tx"); +GPU_SHADER_CREATE_INFO(eevee_camera).uniform_buf(CAMERA_BUF_SLOT, "CameraData", "camera_buf"); + /** \} */ /* -------------------------------------------------------------------- */ @@ -114,7 +116,8 @@ GPU_SHADER_CREATE_INFO(eevee_surf_deferred) // .image_out(6, Qualifier::READ_WRITE, GPU_RGBA16F, "rpass_volume_light") /* TODO: AOVs maybe? */ .fragment_source("eevee_surf_deferred_frag.glsl") - // .additional_info("eevee_aov_out", "eevee_sampling_data", "eevee_utility_texture") + // .additional_info("eevee_aov_out", "eevee_sampling_data", "eevee_camera", + // "eevee_utility_texture") ; GPU_SHADER_CREATE_INFO(eevee_surf_forward) @@ -127,6 +130,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_forward) .fragment_source("eevee_surf_forward_frag.glsl") .additional_info("eevee_cryptomatte_out", "eevee_light_data", + "eevee_camera", "eevee_utility_texture", "eevee_sampling_data" // "eevee_lightprobe_data", @@ -141,7 +145,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_forward) GPU_SHADER_CREATE_INFO(eevee_surf_depth) .vertex_out(eevee_surf_iface) .fragment_source("eevee_surf_depth_frag.glsl") - .additional_info("eevee_sampling_data", "eevee_utility_texture"); + .additional_info("eevee_sampling_data", "eevee_camera", "eevee_utility_texture"); GPU_SHADER_CREATE_INFO(eevee_surf_world) .vertex_out(eevee_surf_iface) @@ -151,6 +155,7 @@ GPU_SHADER_CREATE_INFO(eevee_surf_world) .additional_info("eevee_aov_out", "eevee_cryptomatte_out", "eevee_render_pass_out", + "eevee_camera", "eevee_utility_texture"); #undef image_out |