1
\$\begingroup\$

Wich is a reasonable GL version that have support for vertex textures fetchs(VTF) in OpenGL ? (for example GL 3.0, 3.1, 3.3) What textures formats should I expect to be supported in average video cards when doing such vertex fetch.

Is that possible with GL ES 2?

\$\endgroup\$
1
\$\begingroup\$

It is technically possible with OpenGL ES 2 but almost no device currently support it. You'll have to check GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS on devices.

For small "textures" you can use a small array of uniforms.

A lot of (old) desktop video cards still in use only supports GL_LUMINANCE32F_ARB and GL_RGBA32F_ARB or don't support any VTF at all.

If you are going to need large table lookups to generate vertices on OpenGLES I recommend doing it on the CPU directly using multiple vertex buffer objects:

  • One for the static data.
  • One for that data that needs to be updated by the CPU frequently.

This will minimize memory transfers.

With proper code CPUs on mobile are generally fast enough and in some cases faster than the GPU to process complex vertex shaders. Using the GPU is generally better because it runs in parallel while the CPU is doing other things but if the CPU is idle anyway then there's no loss and can gain by better balancing the CPU<->GPU loads.

Some examples can be found on Apple's dev site (https://developer.apple.com/library/ios/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesforWorkingwithVertexData/TechniquesforWorkingwithVertexData.html) or just google.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ thanks, I was fearing something similiar, that's a pity especially because I can't do displacement mapping with a render target :/. well I can but using only 128bit texture and that will not be supported widely :( \$\endgroup\$ – CoffeDeveloper Jan 10 '15 at 23:50
  • \$\begingroup\$ It depends what your minimum desktop GPU is for your project, your target market. \$\endgroup\$ – Stephane Hockenhull Jan 12 '15 at 4:55
  • \$\begingroup\$ well, the market that include my 5 years old laptop :D. I have Gl 3.X just thanks to driver upgrades (else it was Gl 2.1). \$\endgroup\$ – CoffeDeveloper Jan 12 '15 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.