Tobias Reich
Lurker
Hello everyone,
I hope you may help me with this problem.
I'm working on a new Galaxy S3 and found a problem that didn't occur on other phones like my old S1 or the Galaxy S2 which has almost the same GPU as the S3 I think.
My problem is hard to describe. When drawing my OpenGL models on top of my camera image like that:
So the GLRenderer should be transparent. It actually is. It works fine for all the objects that are opaque as well as the background (where I see the image of the camera)
My problem is, when I make the pixels semi-transparent in the fragment Shader I get a weird result. The brightest pixels seem overexpose when "blending together". And it looks like they got clamped after so the value that brighter than white - loosing probably the first bit - got dark again.
I guess it is an "overflow" for the values but how can I change this? By the way - perhaps it helps - this effect gets stronger the lower the alpha value of the fragment (the gl rendered one) is. So somehow it looks like something is compensating/normalizing the "semi transparent" values.
I use a simple call like:
So the actual GL-Fragment is clamped and I'm pretty sure it comes from the camera preview itself.
Here is an image that describes my problem:
I hope someone here has seen that problem before. Is there any way of "clamping" both values together since in the Shader I can only clamp the actual rendered fragment somehow. :-(
Thank you for your help,
Tobias
I hope you may help me with this problem.
I'm working on a new Galaxy S3 and found a problem that didn't occur on other phones like my old S1 or the Galaxy S2 which has almost the same GPU as the S3 I think.
My problem is hard to describe. When drawing my OpenGL models on top of my camera image like that:
Code:
mGLView = new GLSurfaceView(this);
mGLView.setOnClickListener(InputManager.getInstance());
GameRenderer renderer = new GameRenderer(kamera, this);
InputManager.getInstance().currentActivity = renderer;
mGLView.setEGLContextClientVersion(2);
mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
setPreserveEGLContextOnPause
mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
mGLView.setZOrderOnTop(true);
mGLView.setRenderer(renderer);
setContentView(new CameraView(this), new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
addContentView(mGLView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
So the GLRenderer should be transparent. It actually is. It works fine for all the objects that are opaque as well as the background (where I see the image of the camera)
My problem is, when I make the pixels semi-transparent in the fragment Shader I get a weird result. The brightest pixels seem overexpose when "blending together". And it looks like they got clamped after so the value that brighter than white - loosing probably the first bit - got dark again.
I guess it is an "overflow" for the values but how can I change this? By the way - perhaps it helps - this effect gets stronger the lower the alpha value of the fragment (the gl rendered one) is. So somehow it looks like something is compensating/normalizing the "semi transparent" values.
I use a simple call like:
Code:
gl_FragColor = vec4(clamp(textureColor.rgb * lightWeighting.xyz, 0.0, 1.0), 0.5);
So the actual GL-Fragment is clamped and I'm pretty sure it comes from the camera preview itself.
Here is an image that describes my problem:
I hope someone here has seen that problem before. Is there any way of "clamping" both values together since in the Shader I can only clamp the actual rendered fragment somehow. :-(
Thank you for your help,
Tobias
