opengl-es-2.0

No OpenGL context found in the current thread

萝らか妹 提交于 2021-02-20 06:29:31
问题 I am using LibGDX to make a game. I want to simultaneously load/unload assets on the fly as needed. However, waiting for assets to load in the main thread causes lag. In order to remedy this, I've created a background thread that monitors which assets need to be loaded (textures, sounds, etc.) and loads/unloads them appropriately. Unfortunately, I get the following error when calling AssetManager.update() from that thread. com.badlogic.gdx.utils.GdxRuntimeException: java.lang.RuntimeException

How to pass non interpolated data OpenGL ES (GLSL)

我是研究僧i 提交于 2021-02-19 03:57:07
问题 I'm trying to pass simple FLOAT value from vertex to fragment shader. How can I pass it "as is" without interpolation? On desktop I could use flat varying to disable interpolation, is there something similar in openGL es or the only way is through texture? 回答1: GLSL ES does currently not support the flat keyword, so the only way is to use the same float value in all the triangle vertices. The same answer was given here: In opengl es 2, is there a way to prevent interpolation of varyings 回答2:

Render CoreGraphics to OpenGL texture on IOS

[亡魂溺海] 提交于 2021-02-18 08:19:05
问题 Using CoreGraphics on iOS is very easy to use, but it is possible to get the output of CoreGraphics and put it into OpenGL Textures? The final goal is to use CGContextDrawPDFPage to render very performant pdf's and write it into a specific texture id with OpenGL.glBindTexture(GL_TEXTURE_2D, TextureNativeId); It does look like CoreGraphics is not able to render directly into a specific "native texture id". 回答1: Yes, you can, by rendering your Core Graphics content to a bitmap context and

Draw edges of a polygon with OpenGL shaders

痞子三分冷 提交于 2021-02-17 22:27:45
问题 I was wondering if it was possible to draw the edges of a rendered polygon with a specific color using a fragment shader, as in this example picture: Or should I just render those separately? 回答1: See work related on this page: http://web.archive.org/web/20120527185124/http://cgg-journal.com/2008-2/06/index.html A vertex shader should render polygons where the distance to each edge is colored. The difference between coloring each "cell" is explained in much detail. 来源: https://stackoverflow

When should I call CVPixelBufferLockBaseAddress and CVPixelBufferUnlockBaseAddress?

一世执手 提交于 2021-02-10 19:52:30
问题 In iOS6, I'm using OpenGL to do some rendering on AVFoundation video frames. I've seen a lot of example code that makes use of CVPixelBufferLockBaseAddress and CVPixelBufferUnlockBaseAddress, but it's unclear to me when exactly I perform the lock and unlock or why I'm doing it. Should I be locking the address when the CPU is modifying the memory? Or should I lock it when the GPU is reading from it? When should I unlock? Why would I ever even want to unlock? I've seen this Stack Overflow

WebGL/OpenGL text labeling animated instanced shapes

风流意气都作罢 提交于 2021-01-07 02:55:06
问题 I'm rendering a variable number of circles in the plane with variable size, color, and position using instancing. I'm hoping to reach on the order of 10k-100k circles/labels. in float instanceSize; in vec3 instanceColor; in vec2 instanceCenter; The buffer backing the instanceCenter attribute changes every frame, animating the circles, but the rest is mostly static. I have a quad per circle and I'm creating the circle in the fragment shader. Now I'm looking into labeling the shapes with labels

WebGL/OpenGL text labeling animated instanced shapes

廉价感情. 提交于 2021-01-07 02:54:28
问题 I'm rendering a variable number of circles in the plane with variable size, color, and position using instancing. I'm hoping to reach on the order of 10k-100k circles/labels. in float instanceSize; in vec3 instanceColor; in vec2 instanceCenter; The buffer backing the instanceCenter attribute changes every frame, animating the circles, but the rest is mostly static. I have a quad per circle and I'm creating the circle in the fragment shader. Now I'm looking into labeling the shapes with labels