Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualC0lumbo

Posted 12 December 2012 - 03:06 PM

My rule of thumb is:

lowp for colours.
mediump for normals and UVs.
highp for positions.

You can lookup the ranges and precisions in the spec, you shouldn't be surprised that lowp is no good for UVs since the range is only -2 to 2, and the precision is too low to represent a large (256+) sized texture to texel accuracy (IIRC).

It's difficult to test your chosen precision produces correct results, because the compiler is always free to give you a higher precision than the one you request, so you just have to test on the various different types of hardware.

In general, I wouldn't expect that increasing precision would improve performance, but there's always edge cases. For instance, lowp UVs have to be converted upwards when you pass them into sampler functions and conversions carry a small penalty - this may explain it since iOS is very sensitive to pixel shader performance. Also, I seem to remember an issue of severe performance problems if your vertex shader output precisions mismatch with their corresponding pixel shader input precisions.

#2C0lumbo

Posted 12 December 2012 - 03:05 PM

My rule of thumb is:

lowp for colours.
mediump for normals and UVs.
highp for positions.

You can lookup the ranges and precisions in the spec, you shouldn't be surprised that lowp is no good for UVs since the range is only -2 to 2, and the precision is too low to represent a large (256+) sized texture to texel accuracy (IIRC).

It's difficult to test your chosen precision produces correct results, because the compiler is always free to give you a higher precision than the one you request, so you just have to test on the various different types of hardware.

In general, I wouldn't expect that increasing precision would improve performance, but there's always edge cases. For instance, lowp UVs have to be converted upwards when you pass them into sampler functions - this may explain it since iOS is very sensitive to pixel shader performance. Also, I seem to remember an issue of severe performance problems if your vertex shader output precisions mismatch with their corresponding pixel shader input precisions.

#1C0lumbo

Posted 12 December 2012 - 03:05 PM

My rule of thumb is:

lowp for colours.
mediump for normals and UVs.
highp for positions.

You can lookup the ranges and precisions in the spec, you shouldn't be surprised that lowp is no good for UVs since the range is only -2 to 2, and the precision is too low to represent a large (256+) sized texture to texel accuracy.

It's difficult to test your chosen precision produces correct results, because the compiler is always free to give you a higher precision than the one you request, so you just have to test on the various different types of hardware.

In general, I wouldn't expect that increasing precision would improve performance, but there's always edge cases. For instance, lowp UVs have to be converted upwards when you pass them into sampler functions - this may explain it since iOS is very sensitive to pixel shader performance. Also, I seem to remember an issue of severe performance problems if your vertex shader output precisions mismatch with their corresponding pixel shader input precisions.

PARTNERS