opengl-es-2.0

Load .obj file out of Blender

眉间皱痕 提交于 2019-12-08 04:03:25
im searching now for a quite long time to find something working to import Blender 3D .obj files into xcode to use it on an iphone application. i cant find a description how to implement something like that anywhere! i dont want to use any engine. i just want to know the steps i have to fullfill and the basic things to do. there is really nothing on the www. you can find articles from 2005 - 2008 but thats all not up to date and nothing working. So, does anybody knows how to do that? take a look at the source in libgdx , and take a look at the objloader. He built the lib to be able to load obj

Implement the Fixed function Pipeline efficent in OpenGL ES 2.0?

我与影子孤独终老i 提交于 2019-12-08 03:45:12
问题 I want to use fixed function methods like glTranslate(), glRotate(), glScale() in my openGL 2.0 App. I know, that I need to implement an matrix class - and have done this. My question now is about efficiency. To be able to use something like: glLoadIdentity(); glRotatef(2.0f, 0.0f, 0.0f, 1.0f); glScalef(2.0f, 2.0f, 2.0f); I think, I need to do at least 3 matrix multiplications (assuming we have a projection and a modelview matrizes and this is for the modelview). First would be: Identity

OpenGL ES 2.0 Context in Android

给你一囗甜甜゛ 提交于 2019-12-08 03:02:27
问题 I'm new to OpenGL on Android and I have read heavily documented samples, and I kinda understand it. But before trying to do anything complex, I want to draw a simple 2D white rectangle on a black bacground. Nothing else. I'm stuck at this error: call to OpenGL ES API with no current context , which seems to be that I'm calling something from the non-OpenGL Thread . The thing is that I'm not sure what is called from the OpenGL Thread . So here's my code //============== Activity ==============

WebGL: How to bind an array of samplers

情到浓时终转凉″ 提交于 2019-12-08 02:12:22
问题 As mentioned here it would be possible to "bind all the textures you need to a sampler array in the shader and then index it with a vertex attribute" . How would I do the binding? Currently I bind my textures like so (if that's correct in the first place; it works at least): sampler[i] = gl.getUniformLocation(program, "u_sampler" + i); ... for (var i = 0, len = textures.length; i < len; i++) { gl.activeTexture(gl.TEXTURE0 + i); gl.bindTexture(gl.TEXTURE_2D, textures[i]); gl.uniform1i(sampler

Implement the Fixed function Pipeline efficent in OpenGL ES 2.0?

独自空忆成欢 提交于 2019-12-07 20:18:26
I want to use fixed function methods like glTranslate(), glRotate(), glScale() in my openGL 2.0 App. I know, that I need to implement an matrix class - and have done this. My question now is about efficiency. To be able to use something like: glLoadIdentity(); glRotatef(2.0f, 0.0f, 0.0f, 1.0f); glScalef(2.0f, 2.0f, 2.0f); I think, I need to do at least 3 matrix multiplications (assuming we have a projection and a modelview matrizes and this is for the modelview). First would be: Identity-Matrix*Rotation-Matrix - Second is: ActualMatrix*ScaleMatrix and the last would be: projectionMatrix

With OpenGL ES 2.0 on Android, is there a way preserve multisampling when rendering on a framebuffer?

故事扮演 提交于 2019-12-07 20:14:28
I am developing a 2d game on Android ICS using OpenGL es 2.0 and java. I am trying to use a lighting system and to do that I render all the lights on a framebuffer and the scene on another, with the intent to blend them using the fragment shader to recreate photoshop overlay effect. I encountered a problem though, it seems that the fbo doesn't work with multisampling, so if I draw on the fbo I get jagged lines. I noticed that there is a solution for people using ios, but I didn't find anything on Android. Is there a better way to achieve what I am trying to do than the way I am approching this

OpenGL on Android - Texture Mapping - Only top left pixel visible

流过昼夜 提交于 2019-12-07 19:07:29
问题 I've been playing with OpenGL ES Android and somehow my textures are always filled with the color of the the top left-most pixel. I suppose the flags are wrong, but I've tried a many logical combinations and it does not seem to make any difference. Why would the texture behave like so? What's the bit (flag bit indeed) that am I missing? Thanks public void loadGLTexture(GL10 gl, Context context) { Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId); gl

WebGL debug tools?

北慕城南 提交于 2019-12-07 16:57:57
问题 I am looking for WebGL debug and inspection tools - something like FireBug for WebGL. Any recommendations? 回答1: Just found WebGL Inspector. It claims to be an advanced WebGL debugging toolkit. I haven't personally tried it yet. http://benvanik.github.com/WebGL-Inspector/ 回答2: As mentioned above WebGL-Inspector is a tool, allowing you to analyze textures and buffers passed into shader programs. For low-level issues advanced tools are necessary which track driver API calls, memory consumption

2D Texture gets distorted when making a sub-pixel translation

空扰寡人 提交于 2019-12-07 16:23:10
问题 I would like to know a theoretical reasoning why is this even possible: how translation of the geometry is related to the texture mapping. I can only notice this effect when making a sub-pixel translation, texture looks fine if translated by entire pixel(s). I am using orthographic projection, GL_CLAMP_TO_EDGE , GL_NEAREST , fragment shader is highp . Texture coordinates is a subregion of the atlas, but I can see the distortion even if the entire atlas is mapped. Using OpenGL ES (Android and

Can you write to a Unity texture, from an iOS C plugin, “on the spot”?

不问归期 提交于 2019-12-07 12:44:40
问题 Say you have a low-level Unity plugin for iOS, So in c# using System.Runtime.InteropServices; using AOT; public class Teste: MonoBehaviour { [DllImport("__Internal")] private static extern void set_texture_from_unity(System.IntPtr texture, int w, int h); have a texture, .Apply() it, and then send the pointer to the native iOS plugin: public void ClickPassTexture() { tex = new Texture2D(256, 256, TextureFormat.ARGB32, false); tex.filterMode = FilterMode.Point; tex.Apply(); // ACTUALLY UPLOAD