Skip to content

Commit

Permalink
store gbuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Scoutydren committed Nov 1, 2021
1 parent 3532e2b commit 38e6120
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/shaders/deferredToTexture.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ vec3 applyNormalMap(vec3 geomnor, vec3 normap) {
}

void main() {
vec3 norm = applyNormalMap(v_normal, vec3(texture2D(u_normap, v_uv)));
vec3 norm = normalize(applyNormalMap(v_normal, vec3(texture2D(u_normap, v_uv))));
vec3 col = vec3(texture2D(u_colmap, v_uv));

// TODO: populate your g buffer
// gl_FragData[0] = ??
// gl_FragData[1] = ??
// gl_FragData[2] = ??
// gl_FragData[3] = ??
}
gl_FragData[0] = vec4(col.xyz, 0.0);
gl_FragData[1] = vec4(norm.xyz, 0.0);
gl_FragData[2] = vec4(v_position.xyz, 0.0);
}

0 comments on commit 38e6120

Please sign in to comment.