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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:48:54+00:00 2026-05-25T11:48:54+00:00

This is how I turn on ortho projection after drawing 3D objects: glMatrixMode(GL_PROJECTION); glLoadIdentity();

  • 0

This is how I turn on ortho projection after drawing 3D objects:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,Screen_Width,Screen_Height,0,0,1);

And this is how I turn on blending and draw textures in ortho after drawing 3D objects:

glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); 
glColor4f(1,1,1,1);

glBindTexture(GL_TEXTURE_2D,Texture1);
glBegin(GL_QUADS);
//draw 1st quad
glEnd();

glBindTexture(GL_TEXTURE_2D,Texture2);
glBegin(GL_QUADS);
//draw 2nd quad
glEnd();

glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);

Quad1 is a bit larger than Quad2 and covers some parts of Quad2. Both textures have alpha channel as RGBA.

The problem is, Quad1 & Quad2 overlay the 3D objects with alpha correctly, but the alpha of Quad1 doesn’t work when being on top of Quad2. It draws on top of Quad2 like RGB only.

How could I solve this problem?

  • 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-25T11:48:54+00:00Added an answer on May 25, 2026 at 11:48 am

    Is depth buffering enabled? If it is, that could cause fragments to be discarded (failing the Z test) instead of alpha-blended with what’s already there.

    If you’re using a depth buffer, you need to draw transparent objects in back-to-front order.

    For a purely 2D scene, you might not even need a depth buffer, and you can just turn it off:

    glDisable(GL_DEPTH_TEST);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Post has user and date attributes. How can I turn this posts = Post.objects.order_by('-date')[:30]
how can i turn this JSON to a list of objects that have two
It should turn this int Yada (int yada) { return yada; } into this
how would you turn this array: array( 0 => Title1, 1 => Title2, 3
Is there a way to turn this 'feature' off?
Does anyone know how to turn this string: Smith, John R Into this string:
I would like to turn this query to regular inline sql without using stored
With vim how do I to turn this: t.string :crypted_password :null => false t.string
I'm looking for an elegant way to turn this array: Array ( [foo] =>
How do I use regular expressions and search and replace to turn this [UserID]

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.