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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:28:51+00:00 2026-06-09T20:28:51+00:00

I am studying OpenGL ES 2.0 shaders from this cool raywenderlich tutorials and I

  • 0

I am studying OpenGL ES 2.0 shaders from this cool raywenderlich tutorials and I was wondering why a Sprite is said to have 4 vertices. Are there cases with more than 4 vertices?

I know it sounds silly, but I was expecting it to have to have as many vertices as required to form the border of the visible part of the sprite. In other words, I thought that the alpha channel was a way to delimit the sprite.

I then checked the bullet collision methods in my game (I used a template to start with it) and they use the sprite bounding box. Box mean four vertices :), so I should not be suprised.
But still, I was expecting Cocos2D to have a way to detect the non visible pixels.

Could anyone help me clarifying this a bit more? Are there more ways to do bullet collision detection that detect only the visible pixels? [I found some answer but wasn’t accepted and it seems to take many steps, I thought there could be a built in Cococs2d method].

Or is this something I will have to figure out after having learnt shaders in OpengGL ES 2.0?

  • 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-09T20:28:52+00:00Added an answer on June 9, 2026 at 8:28 pm

    Sprites are textures displayed on screen, with properties like scaling, rotation, position, color, etc applied to it.

    Textures are rectangles because they’re in-memory images. To draw a rectangle you need 4 vertices. Historically, GPUs only worked with quadractic, power-of-two textures because that was the simplest to implement in hardware. Later textures could be any rectangle and on more modern iOS devices (iPhone 3GS I think) you can also use NPOT texture (non-power of two). But overall, textures are and will always be rectangular.

    To make a texture partially transparent, it has an alpha channel. This acts like one of the 3 RGB channels except it controls how transparent a pixel is. In some texture formats the alpha channel only stores on or off (1-Bit alpha).

    So when the GPU renders the texture to the screen, all pixels with an associated alpha value of 0 are not drawn at all, allowing the background pixels to show through.

    Tracing the visible parts of an image to get the collision polygon requires running a relatively complex algorithm. For example PhysicsEditor employs such a mechanism to generate physics collision information from images (see video at 0:15).

    GPUs don’t use that technique because:

    • the initial tracing is costly
    • the resulting polygon would be complex (100+ vertices)
    • the polygons would greatly vary in complexity depending on the image, which would make it hard to optimize rendering

    Essentially it’s a lot easier and faster to go over the entire texture and not render 0 alpha pixels rather than concentrating on finding, storing and rendering only the visible pixels.

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

Sidebar

Related Questions

While studying Java tutorials, Reflection and Late Binding have confused me. In some tutorials,
I have been studying the Qt Quarterly article about QGraphicsScene and OpenGL for the
I'm studying this code, and there is a + in the color function which
I was trying to use the function glMultiDrawElements while studying OpenGL (using red book)
Studying compilers course, I am left wondering why use registers at all. It is
While studying for a Functional Programming exam, I came across the following questions from
While studying for a Functional Programming exam, I came across the following question from
Just studying the C style of Jon Bentley's Programming Pearls and was wondering if
While studying about JMX, I have seen one of the important feature of it
While studying C# in ASP.net I have trouble understanding several classes. In which scenario

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.