Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7815585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:34:02+00:00 2026-06-02T05:34:02+00:00

On most Android devices, should I expect a performance increase if I do all

  • 0

On most Android devices, should I expect a performance increase if I do all my OpenGL vertex calculations/rendering in Integers instead of Floats?

I recently switched from using an OpenGL viewport of 0:width, 0:height instead of -1:1, -1:1, so I can get away with converting all my drawing calculations/buffers to Ints instead of Floats if it is desirable for performance.

For example, if I do many of the following type of calculations and rendering in my app.

float x1 = someFloatCalculation(foo);
float x2 = someFloatCalculation(bar);
float y1 = someOtherFloatCalculation(foo);
float y2 = someOtherFloatCalculation(bar);
// the float buffer for the coordinates
FloatBuffer buf = makeFloatBuffer(new float[] { x1, y1, x2, y1, x1,
                                                y2, x2, y2 });
gl.glVertexPointer(2, GL10.GL_FLOAT, 0, buf);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);

Could this be sped up by changing to something like

int x1 = someIntCalculation(foo);
int x2 = someIntCalculation(bar);
int y1 = someOtherIntCalculation(foo);
int y2 = someOtherIntCalculation(bar);
// the float buffer for the coordinates
IntBuffer buf = makeIntBuffer(new int[] { x1, y1, x2, y1, x1,
                                            y2, x2, y2 });
// GL10.GL_INT is not an existing GL10 constant.  What to use instead?
gl.glVertexPointer(2, ???GL10.GL_INT???, 0, buf);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);

Note that the calculations would be completely equivalent in the two examples, except that the latter versions would simply round the result to the nearest int.

A related question is whether I would loose any smoothness in my rendering by doing this rounding, if my viewport is from 0 to width and 0 to height (in pixels). That is, if I draw a line with float values, would OpenGL’s “rounding” of a float to the nearest pixel have similar results as rounding to the nearest int and then rendering?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:34:03+00:00Added an answer on June 2, 2026 at 5:34 am

    On most Android devices, should I expect a performance increase if I do all my OpenGL vertex calculations/rendering in Integers instead of Floats?

    No, you will see no difference. GPU is made for floating point crunching. What most likely happens is that your ints are converted to floats before they are even uploaded to GPU. The integer functions are there for convenience, but it’s all floating point on the rendering side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand most Android devices have a 16mb limit (24mb on Nexus One) on
I have played for a while with OpenGL on Android on various devices. And
I downloaded the most recent version of Android for Linux (android-sdk_r05-linux_86.tgz). I was trying
An android app I'm working on relies on a web page for most of
Is Android 2.2 supports Carousel view? Because most of the examples I came across
What is the most efficient way to port an iPhone app to Android? I
I am studying how the android.speech package works and I noticed that most of
I am currently writing my first Android app and have based most of my
Android docs indicate: The order in terms of verbosity, from least to most is
I build PHP for android using the NDK. Most functions tested so far run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.