Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-07-10 15:46:36 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-10 16:31:34 +0300
commit97f90d48a02eef89949532b166f57ea178ee5a87 (patch)
tree5bc806cb89adc71a6a93827b494b211b1aaaf3e8 /source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl
parentc90a0d5dda535a42697503e130b0c2fc123fe491 (diff)
Object Mode: Change Lightprobe display.
Diffstat (limited to 'source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl')
-rw-r--r--source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl b/source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl
index d9616076dbf..bcdf5adca55 100644
--- a/source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl
+++ b/source/blender/draw/modes/shaders/object_lightprobe_grid_vert.glsl
@@ -1,7 +1,4 @@
-in vec3 pos;
-in vec3 nor;
-
uniform mat4 ViewProjectionMatrix;
uniform float sphere_size;
@@ -10,6 +7,7 @@ uniform vec3 corner;
uniform vec3 increment_x;
uniform vec3 increment_y;
uniform vec3 increment_z;
+uniform vec3 screen_vecs[2];
uniform int call_id; /* we don't want the builtin callId which would be 0. */
uniform int baseId;
@@ -20,16 +18,17 @@ void main()
{
vec3 ls_cell_location;
/* Keep in sync with update_irradiance_probe */
- ls_cell_location.z = float(gl_InstanceID % grid_resolution.z);
- ls_cell_location.y = float((gl_InstanceID / grid_resolution.z) % grid_resolution.y);
- ls_cell_location.x = float(gl_InstanceID / (grid_resolution.z * grid_resolution.y));
+ ls_cell_location.z = float(gl_VertexID % grid_resolution.z);
+ ls_cell_location.y = float((gl_VertexID / grid_resolution.z) % grid_resolution.y);
+ ls_cell_location.x = float(gl_VertexID / (grid_resolution.z * grid_resolution.y));
vec3 ws_cell_location = corner +
(increment_x * ls_cell_location.x +
increment_y * ls_cell_location.y +
increment_z * ls_cell_location.z);
- gl_Position = ViewProjectionMatrix * vec4(pos * 0.02 * sphere_size + ws_cell_location, 1.0);
+ gl_Position = ViewProjectionMatrix * vec4(ws_cell_location, 1.0);
+ gl_PointSize = 2.0f;
finalId = uint(baseId + call_id);
}