DRW: Remove screen_vecs
These were only a normalized copy of the XY axes of the inverse viewmat. But since the viewmatrix is always normalized we can use it directly.
This commit is contained in:
@@ -15,7 +15,6 @@ layout(std140) uniform probe_block
|
||||
};
|
||||
|
||||
uniform float sphere_size;
|
||||
uniform vec3 screen_vecs[2];
|
||||
|
||||
flat out int pid;
|
||||
out vec2 quadCoord;
|
||||
@@ -36,7 +35,8 @@ void main()
|
||||
quadCoord = pos[vert_id];
|
||||
|
||||
vec3 ws_location = probes_data[pid].position_type.xyz;
|
||||
vec3 screen_pos = screen_vecs[0] * quadCoord.x + screen_vecs[1] * quadCoord.y;
|
||||
vec3 screen_pos = ViewMatrixInverse[0].xyz * quadCoord.x +
|
||||
ViewMatrixInverse[1].xyz * quadCoord.y;
|
||||
ws_location += screen_pos * sphere_size;
|
||||
|
||||
gl_Position = ProjectionMatrix * (ViewMatrix * vec4(ws_location, 1.0));
|
||||
|
||||
@@ -8,7 +8,6 @@ uniform vec3 corner;
|
||||
uniform vec3 increment_x;
|
||||
uniform vec3 increment_y;
|
||||
uniform vec3 increment_z;
|
||||
uniform vec3 screen_vecs[2];
|
||||
|
||||
flat out int cellOffset;
|
||||
out vec2 quadCoord;
|
||||
@@ -39,7 +38,8 @@ void main()
|
||||
increment_z * ls_cell_location.z);
|
||||
|
||||
quadCoord = pos[vert_id];
|
||||
vec3 screen_pos = screen_vecs[0] * quadCoord.x + screen_vecs[1] * quadCoord.y;
|
||||
vec3 screen_pos = ViewMatrixInverse[0].xyz * quadCoord.x +
|
||||
ViewMatrixInverse[1].xyz * quadCoord.y;
|
||||
ws_cell_location += screen_pos * sphere_size;
|
||||
|
||||
gl_Position = ProjectionMatrix * (ViewMatrix * vec4(ws_cell_location, 1.0));
|
||||
|
||||
Reference in New Issue
Block a user