Skip to content

Commit

Permalink
Fixed G Norm
Browse files Browse the repository at this point in the history
  • Loading branch information
codeplay9800 committed Nov 1, 2021
1 parent d7983e1 commit 5fe7777
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/shaders/deferred.frag.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ export default function(params) {
void main() {
// TODO: extract data from g buffers and do lighting
vec4 gbPos = texture2D(u_gbuffers[0], v_uv);
vec4 gbNor = texture2D(u_gbuffers[1], v_uv);
vec4 gNor = texture2D(u_gbuffers[1], v_uv);
vec4 gbNor = vec4(oct_to_float32x3(vec2(gNor.x, gNor.y)), 1.0);
vec4 albedo = texture2D(u_gbuffers[2], v_uv);
vec3 fragColor = vec3(0.0);
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/deferredToTexture.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void main() {

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

0 comments on commit 5fe7777

Please sign in to comment.