PurpleKingdomGames / ultraviolet

Scala 3 to GLSL transpiler library
https://ultraviolet.indigoengine.io/
MIT License
59 stars 2 forks source link

Bug Swizzles not working correctly with bracketed values #96

Open davesmith00000 opened 1 year ago

davesmith00000 commented 1 year ago

Example that does not compile correctly:

def foo(uv: vec2, p: vec2): Float =
  val v = (uv - (p - vec2(0.0f, 0.5f))).y
  v

But you can fix it by doing something like:

def foo(uv: vec2, p: vec2): Float =
  val v = uv - (p - vec2(0.0f, 0.5f))
  v.y