IOS equivalent to tex2Dproj

How do you do hardware accelerated textured projection in Metal? I cannot find a link or resource describing how to do this.

+3


source to share


1 answer


You just separate yourself.

Opengl

a = tex2Dproj( texture, texcoord.xyzw )
b = tex2Dproj( texture, texcoord.xyz )

      



Metal equivalent:

a = texture.sample( sampler, texcoord.xy/texcoord.w )
b = texture.sample( sampler, texcoord.xy/texcoord.z )

      

(Choose "a" or "b" depending on the type of projection you are doing, usually "a")

+2


source







All Articles