Jump to content
  • Advertisement
Sign in to follow this  
alireza.pir

OpenGL Opengl- Diffrent Output for Adreno and Mali GPU

This topic is 850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have A part of code in my Android App that gives me two diffrent Outputs for Two Adreno And Mali GPU:

Sg1hh.png

For Mali GPU

Sm8we.jpg

For Adreno GPU

And this is the Code:

if (DRAW_DEST_POLY && DrawDest) {
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glLineWidth(2.0f);
gl.glPointSize(3f);
gl.glColor4f(0.8f, 0.0f, 0.0f, 1.0f);
gl.glVertexPointer(2, GL10.GL_FLOAT, 0, mBufDestVertices);
gl.glDrawArrays(GL10.GL_LINE_LOOP, 0, OpenglPoly.getNumPoints());
gl.glDisable(GL10.GL_BLEND);
}

I want the OutPut to be like what in Mali GPU is. (the problem is the inner shape that in second image has faded out)

Edited by alireza.pir

Share this post


Link to post
Share on other sites
Advertisement

Where does the color come from?

In the code you just set black color, but the shape is red?

is GL_COLOR_ARRAY enabled?

 

I'm guessing the problem might be with that

Share this post


Link to post
Share on other sites

Where does the color come from?

In the code you just set black color, but the shape is red?

is GL_COLOR_ARRAY enabled?

 

I'm guessing the problem might be with that

sorry this is the right code:

 

if (DRAW_DEST_POLY && DrawDest) {
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glLineWidth(2.0f);
gl.glPointSize(3f);
gl.glColor4f(0.8f, 0.0f, 0.0f, 1.0f);
gl.glVertexPointer(2, GL10.GL_FLOAT, 0, mBufDestVertices);
gl.glDrawArrays(GL10.GL_LINE_LOOP, 0, OpenglPoly.getNumPoints());
gl.glDisable(GL10.GL_BLEND);
}

Share this post


Link to post
Share on other sites

Maybe try glDisableClientState(GL_COLOR_ARRAY); explicitly if you don't need it (and not already doing it)?

 

Just guessing, maybe it is enabled for some reason on the adreno and you get weird colors though that.

 

Looks very weird though, I notice also the frame has the same problem, and it looks to happen at the same X coordinate.

Is the frame drawn with 4 points one for each corner? If so, I don't think the problem is the color array...

Share this post


Link to post
Share on other sites
I know I say this a lot but Android and the graphics API support there is a big clusterfuck of shit.

You've run in to a driver bug; this will never be updated or fixed so best you can do is figure out a work around, detect the OS/device/driver combo and activate the work around when it is detected.

Share this post


Link to post
Share on other sites
Is glColor4f an immediate mode draw call? I think you're mixing vertex array and immediate color here.
Do you use a shader?

Share this post


Link to post
Share on other sites

I usually find the Adreno drivers to be the least compliant of all, with that said, I would not recommend using another GPU to confirm correctness. That said, I would verify using a third GPU is available, but who knows you may have encountered a driver bug..they are rampant in these mobile GPU drivers. Also, you are calling glVertexPointer, but I don't see where you are enabling/disabling the vertex array.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!