mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
Add comments
This commit is contained in:
parent
99434fa9d3
commit
89c6e7c371
@ -86,7 +86,11 @@ void main(void) {
|
|||||||
vec4 color1 = texture2D(texture1, vertex_out_tex_coord1);
|
vec4 color1 = texture2D(texture1, vertex_out_tex_coord1);
|
||||||
color0 = (color_matrix * color0) + color_matrix_translation;
|
color0 = (color_matrix * color0) + color_matrix_translation;
|
||||||
|
|
||||||
// Photoshop-like RGBA blending
|
// Photoshop-like RGBA blending.
|
||||||
|
//
|
||||||
|
// NOTE: If the textures are alpha premultiplied, this calc would be much simpler,
|
||||||
|
// but the color matrix must be applied to the straight alpha colors.
|
||||||
|
// Thus, straight alpha colors are used in Ebiten.
|
||||||
gl_FragColor.a = color0.a + (1.0 - color0.a) * color1.a;
|
gl_FragColor.a = color0.a + (1.0 - color0.a) * color1.a;
|
||||||
gl_FragColor.rgb = (color0.a * color0.rgb + (1.0 - color0.a) * color1.a * color1.rgb) / gl_FragColor.a;
|
gl_FragColor.rgb = (color0.a * color0.rgb + (1.0 - color0.a) * color1.a * color1.rgb) / gl_FragColor.a;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user