Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #192 from JuliaPlots/sd/shader-fixes
Browse files Browse the repository at this point in the history
fix missing outputs
  • Loading branch information
SimonDanisch authored May 22, 2021
2 parents 603b151 + 50b9688 commit b87647f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions assets/shader/heatmap.vert
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ uniform uint objectid;
out vec2 o_uv;
flat out uvec2 o_objectid;

out vec4 o_view_pos;
out vec3 o_normal;

ivec2 ind2sub(ivec2 dim, int linearindex){
return ivec2(linearindex % dim.x, linearindex / dim.x);
}

void main(){
//Outputs for ssao, which we don't use for 2d shaders like heatmap/image
o_view_pos = vec4(0);
o_normal = vec3(0);

int index = gl_InstanceID;
vec2 offset = vertices;
ivec2 offseti = ivec2(offset);
Expand Down
8 changes: 7 additions & 1 deletion assets/shader/image.vert
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ in vec2 texturecoordinates;
uniform mat4 projection, view, model;
uniform uint objectid;

out vec2 o_uv;
out vec2 o_uv;
flat out uvec2 o_objectid;

out vec4 o_view_pos;
out vec3 o_normal;

vec4 _position(vec3 p){return vec4(p,1);}
vec4 _position(vec2 p){return vec4(p,0,1);}

void main(){
//Outputs for ssao, which we don't use for 2d shaders like heatmap/image
o_view_pos = vec4(0);
o_normal = vec3(0);
o_uv = texturecoordinates;
o_objectid = uvec2(objectid, gl_VertexID+1);
gl_Position = projection * view * model * _position(vertices);
Expand Down

0 comments on commit b87647f

Please # to comment.