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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:36:29+00:00 2026-06-09T03:36:29+00:00

This happens on GLKit with MonoTouch 5.3, but I think the problem may be

  • 0

This happens on GLKit with MonoTouch 5.3, but I think the problem may be of general OpenGL ES 2.0 nature.

I have three faces, one of them red, one green and one blue, all with an alpha value of 1.0, so they should be opaque. When they are rendered on the black background, everything is okay. If the green face is in front of the others, everything is okay as well. But if

  • the red face is in front of the green
  • or the blue face is in front of one of the others

the foreground color is not rendered, but the background face is fully visible. This seems to be some kind of blending effect, but I don’t see anything special in my code, and I have tried out several things like glBlendFunc, but it didn’t change anything.

I could post my code, but since the code is quite simple, I thought perhaps someone knows the answer immediately.

Update: As this seems to be a Depth-Sorting issue, here are some important parts of the code:

        var aContext = new EAGLContext(EAGLRenderingAPI.OpenGLES2);
        var view = this.View as GLKView;
        view.Delegate = new GenericGLKViewDelegate(this);
        view.Context = aContext;

        view.DrawableColorFormat = GLKViewDrawableColorFormat.RGBA8888;
        view.DrawableDepthFormat = GLKViewDrawableDepthFormat.Format16;
        view.DrawableMultisample = GLKViewDrawableMultisample.Sample4x;

here is the DrawInRect method:

        _baseEffect.PrepareToDraw();

        GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

        GL.EnableVertexAttribArray((int)GLKVertexAttrib.Position);
        GL.EnableVertexAttribArray((int)GLKVertexAttrib.Color);

        GL.VertexAttribPointer((int)GLKVertexAttrib.Position, 3, VertexAttribPointerType.Float, false, 0, _squareVertices);
        GL.VertexAttribPointer((int)GLKVertexAttrib.Color, 4, VertexAttribPointerType.UnsignedByte, true, 0, _squareColors);

        GL.DrawArrays(BeginMode.TriangleStrip, 0, 9);

        GL.DisableVertexAttribArray((int)GLKVertexAttrib.Position);
        GL.DisableVertexAttribArray((int)GLKVertexAttrib.Color);

I tried every possible combination of ColorFormat, DepthFormat and Multisample, but it’s still the same.

Solution:

I was missing some calls to enable the depth buffer, these calls were missing in the ViewDidLoad method:

        GL.ClearDepth(30);
        GL.Enable(EnableCap.DepthTest);
        GL.DepthFunc(DepthFunction.Lequal);
  • 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-09T03:36:32+00:00Added an answer on June 9, 2026 at 3:36 am

    This does not sound like a blending issue- rather a depth-sorting issue.

    Is the depth buffer enabled? Are you clearing it with each frame?

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

Sidebar

Related Questions

I have /** * This happens when the user is logged in. */ but
I have no idea why this happens, but after clicking #btnAdd for the third
This happens only sometimes, but makes my files unreadable. The problem is that the
So this happens to me regularly, where i have gems that are installed but
I am authenticating users in ldap, but this happens only once, when user is
This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you
This happens in Firefox, but not in Google Chrome. I create an SVG 'Image'
This happens to me all the time: I have a file open in emacs,
Can someone explain to me why this happens? I have a file called profile.php
Problem: When I use an auto-incrementing primary key in my database, this happens all

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.