New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: graphics quality with OpenGL ES #14659

Open
star-tek-mb opened this Issue Mar 5, 2016 · 0 comments

Comments

Projects
None yet
3 participants
@star-tek-mb

star-tek-mb commented Mar 5, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 linux/386
    gomobile version +0ee7f82 Thu Mar 3 05:14:23 2016 +0000 (android); androidSDK=/home/startek/android-sdk/platforms/android-23
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="386"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="386"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/startek/go/dev"
    GORACE=""
    GOROOT="/home/startek/go"
    GOTOOLDIR="/home/startek/go/pkg/tool/linux_386"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m32 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
  3. What did you do?
    (Use play.golang.org to provide a runnable example, if possible.)
    Draw arc with OpenGL ES.
  4. What did you expect to see?
    Smooth arc.
  5. What did you see instead?
    Unsmooth arc.

Please, change configuration of context creation. From this in android.c (also in x11.c and others):

const EGLint RGB_888[] = {
    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
    EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
    EGL_BLUE_SIZE, 8,
    EGL_GREEN_SIZE, 8,
    EGL_RED_SIZE, 8,
    EGL_DEPTH_SIZE, 16,
    EGL_CONFIG_CAVEAT, EGL_NONE,
    EGL_NONE
};

to:

const EGLint RGB_888[] = {
    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
    EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
    EGL_BLUE_SIZE, 8,
    EGL_GREEN_SIZE, 8,
    EGL_RED_SIZE, 8,
    EGL_DEPTH_SIZE, 16,
    EGL10.EGL_SAMPLE_BUFFERS, 1,
    EGL10.EGL_SAMPLES, 4,  // This is for 4x MSAA.
    EGL_CONFIG_CAVEAT, EGL_NONE,
    EGL_NONE
};

I know, some devices may not support this configuration - but many devices on Android uses modern hardware, and now supports OpenGL ES 3.0.

@bradfitz bradfitz modified the milestone: Unreleased Apr 9, 2016

@gopherbot gopherbot added the mobile label Jul 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment