Texture lookup in vertex shader behaves differently on iPad device vs iPad simulator - OpenGL ES 2.0

后端 未结 5 1479
刺人心
刺人心 2020-12-31 18:07

I have a vertex shader in which I do a texture lookup to determine gl_Position. I am using this as part of a GPU particle simulation system, where particle positions are sto

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-31 18:55

    I tried this out myself and Texture2D does work on iPad (both device and simulator) under iOS 4.2 when used in the vertex shader.

    My best guess is that you have mip mapping enabled, and that is the problem. I noticed that mip-mapped lookups in the vertex shader using Texture2D work in the simulator but not on the device. You cannot use mip maps with Texture2D in the vertex shader because there is no way for it to select which mip-map level to use. You need to disable mip-mapping for that texture, or use Texture2DLod instead, which supports mip maps.

提交回复
热议问题