Blender V5.3
eevee_shadow_tilemap_lib.bsl.hh File Reference

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)

Function Documentation

◆ shadow_coordinate_from_uvs()

ShadowCoordinates shadow_coordinate_from_uvs ( int tilemap_index,
float2 tilemap_uv )

◆ shadow_decompress_grid_offset()

int2 shadow_decompress_grid_offset ( eLightType light_type,
int2 offset_neg,
int2 offset_pos,
int level_relative )

◆ shadow_directional_coordinates()

◆ shadow_directional_coordinates_at_level()

◆ shadow_directional_level()

◆ shadow_directional_level_fractional()

float shadow_directional_level_fractional ( LightData light,
float3 lP )

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().

◆ shadow_punctual_coordinates()

ShadowCoordinates shadow_punctual_coordinates ( LightData light,
float3 lP,
int face_id )

◆ shadow_punctual_face_index_get()

◆ shadow_punctual_face_local_to_local_position()

float3 shadow_punctual_face_local_to_local_position ( int face_id,
float3 fL )

◆ shadow_punctual_level()

int shadow_punctual_level ( LightData light,
float3 lP,
bool is_perspective,
float distance_to_camera,
float film_pixel_radius )

◆ shadow_punctual_level_fractional()

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().

◆ shadow_punctual_local_position_to_face_local()

◆ shadow_punctual_pixel_ratio()

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().

◆ shadow_render_page_index_get()

int shadow_render_page_index_get ( int view_index,
int2 tile_coordinate_in_lod )

◆ shadow_tile_coord()

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().

◆ shadow_tile_coord_in_atlas()

◆ shadow_tile_corner_persp()

float3 shadow_tile_corner_persp ( ShadowTileMapData tilemap,
int2 tile )

◆ shadow_tile_index()

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().

◆ shadow_tile_load()

ShadowSamplingTile shadow_tile_load ( usampler2D tilemaps_tx,
uint2 tile_co,
int tilemap_index )

◆ shadow_tile_offset()

int shadow_tile_offset ( uint2 tile,
int tiles_index,
int lod )

◆ shadow_tilemap_cubeface_bounds()

Pyramid shadow_tilemap_cubeface_bounds ( ShadowTileMapData tilemap,
int2 tile_start,
const int2 extent )

◆ shadow_tilemap_start()

uint2 shadow_tilemap_start ( int tilemap_index)

◆ shadow_viewport_size_get()

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().