Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Rendering/Headers/ClipRegion.h

Diff revisions: vs.
  @@ -95,16 +95,29 @@
95 95 }
96 96
97 97 // Returns bounding box [min.xy, max.xy] in clip [-1, 1] space.
98 - vec4<F32> computeClipRegion(const vec3<F32>& lightPosView, F32 lightRadius, F32 cameraNear, const mat4<F32> &projection) {
98 + vec4<F32> computeClipRegion(const vec3<F32>& lightPosView,
99 + F32 lightRadius,
100 + F32 cameraNear,
101 + const mat4<F32> &projection) {
99 102 // Early out with empty rectangle if the light is too far behind the view frustum
100 103 vec4<F32> clipRegion(1.0f, 1.0f, -1.0f, -1.0f);
101 - if (lightPosView.z - lightRadius <= -cameraNear)
102 - {
104 + if (lightPosView.z - lightRadius <= -cameraNear) {
103 105 vec2<F32> clipMin(-1.0f, -1.0f);
104 106 vec2<F32> clipMax(1.0f, 1.0f);
105 107
106 - updateClipRegion(lightPosView.x, lightPosView.z, lightRadius, projection.element(1, 1), clipMin.x, clipMax.x);
107 - updateClipRegion(lightPosView.y, lightPosView.z, lightRadius, projection.element(2, 2), clipMin.y, clipMax.y);
108 + updateClipRegion(lightPosView.x,
109 + lightPosView.z,
110 + lightRadius,
111 + projection.element(1, 1),
112 + clipMin.x,
113 + clipMax.x);
114 +
115 + updateClipRegion(lightPosView.y,
116 + lightPosView.z,
117 + lightRadius,
118 + projection.element(2, 2),
119 + clipMin.y,
120 + clipMax.y);
108 121
109 122 clipRegion.set(clipMin, clipMax);
110 123 }