Cleanup: spelling in comments & code
This commit is contained in:
parent
e64d067c78
commit
3290e25dc4
@ -1248,11 +1248,11 @@ struct ShadowRenderView {
|
|||||||
* Use sign to determine with case we are in.
|
* Use sign to determine with case we are in.
|
||||||
*/
|
*/
|
||||||
float clip_distance_inv;
|
float clip_distance_inv;
|
||||||
/* Viewport to submit the geometry of this tilemap view to. */
|
/** Viewport to submit the geometry of this tile-map view to. */
|
||||||
uint viewport_index;
|
uint viewport_index;
|
||||||
/* True if comming from a sun light shadow. */
|
/** True if coming from a sun light shadow. */
|
||||||
bool32_t is_directionnal;
|
bool32_t is_directional;
|
||||||
/* If directionnal, distance along the negative Z axis of the near clip in view space. */
|
/** If directional, distance along the negative Z axis of the near clip in view space. */
|
||||||
float clip_near;
|
float clip_near;
|
||||||
};
|
};
|
||||||
BLI_STATIC_ASSERT_ALIGN(ShadowRenderView, 16)
|
BLI_STATIC_ASSERT_ALIGN(ShadowRenderView, 16)
|
||||||
|
@ -135,7 +135,7 @@ void main()
|
|||||||
view_infos_buf[view_index].wininv = inverse(winmat);
|
view_infos_buf[view_index].wininv = inverse(winmat);
|
||||||
|
|
||||||
render_view_buf[view_index].viewport_index = viewport_index;
|
render_view_buf[view_index].viewport_index = viewport_index;
|
||||||
render_view_buf[view_index].is_directionnal = !is_cubemap;
|
render_view_buf[view_index].is_directional = !is_cubemap;
|
||||||
render_view_buf[view_index].clip_near = clip_near;
|
render_view_buf[view_index].clip_near = clip_near;
|
||||||
/* Clipping setup. */
|
/* Clipping setup. */
|
||||||
if (tilemap_data.is_area_side) {
|
if (tilemap_data.is_area_side) {
|
||||||
|
@ -115,8 +115,8 @@ void shadow_map_trace_hit_check(inout ShadowMapTracingState state, ShadowTracing
|
|||||||
else {
|
else {
|
||||||
/* Compute current occluder slope and record history for when the ray goes behind a surface. */
|
/* Compute current occluder slope and record history for when the ray goes behind a surface. */
|
||||||
vec2 delta = samp.occluder - state.occluder_history;
|
vec2 delta = samp.occluder - state.occluder_history;
|
||||||
/* Clamping the slope to a mininim avoid light leaking. */
|
/* Clamping the slope to a minimum avoid light leaking. */
|
||||||
/* TODO(fclem): Expose as parameter? */
|
/* TODO(@fclem): Expose as parameter? */
|
||||||
const float min_slope = tan(M_PI * 0.25);
|
const float min_slope = tan(M_PI * 0.25);
|
||||||
state.occluder_slope = max(min_slope, abs(delta.y / delta.x));
|
state.occluder_slope = max(min_slope, abs(delta.y / delta.x));
|
||||||
state.occluder_history = samp.occluder;
|
state.occluder_history = samp.occluder;
|
||||||
|
@ -164,7 +164,7 @@ void shadow_viewport_layer_set(int view_id, int lod)
|
|||||||
|
|
||||||
vec3 shadow_position_vector_get(vec3 view_position, ShadowRenderView view)
|
vec3 shadow_position_vector_get(vec3 view_position, ShadowRenderView view)
|
||||||
{
|
{
|
||||||
if (view.is_directionnal) {
|
if (view.is_directional) {
|
||||||
return vec3(0.0, 0.0, -view_position.z - view.clip_near);
|
return vec3(0.0, 0.0, -view_position.z - view.clip_near);
|
||||||
}
|
}
|
||||||
return view_position;
|
return view_position;
|
||||||
|
Loading…
Reference in New Issue
Block a user