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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:48:14+00:00 2026-05-26T06:48:14+00:00

How to create a fill effect? I have an irregular closed shape created using:

  • 0

How to create a fill effect? I have an irregular closed shape created using:

   glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
        (.......) 
   glVertexPointer(2, GL_FLOAT, 0, vertexBuffer);
   glDrawArrays(GL_POINTS, 0, vertexCount);
        (.......) 
   glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);

Now I would like to have an “fill/paint bucket” effect like in photoshop. The background inside the shape is white (for example) and by clicking inside the shape I want to change the color to red or green.

Can somebody give me some hints, please.

enter image description here

  • 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-26T06:48:14+00:00Added an answer on May 26, 2026 at 6:48 am

    So you render a set of points and want OpenGL to “magically” fill the enclosed region. That’s not possible. OpenGL doesn’t realize that these points enclose some region. You don’t even draw a line strip, it’s just a set of points. Even a human has to put in a reasonable effort of thinking to see that the points “enclose” a region, let aside a computer, or just a simple interface for drawing points, lines and triangles onto the screen.

    Instead of drawing points, just draw a polygon (use GL_POLYGON or GL_TRIANGLE_FAN instead of GL_POINTS). But if the enclosed region is non-convex that won’t work in all cases. What you always have to realize is, that OpenGL is nothing more than a drawing API. It just draws points, lines and triangles to screen. Yes, with fancy effects, but all in all it just draws simple primitives. It doesn’t manage any underlying graphics scene or something. The moment a primitive (like a single point, line or triangle) has been drawn, OpenGL doesn’t remember it anymore.

    What you want to achieve (given you at least change the point set to a line loop that really encloses a region), is not to be achieved by simple means. In the simplest case you need some kind of flood fill algorithm that fills the region you enclosed by the lines. But for this you don’t profit from OpenGL in any way, as this requires you to analyse the image on the CPU and set individual pixels. And neither can shaders do this in a simple (or any?) way.

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

Sidebar

Related Questions

I'm using System.Data.OracleClient.OracleCommand to create a table and fill it out with some data.
Context: I have a TableLayout (created using XML), which has one TableRow, which has
I have created rectangle shapes using onDraw method, filled with single colors. Now I
I have been struggling to create a django form which users can fill and
I'm trying to create a starburst effect using the canvas, but the segment lines
I am working on a website: http://homegym.sg/index.php/ Have used jquery to create an effect
I want to do something like: MyObject myObj = GetMyObj(); // Create and fill
I am trying to create a gradient fill for a series in an area
I want to create a frame and fill it with a segmented control. How
I extended JDialog to create a custom dialog where the user must fill some

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.