Closed rainyt closed 1 year ago
override function fragment() {
super.fragment();
color.r += 0.3;
color.b += sin(time / 60);
gl_FragColor = color;
}
/Users/grtf/haxelib/vector-math/VectorMath.macro.hx:50: characters 12-13 : Float has no field x
Source/glsl/BitmapGLSL2.hx:10: characters 9-23 : ... Called from macro here
/Users/grtf/haxelib/vector-math/VectorMath.macro.hx:50: characters 12-13 : Float has no field z
Source/glsl/BitmapGLSL2.hx:11: characters 9-34 : ... Called from macro here
/Users/grtf/haxelib/vector-math/VectorMath.macro.hx:50: characters 12-13 : Float has no field x
Source/glsl/BitmapGLSL3.hx:10: characters 9-55 : ... Called from macro here
/Users/grtf/haxelib/vector-math/VectorMath.macro.hx:50: characters 12-13 : Float has no field x
Source/glsl/BitmapGLSL3.hx:11: characters 9-55 : ... Called from macro here
macro {
var self = $self;
self.$f0 = $value;
}
It seems that definitions such as rgba, xyzw, etc. cannot be accessed here. of +=
.
this seems like an hxcpp bug more than a library bug, since it has valid output everywhere else. can it be worked around by adding an extra block/{} in the macro?
Create a pull requestts:https://github.com/haxiomic/vector-math/pull/17
But the problem of += still exists.
// Error: Float has no field w
color.r += 0.3;
Create a pull requestts:#17
But the problem of += still exists.
// Error: Float has no field w color.r += 0.3;
Thanks for reporting, it's helpful to have these examples!
This issue appears to be another form of a haxe compiler bug https://github.com/HaxeFoundation/haxe/issues/10150
The issue seems to occur when using the a.b
overload with operators like +=
. This should be fixed in the compiler, if we're lucky it may be fixed for haxe 4.3
This should be fixed since 4.3! c81180f4d0ce6a97f10cdca90d5a323dd7543e4f
In C++, the problem of repeated attribute definitions occurs. I noticed that it was caused by accessing .a, rbg and other methods: