Coder Social home page Coder Social logo

androidopengldemo's Issues

从零开始的Demo ?

作者提个意见, 你既然标题是从零开始的, 为什么还要把所有范例放在一起, 我只想知道如果创建一个简单的app, 知道这个项目的架构是怎么样的, 画个简单三角形或一个点而已, 为何要搞得那么复杂...

推荐一个视频: https://www.youtube.com/watch?v=yip5CpVeOPI

images

可以在每个例子上配一张效果图。我觉得这样看起来会比较好。比较直观。

关于FBO与RBO绑定和内存占用的问题

在创建RBO时调用了
GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER, GLES20.GL_DEPTH_ATTACHMENT,
GLES20.GL_RENDERBUFFER, renderBufferId);

然后再渲染时,又再次调用此方法,是不是有点多此一举了,我注释了创建时的那个方法,一样可以运行
,还有相机+美颜那一部分,内存占用特太大了,在nexus5X上300Mb左右

3.1

private static double glVersion = 3.0;

private static class ContextFactory implements GLSurfaceView.EGLContextFactory {

  private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;

  public EGLContext createContext(
          EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {

      Log.w(TAG, "creating OpenGL ES " + glVersion + " context");
      int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, (int) glVersion,
              EGL10.EGL_NONE };
      // attempt to create a OpenGL ES 3.0 context
      EGLContext context = egl.eglCreateContext(
              display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
      return context; // returns null if 3.0 is not supported;
  }
}

在华为P9 7.0系统上,点击相机2应用崩溃

你好,很感谢提供了这么好的学习OpenGL的Demo。

如题,在P9的6.0系统是Ok的,但升级到7.0后,就报了下面这个问题(没有对Demo做什么改动):
E/AndroidRuntime: FATAL EXCEPTION: main
Process: edu.wuwang.opengl, PID: 8287
java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=10, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {edu.wuwang.opengl/edu.wuwang.opengl.camera.Camera2Activity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.view.ViewRootImpl.getTitle()' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:4284)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4327)
at android.app.ActivityThread.-wrap22(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1624)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.view.ViewRootImpl.getTitle()' on a null object reference
at android.view.SurfaceView.onAttachedToWindow(SurfaceView.java:250)
at android.opengl.GLSurfaceView.onAttachedToWindow(GLSurfaceView.java:607)
at edu.wuwang.opengl.camera.TextureController$GLView.attachedToWindow(TextureController.java:340)
at edu.wuwang.opengl.camera.TextureController.init(TextureController.java:105)
at edu.wuwang.opengl.camera.TextureController.(TextureController.java:62)
at edu.wuwang.opengl.camera.Camera2Activity$1.run(Camera2Activity.java:93)
at edu.wuwang.opengl.utils.PermissionUtils.onRequestPermissionsResult(PermissionUtils.java:41)
at edu.wuwang.opengl.camera.Camera2Activity.onRequestPermissionsResult(Camera2Activity.java:128)
at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7340)
at android.app.Activity.dispatchActivityResult(Activity.java:7192)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4280)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4327) 
at android.app.ActivityThread.-wrap22(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1624) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:156) 
at android.app.ActivityThread.main(ActivityThread.java:6524) 

3D模型示例的问题,以及解决方法

您好!我在运行“3D OBJ模型”和“OBJ+MTL模型”两个示例时,无法正常显示模型,只有一片空白。
当我把渲染模式改为RENDERMODE_WHEN_DIRTY,则能正常显示模型,也就是第一次渲染的时候是没问题 的。
之后我在https://stackoverflow.com/a/10432300 找到了解决方法:
在ObjFilter和ObjFilter2的onSizeChanged方法里面添加GLES20.glViewport(0, 0, width, height):

@Override
protected void onSizeChanged(int width, int height) {
    GLES20.glViewport(0, 0, width, height);
}

就一切正常了,能看到3D模型旋转。
P.S. 我用的手机是魅蓝Note3。

有百叶窗效果吗

有百叶窗效果吗,最近需要一个斜向左下的百叶窗的效果,不知大神有没有实现

How to make a skybox ?

I want my plant has the stars sky . When the plant rolls with stars runs. But I am not expert in OpenGL . Any one can help me using a skybox with the plant?

Android播放帧动画,效果很奇怪

ZipActivity:基本上用的作者逻辑,文件也是作者的cc.zip,自己进行渲染帧动画。但是播放出来效果很奇怪。正常应该是一辆车的动画效果,但是现在的话,会依次产生很多辆车,导致到最后很多辆车都叠加在一起,光怪陆离。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.