|
Blender V5.3
|
#include "draw_shape.bsl.hh"#include "eevee_light_shared.hh"#include "eevee_shadow_shared.hh"#include "gpu_shader_math_constants.bsl.hh"#include "gpu_shader_math_vector_reduce.bsl.hh"Go to the source code of this file.
Classes | |
| struct | ShadowCoordinates |
Functions | |
| int2 | shadow_viewport_size_get (uint viewport_index) |
Tile-map data | |
| int | shadow_tile_index (int2 tile) |
| uint2 | shadow_tile_coord (int tile_index) |
| uint2 | shadow_tilemap_start (int tilemap_index) |
| uint2 | shadow_tile_coord_in_atlas (uint2 tile, int tilemap_index) |
| int | shadow_tile_offset (uint2 tile, int tiles_index, int lod) |
Load / Store functions. | |
| ShadowSamplingTile | shadow_tile_load (usampler2D tilemaps_tx, uint2 tile_co, int tilemap_index) |
| float | shadow_directional_level_fractional (LightData light, float3 lP) |
| int | shadow_directional_level (LightData light, float3 lP) |
| float | shadow_punctual_pixel_ratio (LightData light, float3 lP, bool is_perspective, float distance_to_camera, float film_pixel_radius) |
| float | shadow_punctual_level_fractional (LightData light, float3 lP, bool is_perspective, float distance_to_camera, float film_pixel_radius) |
| int | shadow_punctual_level (LightData light, float3 lP, bool is_perspective, float distance_to_camera, float film_pixel_radius) |
| ShadowCoordinates | shadow_coordinate_from_uvs (int tilemap_index, float2 tilemap_uv) |
| int2 | shadow_decompress_grid_offset (eLightType light_type, int2 offset_neg, int2 offset_pos, int level_relative) |
| ShadowCoordinates | shadow_directional_coordinates_at_level (LightData light, float3 lP, int level) |
| ShadowCoordinates | shadow_directional_coordinates (LightData light, float3 lP) |
| float3 | shadow_punctual_local_position_to_face_local (int face_id, float3 lL) |
| float3 | shadow_punctual_face_local_to_local_position (int face_id, float3 fL) |
| int | shadow_punctual_face_index_get (float3 lL) |
| ShadowCoordinates | shadow_punctual_coordinates (LightData light, float3 lP, int face_id) |
Frustum shapes. | |
| float3 | shadow_tile_corner_persp (ShadowTileMapData tilemap, int2 tile) |
| Pyramid | shadow_tilemap_cubeface_bounds (ShadowTileMapData tilemap, int2 tile_start, const int2 extent) |
Render map layout. | |
Since a view can cover at most the number of tile contained in LOD0, index every LOD like they were LOD0. | |
| int | shadow_render_page_index_get (int view_index, int2 tile_coordinate_in_lod) |
| ShadowCoordinates shadow_coordinate_from_uvs | ( | int | tilemap_index, |
| float2 | tilemap_uv ) |
Definition at line 255 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_coordinate_from_uvs().
Referenced by shadow_coordinate_from_uvs(), shadow_directional_coordinates_at_level(), and shadow_punctual_coordinates().
| int2 shadow_decompress_grid_offset | ( | eLightType | light_type, |
| int2 | offset_neg, | ||
| int2 | offset_pos, | ||
| int | level_relative ) |
Definition at line 265 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_decompress_grid_offset().
Referenced by shadow_decompress_grid_offset(), and shadow_directional_coordinates_at_level().
| ShadowCoordinates shadow_directional_coordinates | ( | LightData | light, |
| float3 | lP ) |
lP shading point position in light space (shadow_world_to_local(light, P)).
Definition at line 302 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_directional_coordinates(), shadow_directional_coordinates_at_level(), and shadow_directional_level().
Referenced by eevee::ShadowDebug::debug_coord_get(), eevee::ShadowRenderData::directional_sample_get(), eevee_test_shadows(), shadow_directional_coordinates(), and eevee::shadow_map_trace_sample().
| ShadowCoordinates shadow_directional_coordinates_at_level | ( | LightData | light, |
| float3 | lP, | ||
| int | level ) |
lP shading point position in light space (shadow_world_to_local(light, P)).
Definition at line 279 of file eevee_shadow_tilemap_lib.bsl.hh.
References exp2, float, saturate, shadow_coordinate_from_uvs(), shadow_decompress_grid_offset(), and shadow_directional_coordinates_at_level().
Referenced by shadow_directional_coordinates(), shadow_directional_coordinates_at_level(), eevee::shadow::usage::TagUsage::shadow_tag_usage_tilemap_directional(), and eevee::shadow::usage::TagUsage::tag_usage_tilemap_directional_at_level().
| int shadow_directional_level | ( | LightData | light, |
| float3 | lP ) |
Definition at line 182 of file eevee_shadow_tilemap_lib.bsl.hh.
References ceil, shadow_directional_level(), and shadow_directional_level_fractional().
Referenced by eevee_test_shadows(), shadow_directional_coordinates(), shadow_directional_level(), and eevee::shadow::usage::TagUsage::shadow_tag_usage_tilemap_directional().
This function should be the inverse of ShadowDirectional::coverage_get().
lP shading point position in light space, relative to the to camera position snapped to the smallest clip-map level (shadow_world_to_local(light, P) - light_position_get(light)).
Definition at line 156 of file eevee_shadow_tilemap_lib.bsl.hh.
References clamp(), exp2, float, length(), LIGHT_SUN, log2, max, and shadow_directional_level_fractional().
Referenced by shadow_directional_level(), and shadow_directional_level_fractional().
| ShadowCoordinates shadow_punctual_coordinates | ( | LightData | light, |
| float3 | lP, | ||
| int | face_id ) |
lP shading point position in face local space (world unit). face_id is the one used to rotate lP using shadow_punctual_local_position_to_face_local().
Definition at line 363 of file eevee_shadow_tilemap_lib.bsl.hh.
References abs, saturate, shadow_coordinate_from_uvs(), shadow_punctual_coordinates(), and float3::z.
Referenced by eevee::ShadowDebug::debug_coord_get(), eevee::ShadowRenderData::punctual_sample_get(), eevee::shadow_map_trace_sample(), shadow_punctual_coordinates(), and eevee::shadow::usage::TagUsage::tag_usage_tilemap_punctual().
| int shadow_punctual_face_index_get | ( | float3 | lL | ) |
Definition at line 347 of file eevee_shadow_tilemap_lib.bsl.hh.
References abs, all(), greaterThan, shadow_punctual_face_index_get(), float3::x, float3::y, and float3::z.
Referenced by eevee::ShadowDebug::debug_coord_get(), eevee::ShadowRenderData::punctual_sample_get(), eevee::shadow_map_trace_sample(), shadow_punctual_face_index_get(), and eevee::shadow::usage::TagUsage::tag_usage_tilemap_punctual().
Definition at line 327 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_punctual_face_local_to_local_position(), float3::x, float3::y, and float3::z.
Referenced by shadow_punctual_face_local_to_local_position().
| int shadow_punctual_level | ( | LightData | light, |
| float3 | lP, | ||
| bool | is_perspective, | ||
| float | distance_to_camera, | ||
| float | film_pixel_radius ) |
Definition at line 234 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_punctual_level(), and shadow_punctual_level_fractional().
Referenced by shadow_punctual_level(), and eevee::shadow::usage::TagUsage::tag_usage_tilemap_punctual().
| float shadow_punctual_level_fractional | ( | LightData | light, |
| float3 | lP, | ||
| bool | is_perspective, | ||
| float | distance_to_camera, | ||
| float | film_pixel_radius ) |
Returns the LOD for a given shadow space position. distance_to_camera is Z distance to the camera origin.
Definition at line 223 of file eevee_shadow_tilemap_lib.bsl.hh.
References clamp(), log2, shadow_punctual_level_fractional(), and shadow_punctual_pixel_ratio().
Referenced by shadow_punctual_level(), and shadow_punctual_level_fractional().
Definition at line 309 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_punctual_local_position_to_face_local(), float3::x, float3::y, and float3::z.
Referenced by eevee::ShadowDebug::debug_coord_get(), eevee::ShadowRenderData::punctual_sample_get(), eevee::shadow_map_trace_sample(), shadow_punctual_local_position_to_face_local(), and eevee::shadow::usage::TagUsage::tag_usage_tilemap_punctual().
| float shadow_punctual_pixel_ratio | ( | LightData | light, |
| float3 | lP, | ||
| bool | is_perspective, | ||
| float | distance_to_camera, | ||
| float | film_pixel_radius ) |
Returns the ratio of radius between shadow map pixels and screen pixels. distance_to_camera is Z distance to the camera origin.
Definition at line 193 of file eevee_shadow_tilemap_lib.bsl.hh.
References abs, exp2, M_SQRT2, max, reduce_max(), saturate, and shadow_punctual_pixel_ratio().
Referenced by shadow_punctual_level_fractional(), shadow_punctual_pixel_ratio(), and eevee::shadow_texel_radius_at_position().
| int shadow_render_page_index_get | ( | int | view_index, |
| int2 | tile_coordinate_in_lod ) |
Definition at line 407 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_render_page_index_get(), int2::x, and int2::y.
Referenced by eevee::shadow::rendermap_finalize_main(), shadow_render_page_index_get(), and eevee::surf_shadow().
| uint2 shadow_tile_coord | ( | int | tile_index | ) |
Definition at line 32 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_tile_coord(), and tile_index.
Referenced by shadow_tile_coord().
Definition at line 44 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_tile_coord_in_atlas(), shadow_tilemap_start(), and tile.
Referenced by eevee::debug_tilemaps(), eevee::AmendCtx::eval_directional(), shadow_tile_coord_in_atlas(), shadow_tile_load(), and eevee::shadow::tilemap_finalize_main().
Definition at line 379 of file eevee_shadow_tilemap_lib.bsl.hh.
References float, shadow_tile_corner_persp(), and tile.
Referenced by shadow_tile_corner_persp(), and shadow_tilemap_cubeface_bounds().
| int shadow_tile_index | ( | int2 | tile | ) |
Definition at line 27 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_tile_index(), and tile.
Referenced by shadow_tile_index().
| ShadowSamplingTile shadow_tile_load | ( | usampler2D | tilemaps_tx, |
| uint2 | tile_co, | ||
| int | tilemap_index ) |
Definition at line 109 of file eevee_shadow_tilemap_lib.bsl.hh.
References clamp(), shadow_tile_coord_in_atlas(), shadow_tile_load(), and texelFetch().
Referenced by eevee::ShadowRenderData::read_depth(), eevee::ShadowDebug::shadow_tile_data_get(), and shadow_tile_load().
| int shadow_tile_offset | ( | uint2 | tile, |
| int | tiles_index, | ||
| int | lod ) |
Return tile index inside tiles_buf for a given tile coordinate inside a specific LOD. tiles_index should be ShadowTileMapData.tiles_index.
Definition at line 53 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_tile_offset(), and tile.
Referenced by eevee::debug_tile_state(), eevee::debug_tilemaps(), eevee::shadow::mask(), eevee::shadow::rendermap_finalize_main(), shadow_tile_offset(), eevee::shadow::shadow_tile_offset_lds(), eevee::shadow::tag_propagate(), eevee::shadow::tag_update_frag(), eevee::shadow::usage::TagUsage::tag_usage_tile(), eevee::shadow::tilemap_finalize_main(), and eevee::shadow::tilemap_init_main().
| Pyramid shadow_tilemap_cubeface_bounds | ( | ShadowTileMapData | tilemap, |
| int2 | tile_start, | ||
| const int2 | extent ) |
Definition at line 385 of file eevee_shadow_tilemap_lib.bsl.hh.
References Pyramid::corners, shadow_tile_corner_persp(), shadow_tilemap_cubeface_bounds(), int2::x, and int2::y.
Referenced by shadow_tilemap_cubeface_bounds().
| uint2 shadow_tilemap_start | ( | int | tilemap_index | ) |
Definition at line 38 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_tilemap_start().
Referenced by shadow_tile_coord_in_atlas(), and shadow_tilemap_start().
| int2 shadow_viewport_size_get | ( | uint | viewport_index | ) |
Select the smallest viewport that can contain the given rectangle of tiles to render. Returns the viewport size in tile.
Definition at line 17 of file eevee_shadow_tilemap_lib.bsl.hh.
References shadow_viewport_size_get(), and viewport_index.
Referenced by eevee::shadow::rendermap_finalize_main(), shadow_viewport_size_get(), and eevee::shadow::tilemap_finalize_main().