opengl-es

How to rotate a texture in a shader, Android

两盒软妹~` 提交于 2019-12-12 00:14:36
问题 So I have a texture I want to rotate given the angle rotation . Here are my UV coordinates float[] landscapeVerts = { // X, Y, Z, U, V -ratio, -1.0f, z_0, 1.0f, 0.0f, ratio, -1.0f, z_0, 0.0f, 0.0f, -ratio, 1.0f, z_0, 1.0f, 1.0f, ratio, 1.0f, z_0, 0.0f, 1.0f, }; I want to rotate just the UV part. So I built the following matrix to accomplish this in the shader. Matrix.setIdentityM(mProjMatrix, 0); //start with identity matrix Matrix.translateM(mProjMatrix,0,-0.5f,-0.5f,0.0f); // move center to

Android. LibGDX. How to move and orient 3D-object along a spline

二次信任 提交于 2019-12-11 23:51:02
问题 I'm using LibGDX for my Android app. I need to move and orient 3D object(ModelInstance) along a spline.In my case it's CatmullRomSpline. I got the movement working but having problem with orienting the ModelInstance along the spline. My Code: public void update() { float t = SPEED * Gdx.graphics.getDeltaTime(); elapsedTime = elapsedTime + SPEED * Gdx.graphics.getDeltaTime(); //Movement catmull.valueAt(value, elapsedTime); myObject3d.transform.setTranslation(value); //Rotation derivative =

Why will my OpenGL ES textures not render properly?

妖精的绣舞 提交于 2019-12-11 23:42:25
问题 Im using OpenGL for an app that im trying to make. I've been learning from the apress book Beggining iPhone Games Development. The problem I have is that a texturedQuad which is a subclass of my mesh class doesn't seem to be rendering properly. (Although it works in the simulator.) The quad renders as just a plain colors that I have set in the texturedQuad class and doesn't seem to be rendering the texture. This is in a class that is called MenuOptionObject.m which is the actual object that I

Alternative to accum buffer in OpenGL ES?

佐手、 提交于 2019-12-11 23:21:41
问题 Just noticed that Opengl ES 1.0, 1.1, and probably also 2.0 don't have an accum buffer in Android. I'm missing out on some neat effects like a simple fireworks display and realistic (and fast) clouds. Any alternatives to the accum buffer? In particular, at least in the fireworks code, it looks like it's used for blending. UPDATE: after taking a more careful look at the fireworks code, the accum buffer is used to create the trails. 回答1: You should be able to emulate the accum buffer via render

OES_texture_float extension use

你说的曾经没有我的故事 提交于 2019-12-11 21:15:34
问题 How to use the OES_texture_float extension? I do not understand that it is necessary to specify the arguments the function texImage2D. var fb=gl.createFramebuffer(); gl.bindFramebuffer(gl.FRAMEBUFFER, fb); var rb=gl.createRenderbuffer(); gl.bindRenderbuffer(gl.RENDERBUFFER, rb); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16,size[0],size[1]); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER, rb); var texture=gl.createTexture(); gl.bindTexture(gl

Drawing animated circle with OpenGL ES 2.0

陌路散爱 提交于 2019-12-11 20:00:36
问题 I have a circle object, created with OpenGL vertices. When the circle is being touched, I want a scaling animation to be activated. The circle radius will grow bigger until it reaches a certain radius, and then the circle will transform back to its original radius. What is the best way to implement this animation? 回答1: You have a few possibilities. The simplest would be to just create a variable which would hold a scaling factor for your circle and multiply all vertices by it before rendering

Drawing parametric shapes in webGL (without three.js)

青春壹個敷衍的年華 提交于 2019-12-11 19:41:31
问题 I've written a program that draws some parametric shapes (spheres, toruses, and cylinders) just using HTML5 and regular Javascript. I'm trying to convert this code so that it uses WebGL, implementing the shapes with triangle strips as is done in this tutorial. My point of confusion is how triangle strips are even being used to create spheres at all. The way I was doing it before just featured the calculation of where to draw each horizontal slice or circle based on the latitude lines in a for

framebuffer object rendering on ios

拟墨画扇 提交于 2019-12-11 19:31:00
问题 I'm having problems getting offscreen rendering working on ios. Below is the code for setting up a framebuffer object and associated buffers. It is basically the same as the code that apple have on their developer centre. glGenFramebuffers(1, &pick_id); glBindFramebuffer(GL_FRAMEBUFFER, pick_id); GLuint color_id, depth_id; glGenRenderbuffers(1, &color_id); glBindRenderbuffer(GL_RENDERBUFFER, color_id); glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, screen_width, screen_height);

MediaCodec render on offscreen GL Texture notworking on some specific video

爱⌒轻易说出口 提交于 2019-12-11 19:05:29
问题 I am doing some video frame extracting work, based on the sample given by BigFlakes's example code It worked well for most of the videos I tested with, however, there are some video clips which I shot by my phone, cannot be correctly extracted by this method. Please refer to the screen shot. The correct frame is extracted by default MediaMetadataRetriever, and the "image of the colors" is extracted by the sample code. Correct Frame: False Frame: The testing video clip is here It can be played

Called unimplemented OpenGL ES API Android

喜夏-厌秋 提交于 2019-12-11 19:03:32
问题 In my manifest i have this: <uses-feature android:glEsVersion="0x00010001" android:required="true" /> <uses-sdk android:minSdkVersion="7"/> <uses-feature android:name="android.hardware.vibrate" android:required="false" /> <uses-feature android:name="android.hardware.wifi" android:required="false" /> <application android:hardwareAccelerated="true" android:debuggable="false" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" >