I have a simple question. what are the meaning of :
half4 myHalf; myHalf.yyyy; myHalf.xxzz; // or myHalf.yw
Thanks a lot !
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
It's a simple answer!
half4 is a four component vector, using half precision floating point coordinates. The extensions you've shown are quick ways to create new vectors using the values from
myHalf.yyyy is a four component vector with the values:
(myhalf.y, myhalf.y, myhalf.y, myhalf.y)
myHalf.xxzz is a four component vector with the values:
(myhalf.x, myhalf.x, myhalf.z, myhalf.z)
myHalf.yw is a two component vector with the values: