ebiten
ebiten copied to clipboard
internal/shader: support complex numbers
Inspired by https://twitter.com/seanbax/status/1286018968172494849
I'll have an attempt at this but as there's no milestone attached maybe not
As glsl has no complex number support we can resolve i to sqrt(-1) in place. Additionally, as structs aren't implemented yet (I believe) we can just create two floats per complex number 0real & 0imag, 1real & 1imag, xreal & ximag...
This issue indicates about Go's constant number. No matter what the calculation process is, it is fine as long as the result is a real number: e.g., var foo [2]vec2; foo[1i-1i]
should work. Another thing is real
and imag
builtin functions.
I don't set the milestone because this is not so important :-)