opengl-es

Is there any way to ignore libgdx images Limitation? (images must be power of two)

两盒软妹~` 提交于 2019-12-07 17:17:23
问题 In libgdx framework we can only use images power of two ( 64x256 , 128x32 , etc) Because OpenGL requires it. Is there any good way to "pass" this limitation? For example: Use images 800x480 . 回答1: Do set Texture.setEnforcePotImages(false); and you do not have the limitation anymore. So it's not true that you just can use pictures with the size power of two. It's just a "can have" not a "must have". Regards 回答2: You can use non pot textures, e.g. by using opengl es2.0. But it is good practice

How to write const array in GLSL ES

寵の児 提交于 2019-12-07 16:06:44
问题 I am trying to write a simple vertex shader for an OpenGL ES app on the iPhone, but my array constructor is causing me trouble. attribute vec4 normal; attribute vec4 position; void main(void){ const vec4 vertices[3] = vec4[](vec4(0.25, -0.25, 0.5, 1.0), vec4(-0.25, -0.25, 0.5, 1.0), vec4(0.25, 0.25, 0.5, 1.0)); gl_Position = vertices[gl_VertexID]; } When using this code the shader is unable to compile, and gives me the eror message: ERROR: 0:13: '(' : syntax error: Array size must appear

Bad performance when scrolling on Android 4.3 with Nexus 10

妖精的绣舞 提交于 2019-12-07 14:44:18
问题 My app, which has a list view with some scrolling, is performing very well (scrolling at 60fps) on all phones I have tested it with, Nexus One, Nexus 4 and Galaxy S3/4. But the performance is terrible on the Nexus 10, probably around 15fps or so. I have analysed it to be the Execute part of the graphics pipeline. I have attached a screenshot of a Nexus 10 and a Nexus 4, which are running Android 4.3 and no funny stuff. The UI is even drawn at the same size, with approx the same amount of

Copy NSMutableArray into array of floats for GLES rendering

為{幸葍}努か 提交于 2019-12-07 14:22:58
问题 I have an NSMutableArray called mVerticies stored as a member of my class and I'd like to place them into a float array to draw them with glVertexAttribPointer . Normally when drawing, I would have something like: float verticies[] = {-1, -1, 1, -1}; // ... prepare to draw glVertexAttribPointer(GLKVertexAttribPosition, 2, GL_FLOAT, GL_FALSE, 0, verticies); // ... draw But in order to use the glVertexAttribPointer function, i need a float[]. The verticies are stored as an NSMutableArray

Texture Mapping and Lighting Vertex Shader ErrorJava OpenGL

孤街浪徒 提交于 2019-12-07 14:07:36
问题 I am trying to map texture to a 3D cube and trying to write shaders so that it has lighting and texture. I have tried writing texture shader only and it works. I have also tried lighting shader only with 3D values set to red color, and that light shader works too. But when i try to combine that two, I am having problem. I have provided my code below, but i am getting error that Attached vertex shader is not compiled. Shader could not be linked. Vertex Shader #version 330 core layout(location

Rendering in opengl 3.1+ without VBO using client side vertex array

感情迁移 提交于 2019-12-07 13:45:08
问题 I want to know if its possible to draw in opengl 3.1+ core profile using vertex arrays ( client side rendering not immediate mode) without using the VBO. I know in opengl 3.1+ core profile use of VAO is essential. I want to know if its possible to draw without using VBO by using vertex arrays (client side vertex array not immediate mode). PS I am talking about client side vertex array not immediate mode. I want to know if I can create a VAO without VBO I read this somewhere in opengl spec

EAGLContext, EAGLSharegroups, RenderBuffers, FrameBuffers, oh my!

自作多情 提交于 2019-12-07 13:44:54
问题 I'm trying to wrap my head around the OpenGL object model on iPhone OS. I'm currently rendering into a few different UIView s (build on CAEAGLayer s) on the screen. I currently have each of these as using separate EAGLContext , each of which has a color renderbuffer and a framebuffer. I'm rendering similar things in them, and I'd like to share textures between these instances to save memory overhead. My current understanding is that I could use the same setup (some number of contexts, each

iPhone, float textures

柔情痞子 提交于 2019-12-07 13:43:07
问题 I need to have GL_ RGBA32F as internal format, but i do not get this in OpenGL ES implementation. Instead of this i get only GL_FLOAT as a texture data type. The OES_texture_float spec has nothing to say what's inside. So i do not know, whether my texture data will be normalized to [0, 1] or not. Basically i need to store in texture unclamped texture data regardless it's float or integer value. How i can get not normalized data inside my texture? 回答1: Sadly, OpenGL ES treats the parameters to

draw texture in OpenGL Android from 0,0 coordinates

泪湿孤枕 提交于 2019-12-07 13:35:44
问题 I'm new to opengGL and excuse if the questions are too naive. I'm going through some tuturials for seeking help on learning this. I have a small program written where i'm drawing a texture on a GLSurfaceView. I want to draw a number of textures(bitmap images) in a sequential order starting from 0,0 coordinates. Also I need some gap in images on the screen. Please help. Do I need to change the positioning of vertices buffer. please suggest. Here is my renderer Code. public class GlRenderer

Are there any non-mobile graphics cards that don't support “precision highp float”?

萝らか妹 提交于 2019-12-07 13:10:06
问题 I know it is common for mobile phones to not support 'precision highp float' in fragment shaders, but are there any desktop or laptop GPUs that don't support it? In other words, if I'm only writing my shader code for use in desktop/laptop scenarios, do I really need to do this conditional stuff recommended in the OpenGL ES 2.0 book? #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif Or can I just stick with declaring it 'highp' and be done with it?