Bug 7405 - OpenTK-1.0 Stencil problem
Summary: OpenTK-1.0 Stencil problem
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Dominique Louis
Depends on:
Reported: 2012-09-23 10:24 UTC by fabio.menta@gmail.com
Modified: 2012-11-26 09:56 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

project sample (559.73 KB, application/octet-stream)
2012-09-23 10:24 UTC, fabio.menta@gmail.com
project sample for monodevelop (551.89 KB, application/octet-stream)
2012-09-27 03:08 UTC, fabio.menta@gmail.com
Screenshots of various apps (65.37 KB, application/x-zip-compressed)
2012-11-23 12:36 UTC, dean.ellis
equal and notequal (106.99 KB, image/jpeg)
2012-11-23 13:52 UTC, fabio.menta@gmail.com
Sample Java Application (88.22 KB, application/x-zip-compressed)
2012-11-23 14:50 UTC, dean.ellis
Test for Stencil Test GL_EQUAL (16.72 KB, application/octet-stream)
2012-11-26 07:09 UTC, dean.ellis
Test for Stencil Test GL_NOTEQUAL (16.72 KB, application/octet-stream)
2012-11-26 07:10 UTC, dean.ellis

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description fabio.menta@gmail.com 2012-09-23 10:24:44 UTC
Created attachment 2603 [details]
project sample

When I create a mask and use this for draw in Equal mode, I have a different result (NotEqual).

if I use opentk (openGL 3.0) in windows it's work fine.

ps: in Android I use OpenGL ES 2.0
Comment 1 fabio.menta@gmail.com 2012-09-27 03:08:55 UTC
Created attachment 2632 [details]
project sample for monodevelop
Comment 2 fabio.menta@gmail.com 2012-11-19 04:51:36 UTC
after two months I want know when this bug will fix it.
Comment 3 Dominique Louis 2012-11-19 06:33:15 UTC
Hi Fabio,
  We are just coming to the end of some internal projects, which will give me and few more developers time to really look into fixing this issue. I looked at it when you posted your initial report, but it does not look to be a quick fix, as far as I can tell, hence why it was delayed.

Apologies for the delay in communicating this back to.

Comment 4 dean.ellis 2012-11-23 12:00:21 UTC
Hi Fabio

I re-created the same code in Java as the attached application, oddly we get exactly the same results as we get with Managed code. So I don't think this is a bug in Mono for Android, it looks like an implementation issue on android itself....

I'll re-create a windows sample and check the output on there as well. 

Comment 6 fabio.menta@gmail.com 2012-11-23 12:13:11 UTC
Hi Dean,
In Windows version it work fine but I use OpenGL v3.
When I make my test under android, I tried to invert the enums but I has equal result.
I don't found a workaround for this issue. 

if you will found a workaround for all android os version it will be perfect for me.

Comment 7 dean.ellis 2012-11-23 12:35:47 UTC
I created an OpenTK sample under windows and the StencilFunction of Equal and NotEqual do not appear to change the rendering output at all. I assume this is the behavior you are expecting?

I am attaching screen shots of the various applications to show the differences.
Comment 8 dean.ellis 2012-11-23 12:36:29 UTC
Created attachment 3006 [details]
Screenshots of various apps
Comment 9 dean.ellis 2012-11-23 12:37:45 UTC

Both the MfA and Java apps work the same, the app I wrote for Windows displays differently. Do you have the sample you did for windows so I can test it here?

Comment 10 fabio.menta@gmail.com 2012-11-23 13:51:09 UTC
screenshot of the Android version is correct, but you used the emulator?

I used two devices, an Acer Liquid (GPU Adreno 200) and a tablet samsung galaxy tab 7 (gpu mali 400 mp) and I have the same results.

equal or notequal I see this ...
Comment 11 fabio.menta@gmail.com 2012-11-23 13:52:29 UTC
Created attachment 3007 [details]
equal and notequal
Comment 12 dean.ellis 2012-11-23 14:49:59 UTC
I tested this on a Galaxy S device. I did not test on an emulator as I was using GLES 2.0 and I dont have the Intel HW acceleration setup. 

I'll attach the code for the Java sample so you can test it on your device. 

Oddly the Windows version using OpenTK produced similar results to what came off your devices..
Comment 13 dean.ellis 2012-11-23 14:50:32 UTC
Created attachment 3008 [details]
Sample Java Application
Comment 14 dean.ellis 2012-11-23 14:51:53 UTC
Could I ask you to test the Attached Java application on your devices please and let us know what happens.

LessonOneRenderer.java is the file that you need to edit to change the stencil operation.


Comment 15 fabio.menta@gmail.com 2012-11-23 15:30:57 UTC
how to open this project?
Comment 16 dean.ellis 2012-11-23 16:32:32 UTC
Its an android project. you will need to compile it using the android SDK and ant. 

see this link for more details 


If you havent touched Java before let me know and I will send over 2 .apk files pre-compiled for you to test :)

Comment 17 fabio.menta@gmail.com 2012-11-23 16:51:24 UTC
I can open this project with eclipse?
if you can send me .apk it would be better. :)
Comment 18 dean.ellis 2012-11-26 07:09:56 UTC
Created attachment 3010 [details]
Test for Stencil Test GL_EQUAL
Comment 19 dean.ellis 2012-11-26 07:10:19 UTC
Created attachment 3011 [details]
Test for Stencil Test GL_NOTEQUAL
Comment 20 dean.ellis 2012-11-26 07:15:17 UTC
I added 2 versions of the application. 


They are the same app so you can only install one at a time. but they should allow you to replicate the issue. 

Please let me know how it turns out, If the Java applications do not show the correct results I think that points to a problem with the drivers on the device which are out of our control. 

On my Galaxy S, I get the following 

GL_EQUAL.apk => A small Triangle which is the bottom left of the main large triangle.

GL_EQUAL.apk => A Large triangle with the area of the small Triangle from the previous sample cut out.
Comment 21 fabio.menta@gmail.com 2012-11-26 09:48:13 UTC
I have some result, a Large triangle with the area of the small Triangle from the
previous sample cut out.

Ok, I understand, this is not mono android bug.

Thank you for your time