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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:20:55+00:00 2026-05-23T07:20:55+00:00

My program uses blending via glBlendFunc(GL_SRC_ALPHA, GL_ONE) to make a pleasent effect when the

  • 0

My program uses blending via glBlendFunc(GL_SRC_ALPHA, GL_ONE) to make a pleasent effect when the background is set to black with clearColor(0,0,0,1). When
the background is set to white with clearColor(1,1,1,1) the screen is blank white. I don’t know how to generate the same trasparency effect on the white background. Suggestions appreciated.

  • 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-23T07:20:55+00:00Added an answer on May 23, 2026 at 7:20 am

    glBlendFunc(GL_SRC_ALPHA, GL_ONE) roughly translates into the following equation (the clamping happens at another place, technically)

    New_Framebuffer_Value :=
        New_Red   := min(1, Incoming_Red   * Incoming_Alpha + Previous_Framebuffer_Red   )
        New_Green := min(1, Incoming_Green * Incoming_Alpha + Previous_Framebuffer_Green )
        New_Blue  := min(1, Incoming_Blue  * Incoming_Alpha + Previous_Framebuffer_Blue  )
    

    However if you cleared to while, the Previous_Framebuffer_{Red,Green,Blue} are already at 1.0 and so all following will be clamped.

    So you need to modulate not only the incoming fragments, but also the previous ones:

    New_Framebuffer_Value :=
        New_Red   := min(1, Incoming_Red   * Incoming_Alpha + Previous_Framebuffer_Red   * ( 1 - Incoming_Alpha ) )
        New_Green := min(1, Incoming_Green * Incoming_Alpha + Previous_Framebuffer_Green * ( 1 - Incoming_Alpha ) )
        New_Blue  := min(1, Incoming_Blue  * Incoming_Alpha + Previous_Framebuffer_Blue  * ( 1 - Incoming_Alpha ) )
    

    which is done by glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)

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

Sidebar

Related Questions

My C# program uses a COM component via an interop assembly. The COM component
My Java program uses ProcessBuilder (with redirectErrorStream set true) and has a loop that
A little background of the program: The program uses a tabbed interface to work
I'm having problems interacting with an HTTPS site via Java. My program uses one
My program uses wx.ProgressDialog to give feedback on a process that is in multiple
My program uses some external programs that i included in the Files folder. In
My program uses sqlite3 plus python. It works fine with python 2.6.2 I moved
If my Perl program uses Perl modules, how will it determine where to find
One of classes in my program uses some third-party library. Library object is a
How do I check how much resources a java program uses? In java it

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.