Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@Georg123
Copy link

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(x_x + y_y + y_y + y_y)

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant