To define default precisions for all floating-point variables, you should use the precision command, for example: from -2.0 to 2.0), thus, lowp is most useful for colors but usually not for positions. Also note that the range of lowp variables can be very limited (e.g. Note that it is up to the compiler and driver to decide which precision is actually used the precision qualifiers are only suggestions by the programmer. (There are only a few exceptions to this, for example accessing individual elements of a lowp vector can be slower than for a mediump vector because it requires additional decoding.) Thus, for best performance you should use the lowest precision that still gives satisfactory results. The idea is that lowp variables require less computation time and less storage (and therefore also less bandwidth) than mediump variables, and mediump variables require less time than highp variables. Lowp vec4 color // for colors, lowp is usually fine mediump vec4 position // for positions and texture coordinates, mediump is usually ok highp vec4 astronomical_position // for some positions and time, highp is necessary //(precision of time measurement decreases over time //and things get jumpy if they rely on absolute time since start of the application)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |