opengl-es

Webgl shader debugger, variable inspection

冷暖自知 提交于 2019-12-23 09:56:53
问题 I am looking for a javascript which allows me to debug a WebGL shader down to the single line / variable level. So it should be possible break on every line and inspect the value of every variable. This can be done by instrumentation (parsing the shader, generating a shader which outputs the requested variable, execute this shader against the current context and returns the ouput to the user) It is similar to what glslDevil (http://www.vis.uni-stuttgart.de/glsldevil/) does for OpenGL. Does

Java nested inner class access outer class variables

天涯浪子 提交于 2019-12-23 07:31:32
问题 Is it possible for the nested inner classes ABar and BBar to access main class's variables? For example: public class Foo { public ABar abar = new ABar(); public BBar bbar = new BBar(); public int someCounter = 0; public class ABar { public int i = 0; public void someMethod(){ i++; someCounter++; } } public class BBar { public void anotherMethod(){ bbar.someMethod(); someCounter++; } } } // then called using: // Foo myFoo = new Foo(); myFoo.bbar.anotherMethod(); Edit Seems the code I typed

WebGL - which API to use?

谁说胖子不能爱 提交于 2019-12-23 05:50:49
问题 I want to draw multiple polygon shapes (where each shape has it's own set of vertices). I want to be able to position these shapes independently of each other. Which API can i use to set the a_Position for the vertex shader? A) gl.vertexAttrib3f B) gl.vertexAttribPointer + gl.enableVertexAttribArray thanks. 回答1: Your question makes it sound like you're really new to WebGL? Maybe you should read some tutorials? But in answer to your question: gl.vertexAttrib3f only lets you supply a single

Android OpenGL ES process yuv preview as RGBA

拟墨画扇 提交于 2019-12-23 05:37:11
问题 I want to use OpenGL to process the data from camera which format is NV21 on Android platform. My code was below: vertex shader: attribute vec4 position; attribute vec2 inputTextureCoordinate; varying vec2 v_texCoord; void main() { gl_Position = position; v_texCoord = inputTextureCoordinate; } fragment shader: precision mediump float; varying vec2 v_texCoord; uniform sampler2D yTexture; uniform sampler2D uvTexture; const mat3 yuv2rgb = mat3( 1, 0, 1.2802, 1, -0.214821, -0.380589, 1, 2.127982,

GlView causes OpenGL error

…衆ロ難τιáo~ 提交于 2019-12-23 05:30:23
问题 I am new in cocos2d.I am making a gaming with uiview with cocos2d(3.0 Beta) platform.I set a GLView in custom viewcontroller. Below is my code. - (void)setupCocos2D { CCGLView *glView = [CCGLView viewWithFrame:self.view.bounds pixelFormat:kEAGLColorFormatRGB565 depthFormat:0];** glView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view insertSubview:glView atIndex:0]; [[CCDirector sharedDirector] setView:glView];** } It's working fine.But when we

Getting Exception: FATAL EXCEPTION: GLThread No configs match configSpec

怎甘沉沦 提交于 2019-12-23 05:27:49
问题 I am using the below code for the MultiSampling to make the smooth edge. Below code is working on some mobile and other mobile I am getting exception ' No configs match configSpec . Please help me to solve this issue. Thanks in advance. package com.amplimesh.renderer; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLDisplay; import android.opengl.GLSurfaceView; import android.util.Log; // This class shows

Save OpenGL drawn item as an image

微笑、不失礼 提交于 2019-12-23 05:15:44
问题 I have downloaded the sample code GLPaint from developer.Apple website to draw pictures on a Canvas using OpenGL. I have made many changes to the GLPaint application to meet my requirements. Now, I would like to save the drawn item into photo-library as an image. I know the method to save an image in the photo-library. So, I tried to create the corresponding image file after drawing a picture. Do you know what's the good way to do it? Any help on this is highly appreciated. The code details

OpenGL es 1.1 - android - does gl.glDeleteTextures free video memory?

旧时模样 提交于 2019-12-23 05:14:14
问题 Context: I load 2 textures into an int[] of size 2 using gl.glGenTextures and then bind a texture to each slot of the int[]. (This works fine, and I am able to draw each texture to the "texture squares" I had prepared) Now, my actual concern: Will running gl.glDeleteTextures(2, int[] containing 2 texture pointers, 0) clear up the memory used by the 2 textures generated into my int[]? Or does this just free up the "texture names"? 回答1: It does delete the texture data. The memory might not be

GPUImage apply filter to a buffer of images

前提是你 提交于 2019-12-23 05:10:51
问题 In GPUImage there are some filters that works only for a stream of frames from a camera, for instance the low pass filter, or the high pass filter, but there are plenty of them. I'm trying to create a buffer of UIImages that with a fixed timerate make possible to apply those filters also between just 2 images, and that for each pair of image produces a single filtered image. Something like that: FirstImage+SecondImage-->FirstFilteredImage SecondImage+ThirdImage-->SecondFilteredImage I've

GPUImage apply filter to a buffer of images

丶灬走出姿态 提交于 2019-12-23 05:10:03
问题 In GPUImage there are some filters that works only for a stream of frames from a camera, for instance the low pass filter, or the high pass filter, but there are plenty of them. I'm trying to create a buffer of UIImages that with a fixed timerate make possible to apply those filters also between just 2 images, and that for each pair of image produces a single filtered image. Something like that: FirstImage+SecondImage-->FirstFilteredImage SecondImage+ThirdImage-->SecondFilteredImage I've