opengl-es

appropriate container to display images one by one

巧了我就是萌 提交于 2019-12-13 04:05:31
问题 I am new in android development. And I am building a location based app like google map(To some extent,we are reinventing the wheel :( ). Like maps.google.com ,the map data is generated as tiles in server and re-organized in the client. And in the html page,its easy to find the container to hold the tiles. For example,we can create some img element accordingly, and then put these imgs inside a div element. Now in the android,which is the appropriate container to display the images? In fact, I

Cocos2d: Is it ok to have a pointer to a parent's class pointer?

Deadly 提交于 2019-12-13 03:52:16
问题 Silly question. Cocos2d is build around the parent-child hierarchy. I was wondering if it is ok to have a parent class (e.g. GameScene) and initialize a child class (e.g. SpriteHandler) with a pointer to a member of the parent class (e.g. CCSpriteBatchNode*). I am trying to do this to optimize the number of CCSpriteBatchNodes. Here is a code snippet of my main class (GameScene style). #import <Foundation/Foundation.h> #import "cocos2d.h" enum ShooterSceneLayerTags { HudLayerTag = 0, };

Using GLKit and OpenGL-ES, How To Draw Two Triangles, One Textured, Another Solid

空扰寡人 提交于 2019-12-13 03:43:42
问题 I'm new to OpenGL-ES and have started working my way through Buck's Learning OpenGL ES for iOS book. Chapter 2 covers drawing triangles with a solid color, and chapter 3 moves on to use textures. As a personal learning exercise, I'm trying to alter the sample code to draw two triangles; one with the texture, the other solid. Seems like a very basic exercise, but one that - as an OpenGL-ES beginner - is proving tricky. So far I've tried a combination of things. First, I prepare to draw with

OpenGL error with Unity on Android

↘锁芯ラ 提交于 2019-12-13 03:39:29
问题 I am on a Unity 5.6.5f1 project targeting Android 6.0. The project is VR enabled with Daydream without the gvr sdk since I do not need any interaction. I noticed that most of the time, when I launch the application, I get the stereo view but everything is black, I do not even see the splash screen and in logcat I get the following error: 'E/Unity: OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command' However, 30% of the time,

Dynamic naming of Resources in Android without getIdentifier

早过忘川 提交于 2019-12-13 03:36:45
问题 I'm using OpenGL ES to make a game in Android. I got some code from a tutorial and I'm trying to change it to suit my app but I'm having a problem. I want to dynamically get an image resource using a string passed into a function as the resource name. I know usually you use getIdentifier() in this case, but that returns an int and I need an input stream. Is there any way of getting an input stream from a resource dynamically? Alternatively, is there a better way of doing this? Code below:

Why vertices/normals are duplicated in OBJ file?

允我心安 提交于 2019-12-13 03:34:57
问题 OBJ files uses f lines that are index into vertices to represent data very efficiently. But I notice many OBJ models out there have duplicated v lines. For example here is a sample cube OBJ content: # Max2Obj Version 4.0 Mar 10th, 2001 # mtllib ./Cube 2.mtl g # object Cube_1 to come ... # v -5.500000 0.000000 -1.000000 v -5.500000 0.000000 1.000000 v -7.500000 0.000000 1.000000 v -7.500000 0.000000 -1.000000 v -5.500000 2.000000 -1.000000 v -5.500000 2.000000 1.000001 v -7.500000 2.000000 1

GLSL vertex shader performance with early return and branching

ぃ、小莉子 提交于 2019-12-13 03:24:06
问题 I have a vertex shader as such void main (){ vec4 wPos = modelMatrix * vec4( position , 1. ); vWorldPosition = wPos.xyz; float mask = step( 0., dot( cameraDir, normalize(normalMatrix * aNormal) ) ); gl_PointSize = mask * uPointSize; gl_Position = projectionMatrix * viewMatrix * wPos; } I'm not entirely sure how to test the performance of the shader, and exclude other factors like overdraw. I imagine a point of size 1, arranged in a grid in screen space without any overlap would work?

How do I create free hand mask on Image Like below using glsl Shader In android?

こ雲淡風輕ζ 提交于 2019-12-13 03:16:51
问题 I'm new to OpenGL and GLSL Programming. Recently I need to do freehand masking on an image like below Image. How could I achieve this using Fragment Shader? Currently, I am trying this with below fragment shader but Nothing Change on Image. precision mediump float; varying vec2 v_TexCoordinate; varying vec2 v_TexCoordinate2; uniform sampler2D u_Texture; uniform sampler2D u_Texture2; uniform bool u_alpha_test_enable; void main() { float mask = texture2D(u_Texture, v_TexCoordinate).a; // if (u

DllImport with different entry points (different DLLs for the same import in different projects)

一曲冷凌霜 提交于 2019-12-13 03:11:59
问题 As a follow-up to my recent question about .NET Compact Framework debugging, I am currently trying to use OpenGL ES from both a .NET Compact Framework and a .NET Framework application. I use this wrapper, which has been created for OpenGL ES and imports from libGLES_CM.dll. To make debugging easier, I created a .NET Framework application, recreated the import project for OpenGL ES and EGL with the same files (just building for Desktop framework), created constants for the DLL names so they'll

OpenGL ES 3 (iOS) texturing oddness - want to know why

我们两清 提交于 2019-12-13 02:16:12
问题 I have a functioning OpenGL ES 3 program (iOS), but I've having a difficult time understanding OpenGL textures. I'm trying to render several quads to the screen, all with different textures. The textures are all 256 color images with a sperate palette. This is C++ code that sends the textures to the shaders // THIS CODE WORKS, BUT I'M NOT SURE WHY glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, _renderQueue[idx]->TextureId); glUniform1i(_glShaderTexture, 1); // what does the 1 mean