ebiten icon indicating copy to clipboard operation
ebiten copied to clipboard

internal/shader: support complex numbers

Open hajimehoshi opened this issue 4 years ago • 3 comments

Inspired by https://twitter.com/seanbax/status/1286018968172494849

hajimehoshi avatar Aug 13 '20 19:08 hajimehoshi

I'll have an attempt at this but as there's no milestone attached maybe not

tomlister avatar Aug 14 '20 02:08 tomlister

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...

tomlister avatar Aug 14 '20 02:08 tomlister

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 :-)

hajimehoshi avatar Aug 14 '20 03:08 hajimehoshi