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

  • SEARCH
  • Home
  • 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 4242938
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:30:37+00:00 2026-05-21T03:30:37+00:00

I’m writing a 2D OpenGL game for iOS devices. Right now, i’m looking at

  • 0

I’m writing a 2D OpenGL game for iOS devices. Right now, i’m looking at the performance on iPad (first gen). The game has code paths for ogl 1.1 and 2.0, and I can switch which one is being used with a #define.

When using ogl 2.0, the profiler tells me that my Renderer Utilization % is a fairly steady 100%, and my framerate is about 30 fps. When using ogl 1.1, the profiler tells me that my Renderer Utilization % is ~60% and my framerate is 60 fps.

I want to improve the performance with ogl 2.0, and being fill rate limited, I suspected the fragment shader. Here is the fragment shader that was being used:

precision highp float;
uniform vec4 u_color;
uniform sampler2D u_sampler0;
varying vec2 v_texCoord;

void main()
{
    gl_FragColor = u_color * texture2D( u_sampler0, v_texCoord );
}

You can see that the shader is pretty simple. It’s just multiplying the geometry color by the texture color. As an experiment, I removed the multiplication, so that the output color was just the texture color, like this:

precision highp float;
uniform vec4 u_color;
uniform sampler2D u_sampler0;
varying vec2 v_texCoord;

void main()
{
    gl_FragColor = texture2D( u_sampler0, v_texCoord );
}

Profiling the code using this modified shader gave a Renderer Utilization % of ~60% and a framerate of 60fps, the same performance achieved by the ogl 1.1 codepath.

My question:

1) Should a simple Vec4 multiplication in the fragment shader really have this large a negative effect on the performance?

2) I’ve heard it said that on ogl es 2 devices, the 1.1 functionality is implemented with shaders. Obviously these shaders manage to efficiently achieve the effect i’m going for (blending geom color into texture color). How can I efficiently achieve this effect in my ogl 2 shader?

  • 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-05-21T03:30:37+00:00Added an answer on May 21, 2026 at 3:30 am

    The reason your shader is slower than the built-in ES1.1 shaders is that you are multiplying 4 high precision values (Float32), rather than 4 low precision values (fixed point, -2 to 2).

    Change uniform vec4 u_color to uniform lowp vec4 u_color and you should see the same performance as ES 1.1.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
We're building an app, our first using Rails 3, and we're having to build

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.