Author Topic: AA not working  (Read 1466 times)

Offline Colli

  • byte
  • *
  • Posts: 13
    • View Profile
AA not working
« on: September 12, 2012, 11:42:56 am »
Hi,

I am trying to enable AA in my game on Android. I am doing it this way:
Code: [Select]
mGLView.setEGLContextClientVersion(2);
mGLView.setEGLConfigChooser(new AAConfigChooser(mGLView) {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
int[] attributes = new int[] {EGL10.EGL_BLUE_SIZE,8,EGL10.EGL_RED_SIZE,8,EGL10.EGL_GREEN_SIZE,8, EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };//EGL10.EGL_DEPTH_SIZE, 16,
EGLConfig[] configs = new EGLConfig[1];

int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});

and in LogCat i found this:
Quote
09-12 09:35:09.637: I/jPCT-AE(1267): No AA config found...defaulting to non-AA modes!
09-12 09:35:09.637: I/jPCT-AE(1267): No AA enabled!

As you can see i have enabled OpenGL 2.0, so i don't know what could be the problem.

Thanks for any help


Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: AA not working
« Reply #1 on: September 12, 2012, 03:02:38 pm »
I used this code and everything works

Code: [Select]
mGLView.setEGLContextClientVersion(2);
mGLView.setEGLConfigChooser(new AAConfigChooser(mGLView));

Offline Colli

  • byte
  • *
  • Posts: 13
    • View Profile
Re: AA not working
« Reply #2 on: September 12, 2012, 03:19:59 pm »
I tried it, and it still keep logging "No AA config found ... defaulting non-AA modes! No AA enabled! "
« Last Edit: September 12, 2012, 03:38:29 pm by Colli »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: AA not working
« Reply #3 on: September 12, 2012, 07:39:05 pm »
You are sure that you've removed your overridden method? Because doing that renders the whole AAConfigChooser pointless. If so, which hardware are you trying it on?

Offline Colli

  • byte
  • *
  • Posts: 13
    • View Profile
Re: AA not working
« Reply #4 on: September 13, 2012, 11:33:02 am »
Yes i have.
that is the whole code i am doing with the mGLView:
Code: [Select]
mGLView = new GLSurfaceView(getApplication());
mGLView.setEGLContextClientVersion(2);
mGLView.setEGLConfigChooser(new AAConfigChooser(mGLView));
renderer = new MyRenderer();
mGLView.setRenderer(renderer);
mGLView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
setContentView(mGLView);

and here is the FrameBuffer code initialization:
Code: [Select]
fb = new FrameBuffer(w, h);
Previously the AA was working on emalutor and also on the Samsung galaxy Ace device, but now it is not working on either of them. In emulator I am using android 4.1, which has support of OpenGL ES 2.0 on emulator, here is a log of it:
Code: [Select]
09-13 09:18:44.319: I/jPCT-AE(935): GL20 render pipeline initialized!
09-13 09:18:44.392: I/jPCT-AE(935): OpenGL vendor:     Google (ATI Technologies Inc.)
09-13 09:18:44.392: I/jPCT-AE(935): OpenGL renderer:   Android Emulator OpenGL ES Translator (ATI Radeon HD 4800 Series)
09-13 09:18:44.398: I/jPCT-AE(935): OpenGL version:    OpenGL ES 2.0 (3.3.11631 Compatibility Profile Context)
09-13 09:18:44.398: I/jPCT-AE(935): OpenGL renderer initialized (using 2 texture stages)

I tried to create new emulators, i restored the older version of my app where the AA might have been working, but nothing worked, i still keep getting "No AA enabled!"

I really don't know what else should i try  :-\

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: AA not working
« Reply #5 on: September 13, 2012, 03:34:51 pm »
emulator is the worst way for testing graphics...

Offline Colli

  • byte
  • *
  • Posts: 13
    • View Profile
Re: AA not working
« Reply #6 on: September 13, 2012, 03:48:26 pm »
I know (i don't have my own smartphone), but it was working on emulator before and also on real device(my friend's), but now it isn't.

EDIT:
i tried to use the second AAConfigChooser constructor:
Quote
AAConfigChooser(GLSurfaceView view, boolean withAlpha)
Code: [Select]
mGLView.setEGLConfigChooser(new AAConfigChooser(mGLView,true));and now in log it says:
Quote
09-13 15:35:35.454: I/jPCT-AE(1049): Unable to find a matching config...using default!

maybe this can help you  ???
« Last Edit: September 13, 2012, 05:38:26 pm by Colli »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: AA not working
« Reply #7 on: September 14, 2012, 09:37:32 am »
Hard to tell from a distance...when it worked, this was with the same version of jPCT?

Offline Colli

  • byte
  • *
  • Posts: 13
    • View Profile
Re: AA not working
« Reply #8 on: September 21, 2012, 07:14:50 am »
sorry I am answering so late.

The problem is resolved, i created new project, upgraded to the newest jpct (1.25) and it is working again  :D

Thanks both of you  ;)