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 6760341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:03:12+00:00 2026-05-26T14:03:12+00:00

I am new to opengl programming, but I am doing something very basic, and

  • 0

I am new to opengl programming, but I am doing something very basic, and the difference of quality between a custom opengl code and cocos2d is huge!

I am trying just to load an image and continuously rotate it every frame. With my code, I get a lot of flickering, sharp edges, while cocos2d has it all nice and smooth.
I’ve set up 4x Multi-Sampling Anti-Aliasing using apple’s recommended code for iOs 4 on my code, and still it looks very bad in comparison to cocos2d without any MSAA.

You can see the differences here:
custom opengl code (with MSAA):
custom opengl code

cocos2D (without MSAA):
cocos2d

Does anyone know what am I missing to be able to achieve such smooth graphics? By looking at cocos2d code, I found some references that linked aliasing to GL_LINEAR. I’ve added GL_LINEAR parameters to my textures just like cocos, but it’s still looking equally bad.

  • 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-26T14:03:13+00:00Added an answer on May 26, 2026 at 2:03 pm

    Anti-aliasing does exactly what the name says: it prevents primitives from assuming aliases, such as a straight (diagonal) line turning into a staircase. Because anti-aliasing usually results in ‘soft’ edges, the term is sometimes used to apply to any algorithmic ‘softening’, but it’s incorrect to do so.

    Assuming your source texture already contains some anti-aliasing to render the curved edges of your car onto a pixel grid (so, if you opened the source PNG or whatever in an art program and zoomed in on the edges you’d see some softness), I think that your code is failing to apply multisampling for whatever reason. If you zoom in and look at the top edge of the roof then check out the transition between the very top of the step one in from the right and the one to its left. The harsh dark colour at the top just spontaneously steps up a pixel. That’s symptomatic of that edge being in the original texture and it being copied out pixel by pixel.

    GL_LINEAR is a filtering parameter that affects how OpenGL answer questions like ‘if the source pixel at (0, 0) is one colour and at (0, 1) is another then what colour is at (0, 0.5)?’ If you apply linear filtering then when you scale your texture above its native size the extra pixels that OpenGL has to invent will be created using a linear combination of the nearest source pixels. If you’d used GL_NEAREST then it’d be the colour of whichever source pixel is nearest. So that’s the difference between textures that scale up to look blurry and low contrast and textures that scale up to look like mosaics with obvious pixels. So it (usually) adds blurriness and softness to the image overall but isn’t really anything to do with anti-aliasing.

    With respect to why you’re not getting anti-aliasing, two possible reasons sprint to mind. You may have some error in your code or you may simply be using a different algorithm from Cocos2D. Apple’s hardware multisampling support arrived only in iOS 4 and Cocos2D predates that so may be sticking to a ‘software’ method (specifically, rendering the whole scene pixel-by-pixel at 4x the size, then getting the GPU to scale it down). The latter would be significantly slower but would prevent the hardware from attempting to optimise the process. One optimisation that some hardware sometimes applies is to multisample only at the edges of geometry (approximately). That obviously wouldn’t benefit you at all.

    Another possibility is that you’re scaling your image down when you draw (though it doesn’t look like it) and Cocos2D is generating mip maps whereas you’re not. Mip maps precompute certain scales of image and work from there when drawing to the screen. Doing it that way allows a more expensive algorithm to be applied and tends to lead to less aliasing.

    Can you post some code?

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

Sidebar

Related Questions

I have two years of experience on iPhone programming but totally new to OpenGL.
I have just began opengl programming in android and i am fairly new to
I'm new to OpenGL and graphics programming in general, though I've always been interested
Apologies if this a newbish question, but I'm new to Mac programming, and thought
I'm new to U/I programming, and I'm trying to get started with OpenGL. When
This is a question about 3D programming in general, but I'm learning OpenGL if
I'm new in iPhone programming but I have a good grounding in Java and
I am new to OpenGL. Wondering if there is any good Scenegraph API/framework for
I'm somewhat new to OpenGL. I've used it for extremely simple stuff like rendering
I'm new to OpenGL. I have written a programm before getting to know OpenGL

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.