fde20db7ca
Note that the 2D cross product isn't defined. There are at least two possible interpretations of what that might mean. This name makes it clearer that we're asking for the length of the resulting vector, if we computed the 3D cross product (assuming Z == 0 for both vectors). It also eliminates name overlap between builtin functions and actual intrinsics. Change-Id: I24e8bc0ab2ec91aaace20f0dd3e8565c10bd44a0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484440 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
17 lines
376 B
GLSL
17 lines
376 B
GLSL
|
|
out vec4 sk_FragColor;
|
|
uniform vec2 ah;
|
|
uniform vec2 bh;
|
|
uniform vec2 af;
|
|
uniform vec2 bf;
|
|
float cross_length_2d_hh2h2(vec2 a, vec2 b) {
|
|
return a.x * b.y - a.y * b.x;
|
|
}
|
|
float cross_length_2d_ff2f2(vec2 a, vec2 b) {
|
|
return a.x * b.y - a.y * b.x;
|
|
}
|
|
void main() {
|
|
sk_FragColor.x = cross_length_2d_hh2h2(ah, bh);
|
|
sk_FragColor.y = cross_length_2d_ff2f2(af, bf);
|
|
}
|