Author Topic: Some issues about rendering when camera moving out.  (Read 3138 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Some issues about rendering when camera moving out.
« on: February 25, 2013, 02:29:22 pm »
With the same object3D and the same lookAt-vector, If i move camera out by Camera.moveCamera(CAMERA_MOVEOUT, distance); some abnormal things will happen:

1, the aliasing between boundaries will be rather obvious.

2, some transparency issues(I'm not very sure, but the appearance seems like that), i.e, some parts of an opacity object3D will be transparent and the object3D behind it will be visible.

3, when rotating object3D/camera, the aliasing between boundaries is rather obvious.

Some images:

1, With the near camra,  the aliasing is not obvious:



2, With the far camera, the aliasing is obvious:



3, With the rotating, the aliasing is obvious:

 
« Last Edit: February 27, 2013, 01:10:41 pm by kiffa »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Some issues abuout rendering when camera moving out.
« Reply #1 on: February 25, 2013, 08:22:21 pm »
This is z-fighting. It occurs when the accuracy of the depth buffer isn't sufficient. Which hardware (gpu) is this running on?

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: Some issues abuout rendering when camera moving out.
« Reply #2 on: February 26, 2013, 02:58:15 am »
Log:

02-26 09:55:59.560: D/Woo3d(15288): GL vendor:NVIDIA Corporation
02-26 09:55:59.560: D/Woo3d(15288): GL renderer:NVIDIA Tegra

02-26 09:55:58.580: D/Woo3d(15288): choose EGLConfig: CSAA enabled!
02-26 09:55:58.580: D/Woo3d(15288): Unable to find a matching config...using default!
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_RED_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_GREEN_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_BLUE_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_ALPHA_SIZE: 8
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_DEPTH_SIZE: 16
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_RENDERABL_TYPE: 4
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_SAMPLE_BUFFERS: 0
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_SAMPLES: 0
02-26 09:55:58.580: D/Woo3d(15288): eglconfig: EGL_STENCIL_SIZE: 0

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Some issues abuout rendering when camera moving out.
« Reply #3 on: February 26, 2013, 08:16:45 pm »
I expected that...it's a Nvidia Tegra powered device. Tegra has the worst depth buffer accuracy that i've ever seen on any gpu (including old ones from 1996). You can improve this by using a special extension. Judging from the log output, you seem to use the AAConfigChooser, which should try to enable that extension by default. Try the NVDepthConfigChooser instead and post the log output, please.

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: Some issues abuout rendering when camera moving out.
« Reply #4 on: February 27, 2013, 04:15:40 am »
Some info about egl extension:

02-27 10:42:12.270: D/Woo3d(3944): egl vendor: Android
02-27 10:42:12.270: D/Woo3d(3944): egl version: 1.4 Android META-EGL
02-27 10:42:12.270: D/Woo3d(3944): egl extension: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_ANDROID_image_native_buffer EGL_ANDROID_swap_rectangle

And i didn't use the AAConfigChooser, but a custom ConfigChooser like that:

Code: [Select]
int[] configSpec = new int[] {
        EGL10.EGL_RED_SIZE, mRedSize,
        EGL10.EGL_GREEN_SIZE, mGreenSize,
        EGL10.EGL_BLUE_SIZE, mBlueSize,
        EGL10.EGL_ALPHA_SIZE, mAlphaSize,
        EGL10.EGL_DEPTH_SIZE, mDepthSize,
        EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
        12512, 1, // EGL_COVERAGE_BUFFERS_NV
        12513, 2, // EGL_COVERAGE_SAMPLES_NV
        EGL10.EGL_NONE };

Using NVDepthConfigChooser, the appearance seems much better! Log:

02-27 10:46:59.190: I/jPCT-AE(4917): Nonlinear depth buffer enabled!
02-27 10:46:59.190: I/jPCT-AE(4917): Unable to find a matching config...using default!
02-27 10:46:59.200: I/jPCT-AE(4917): Initializing GL20 render pipeline...


Using AAConfigChooser, the appearance is as good as using NVDepthConfigChooser!

Thanks, i will use AAConfigChooser by default. I used  a custom ConfigChooser before, because i want to print some info to study.

Another question, where can i get the doc of EGL/GL extensions? The home page of GPU-vendor?

I print the EGL extensions of Tegra(above), why there is no extension like EGL_NV_XXXX? My printing code:
Code: [Select]
    String extension = egl.eglQueryString(display, EGL10.EGL_EXTENSIONS);
    WLog.d("egl extension: " + extension);

« Last Edit: February 27, 2013, 08:39:36 am by kiffa »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Some issues abuout rendering when camera moving out.
« Reply #5 on: February 27, 2013, 08:39:10 am »
Another question, where can i get the doc of EGL/GL extensions? The home page of GPU-vendor?

I print the EGL extensions of Tegra(above), why there is no extension like EGL_NV_XXXX? My printing code:
Code: [Select]
    String extension = egl.eglQueryString(display, EGL10.EGL_EXTENSIONS);
    WLog.d("egl extension: " + extension);
I got them from some forum post. The problem is that there are some extensions that haven't made it into the SDK. So you can use them only if you know their magic number. There's no constant exposed for them in the API.

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: Some issues abuout rendering when camera moving out.
« Reply #6 on: February 27, 2013, 10:48:29 am »
Thanks, and i found the extension(EGL_NV_depth_nonlinear) spec(include the magic num) in khronos:

http://www.khronos.org/registry/egl/extensions/NV/EGL_NV_depth_nonlinear.txt

The last question: Could you plan to support OpenGL ES 3.0?
« Last Edit: February 27, 2013, 10:54:15 am by kiffa »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Some issues abuout rendering when camera moving out.
« Reply #7 on: February 27, 2013, 11:22:18 am »
There's no SDK that supports 3.0 ATM. If it's out AND i have a device that supports it, i'll consider it.