opengl-es

Android/OpenGL-ES 2.0: setDebugFlags doesn't do anything?

人盡茶涼 提交于 2019-12-11 01:33:36
问题 I'm trying to utilize setDebugFlags as recommended here to scan for opengl errors: http://developer.android.com/resources/articles/glsurfaceview.html I put it in my surfaceview's constructor: public MySurfaceView(Context context, AttributeSet attrs) { super(context, attrs); setEGLContextClientVersion(2); setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS); _renderer = new MyRenderer(getContext()); setRenderer(_renderer); setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY); } Yet when

OpenGL, OpenVG. Draw text?

一个人想着一个人 提交于 2019-12-11 01:17:29
问题 There are enough "examples" but all of them represent parts of strange code. The best code I found is: link but I can't even run it because it has variables and constants with missed declaration. Can anybody post a full workable example? 来源: https://stackoverflow.com/questions/20186811/opengl-openvg-draw-text

Weird y-position offset using custom frag shader (Cocos2d-x)

假如想象 提交于 2019-12-11 01:17:07
问题 I'm trying to mask a sprite so I wrote a simple fragment shader that renders only the pixels that are not hidden under another texture (the mask). The problem is that it seems my texture has its y-coordinate offset after passing through the shader. This is the init method of the sprite (GroundZone) I want to mask: bool GroundZone::initWithSize(Size size) { // [...] // Setup the mask of the sprite m_mask = RenderTexture::create(textureWidth, textureHeight); m_mask->retain(); m_mask-

How to render .dae(collada) file in android studio using openGL

蹲街弑〆低调 提交于 2019-12-11 00:14:11
问题 I am developing a android project to make and render a 3D Object using openGL concepts. I'm able to rendering obj and mtl file Unfortunately, I'm not able to render .dae(collada) file in android studio. Any one send a sample project link for basic animated file in openGL 回答1: Take a look at this repo: https://github.com/andresoviedo/android-3D-model-viewer ColladaLoader class has the code to parse the data in a dae file. 来源: https://stackoverflow.com/questions/48204593/how-to-render

How to display a scaled down GL ES texture without clamp or repeat on android

感情迁移 提交于 2019-12-10 23:59:22
问题 I am currently rendering a camera preview using GL ES 2.0 on android to a SurfaceTexture, rendering it with opengl, then transferring it to a media codec's input surface to for recording. It is displayed to the user in a surface view and by setting that surface view's aspect ratio the camera preview is not distorted based on screen size. The recording is in portrait, but at some point the incoming texture will start coming in landscape, at which point I'd like to zoom out and display it as a

Does Every Device Which has Android Froyo 2.2(API 8) Supports OpenGL ES 2.0?

左心房为你撑大大i 提交于 2019-12-10 23:03:30
问题 Android 2.2 is upgraded from OpenGL ES 1.0 to 2.0. Does Every device which is using Android Froyo(2.2) Supports OpenGL ES 2.0? or the device itself has to be supported for OpenGL ES 2.0?. 回答1: I got the answer of my own question. OpenGL ES is a hardware-acceleration Graphics library so it is not necessary that every device which supports Adroid froyo Supports OpenGL ES 2.0. It entirely depends on OS Software and Hardware.Different devices listed here with there extensions which has Android

Opengl-es onTouchEvents problem or a draw problem? [closed]

梦想与她 提交于 2019-12-10 23:03:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I am just getting started with using opengl in my apps and I get it fine =) but I've hit a brick wall recently as I have been attempting to work out methods of user input. I decided to start with a simple process

rotate camera up and down, left and right with pan gesture

点点圈 提交于 2019-12-10 23:01:17
问题 I want to rotate camera up or down and left or right to look around an object, (360 degrees view) with pan gesture using opengl lookat function, I use swift and Metal(in this case Metal = opengl es). here is the code: the lookat function(this function is in another ViewController which is inheritance from the main ViewController which is with the viewDidLoad and pan gesture function): let viewMatrix = lookAt(location, center: ktarget, up: up) the viewDidLoad and var: var ktarget = V3f() var

How to blur image using glsl shader without squares?

放肆的年华 提交于 2019-12-10 22:56:34
问题 I want to blur image with Gaussian blur algorithm. And I use the following shaders: Vertex shader attribute vec4 position; attribute vec4 inputTextureCoordinate; const int GAUSSIAN_SAMPLES = 9; uniform float texelWidthOffset; uniform float texelHeightOffset; varying vec2 textureCoordinate; varying vec2 blurCoordinates[GAUSSIAN_SAMPLES]; void main() { gl_Position = position; textureCoordinate = inputTextureCoordinate.xy; // Calculate the positions for the blur int multiplier = 0; vec2 blurStep

Why I can't use uniform1f instead of uniform4f for setting a vec4 uniform?

做~自己de王妃 提交于 2019-12-10 22:28:33
问题 I learn WebGL step by step via this book. I try to draw three points through using of the buffer ( gl.ARRAY_BUFFER ) instead of cycle (as I did the same earlier in other samples of the book). var u_FragColor = gl.getUniformLocation(gl.program, 'u_FragColor'); if(!u_FragColor){ console.log('Can\'t to get the "u_FragColor" variable.'); return -1; } // gl.uniform1f(u_FragColor, 1.0); // <- this variant doesn't work! Why? gl.uniform4f(u_FragColor, 1.0, 0.0, 0.0, 1.0); It works fine, but I have a