简体   繁体   中英

tex2Dproj equivalent in Metal iOS

How do you do hardware accelerated texture projection in Metal? I cannot find any reference or resource that describes how to do it.

You just do the divide yourself.

OpenGL:

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

Metal equivilent:

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, more commonly it is 'a')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM