|
Blender V5.3
|
#include "eevee_bxdf.bsl.hh"#include "eevee_lightprobe_shared.hh"#include "eevee_ray_types_lib.bsl.hh"#include "eevee_reverse_z_lib.bsl.hh"#include "eevee_thickness_lib.bsl.hh"#include "gpu_shader_codegen_lib.glsl"#include "gpu_shader_math_fast.bsl.hh"#include "gpu_shader_math_matrix_transform.bsl.hh"Go to the source code of this file.
Classes | |
| struct | ScreenTraceHitData |
Functions | |
| void | raytrace_clip_ray_to_near_plane (ViewMatrices view, Ray &ray) |
| ScreenTraceHitData | raytrace_screen (ViewMatrices view, RayTraceData rt_data, HiZData hiz_data, sampler2D hiz_tx, float stride_rand, float roughness, const bool allow_self_intersection, Ray ray) |
| ScreenTraceHitData | raytrace_planar (ViewMatrices view, RayTraceData rt_data, sampler2DArrayDepth planar_depth_tx, PlanarProbeData planar, float stride_rand, Ray ray) |
| Ray | raytrace_thickness_ray_amend (Ray ray, ClosureUndetermined cl, float3 V, Thickness thickness) |
| bool | clip_ray (float3 &start, float3 &end, const float3 direction, const float max_distance, const float4 frustum_planes[6]) |
| float | raytrace_screen_2 (ViewMatrices view, const float3 vs_origin, const float3 vs_end, const float3 vs_direction, sampler2D depth_tx, const RayTraceData rt_data, const int max_steps, const float jitter, usampler2D ob_id_tx, const uint object_id, float2 &r_hit_uv) |
| float3 | raytrace_sample_screen (ViewMatrices view, sampler2D radiance_tx, RayTraceData raytrace, ScreenTraceHitData hit, float roughness, float2 ss_hit_P) |
| float3 | raytrace_sample_screen (ViewMatrices view, sampler2DArray radiance_tx, RayTraceData raytrace, ScreenTraceHitData hit, float roughness, float2 ss_hit_P, int layer) |
| bool clip_ray | ( | float3 & | start, |
| float3 & | end, | ||
| const float3 | direction, | ||
| const float | max_distance, | ||
| const float4 | frustum_planes[6] ) |
Definition at line 229 of file eevee_ray_trace_screen_lib.bsl.hh.
References abs, clip_ray(), dot(), max, min, and float4::w.
Referenced by clip_ray(), blender::gizmo_window_project_2d(), raycast_eval(), and eevee::shadow_eval().
| void raytrace_clip_ray_to_near_plane | ( | ViewMatrices | view, |
| Ray & | ray ) |
Screen-space ray-tracing routine.
Based on "Efficient GPU Screen-Space Ray Tracing" by Morgan McGuire & Michael Mara https://jcgt.org/published/0003/04/04/paper.pdf
Many modifications were made for our own usage.
Definition at line 27 of file eevee_ray_trace_screen_lib.bsl.hh.
References abs, Ray::direction, Ray::max_time, ViewMatrices::near(), Ray::origin, raytrace_clip_ray_to_near_plane(), and packed_float3::z.
Referenced by raytrace_clip_ray_to_near_plane(), raytrace_planar(), and raytrace_screen().
| ScreenTraceHitData raytrace_planar | ( | ViewMatrices | view, |
| RayTraceData | rt_data, | ||
| sampler2DArrayDepth | planar_depth_tx, | ||
| PlanarProbeData | planar, | ||
| float | stride_rand, | ||
| Ray | ray ) |
Definition at line 149 of file eevee_ray_trace_screen_lib.bsl.hh.
References ScreenSpaceRay::create(), Ray::direction, ScreenSpaceRay::direction, float, length(), ScreenSpaceRay::max_time, min, mix, Ray::origin, ScreenSpaceRay::origin, project_point(), raytrace_clip_ray_to_near_plane(), raytrace_planar(), reverse_z::read(), saturate, ViewMatrices::screen_to_ndc(), texture(), textureLod(), textureSize(), ViewMatrices::winmat, and float4::z.
Referenced by raytrace_planar(), and eevee::raytrace::planar::trace().
| float3 raytrace_sample_screen | ( | ViewMatrices | view, |
| sampler2D | radiance_tx, | ||
| RayTraceData | raytrace, | ||
| ScreenTraceHitData | hit, | ||
| float | roughness, | ||
| float2 | ss_hit_P ) |
Sample the given full-screen frame-buffer at the given hit location. Does a small contact aware blur on incoming radiance.
Definition at line 383 of file eevee_ray_trace_screen_lib.bsl.hh.
References exp2, log2, raytrace_sample_screen(), saturate, textureLod(), ScreenTraceHitData::time, ScreenTraceHitData::v_hit_P, float4::w, and ViewMatrices::winmat.
Referenced by raytrace_sample_screen(), raytrace_sample_screen(), eevee::raytrace::planar::trace(), and eevee::raytrace::screen::trace().
| float3 raytrace_sample_screen | ( | ViewMatrices | view, |
| sampler2DArray | radiance_tx, | ||
| RayTraceData | raytrace, | ||
| ScreenTraceHitData | hit, | ||
| float | roughness, | ||
| float2 | ss_hit_P, | ||
| int | layer ) |
Sample the given full-screen frame-buffer at the given hit location. Does a small contact aware blur on incoming radiance.
Definition at line 424 of file eevee_ray_trace_screen_lib.bsl.hh.
References exp2, layer, log2, raytrace_sample_screen(), saturate, textureLod(), ScreenTraceHitData::time, ScreenTraceHitData::v_hit_P, float4::w, and ViewMatrices::winmat.
| ScreenTraceHitData raytrace_screen | ( | ViewMatrices | view, |
| RayTraceData | rt_data, | ||
| HiZData | hiz_data, | ||
| sampler2D | hiz_tx, | ||
| float | stride_rand, | ||
| float | roughness, | ||
| const bool | allow_self_intersection, | ||
| Ray | ray ) |
Ray-trace against the given HIZ-buffer height-field.
| stride_rand | Random number in [0..1] range. Offset along the ray to avoid banding artifact when steps are too large. |
| roughness | Determine how lower depth mipmaps are used to make the tracing faster. Lower roughness will use lower mipmaps. |
| allow_self_intersection | If false, ray-trace will return false if the ray is not covering at least one pixel. |
| ray | View-space ray. Direction pre-multiplied by maximum length. |
Definition at line 61 of file eevee_ray_trace_screen_lib.bsl.hh.
References ScreenSpaceRay::create(), ViewMatrices::depth_screen_to_view(), ViewMatrices::depth_view_to_screen(), Ray::direction, ScreenSpaceRay::direction, float, floor, ScreenThicknessEstimator::init(), ScreenThicknessEstimator::intersect(), length(), log2, max, ScreenSpaceRay::max_time, min, mix, Ray::origin, ScreenSpaceRay::origin, ViewMatrices::point_screen_to_view(), ViewMatrices::point_screen_to_world(), raytrace_clip_ray_to_near_plane(), raytrace_screen(), saturate, ScreenSpaceRay::screen_position_at(), sqrt_fast(), textureLod(), ScreenTraceHitData::time, ScreenTraceHitData::valid, ViewMatrices::winmat, float3::z, and packed_float3::z.
Referenced by raytrace_screen(), and eevee::raytrace::screen::trace().
| float raytrace_screen_2 | ( | ViewMatrices | view, |
| const float3 | vs_origin, | ||
| const float3 | vs_end, | ||
| const float3 | vs_direction, | ||
| sampler2D | depth_tx, | ||
| const RayTraceData | rt_data, | ||
| const int | max_steps, | ||
| const float | jitter, | ||
| usampler2D | ob_id_tx, | ||
| const uint | object_id, | ||
| float2 & | r_hit_uv ) |
Definition at line 284 of file eevee_ray_trace_screen_lib.bsl.hh.
References abs, ViewMatrices::depth_screen_to_view(), dot(), fract(), ScreenThicknessEstimator::init(), max, min, mix, ViewMatrices::point_screen_to_view(), ViewMatrices::point_view_to_screen(), raytrace_screen_2(), reverse_z::read(), round, step, texelFetch(), textureGather(), textureSize(), ScreenThicknessEstimator::thickness(), float4::w, float2::x, float4::x, float2::y, float4::y, float3::z, and float4::z.
Referenced by raycast_eval(), and raytrace_screen_2().
Definition at line 212 of file eevee_ray_trace_screen_lib.bsl.hh.
References bxdf_ggx_ray_amend_transmission(), bxdf_translucent_ray_amend(), CLOSURE_BSDF_DIFFUSE_ID, CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID, CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID, CLOSURE_BSDF_TRANSLUCENT_ID, CLOSURE_BSSRDF_BURLEY_ID, CLOSURE_NONE_ID, raytrace_thickness_ray_amend(), and V.
Referenced by raytrace_thickness_ray_amend(), eevee::raytrace::fallback::trace(), and eevee::raytrace::screen::trace().