Skip to content

Commit

Permalink
gl: fix packed yuv rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Sep 28, 2016
1 parent ab48666 commit b0cdeb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/shaders/packed.f.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 36,16 @@ vec4 sample2d(sampler2D tex, vec2 pos, int plane)
void main() {
vec4 c = sample2d(u_Texture0, v_TexCoords0, 0);
c = u_c * c;
#ifndef HAS_ALPHA
c.a = 1.0; // before color mat transform!
#endif //HAS_ALPHA
#ifdef XYZ_GAMMA
c.rgb = pow(c.rgb, vec3(2.6));
#endif // XYZ_GAMMA
c = u_colorMatrix * c;
#ifdef XYZ_GAMMA
c.rgb = pow(c.rgb, vec3(1.0/2.2));
#endif //XYZ_GAMMA
#ifndef HAS_ALPHA
c.a = 1.0;
#endif //HAS_ALPHA
gl_FragColor = clamp(c, 0.0, 1.0) * u_opacity;
/***User post processing here***%userPostProcess%***/
}
2 changes: 1 addition & 1 deletion src/shaders/planar.f.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 97,7 @@ void main()
#endif //USE_RG
#endif //CHANNEL16_TO8
#ifndef HAS_ALPHA
1
1.0
#endif //HAS_ALPHA
)
, 0.0, 1.0) * u_opacity;
Expand Down

0 comments on commit b0cdeb8

Please sign in to comment.