View Full Version : vec4 = mat4 + vec4
08-05-2006, 06:21 PM
It seams that the following code should work:
vec4 v1, v2;
v2 = m + v1;
This seams strange to me, is anybody able to tell how is working this operator?
08-06-2006, 12:31 PM
The sum of a matrix and a vector does not make sense. Where did you see this code?
Perhaps it's a typo and it should be:
v2 = m * v1;
08-06-2006, 02:04 PM
It isn't a typo problem. glValidate allow this when I did a mistake in a shader writing + instead of *
... It's probably a component wise operator but what does it do? Or a bug...
08-06-2006, 04:24 PM
My version of GLSLvalidate (v1.9) bristles quite fervently when given that nonsense.
ERROR: 0:9: '+' : wrong operand types no operation '+' exists that takes a left-hand operand of type '4X4 matrix of float' and a right operand of type '4-component vector of float' (or there is no acceptable conversion)
ERROR: 0:9: 'assign' : cannot convert from '4X4 matrix of float' to '4-component vector of float'
ERROR: 2 compilation errors. No code generated.It goes on, but it gets pretty nasty. I tried to reason with it, but it's having nothing of it.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.