Skip to content

length, distance, normalize return wrong result for certain vectors. #29

Open
Georg123 opened this Issue May 8, 2013 · 0 comments

1 participant

@Georg123
Georg123 commented May 8, 2013

length() method only works for vec4.

varying vec2 texcoord0;

float l = length(texcoord0);

yields

dp4 ft1.x, v0.xyyy, v0.xyyy
sqt ft1.z, ft1.xxxx

So it calculates
sqrt(xx + yy + yy + yy)

Most likely distance() is also wrong (haven't checked).


varying vec2 texcoord0;

vec2 tc = normalize(texcoord0);

yields

nrm ft1.xy, v0.xyyy

Error #3628: AGAL validation failed: The destination operand for the nrm instruction must mask w (use .xyz or less) at token 2 of fragment program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.