textures

OpenGL font rendering using Freetype2

旧城冷巷雨未停 提交于 2019-11-27 06:54:37
问题 I'm trying to render a freetype font using OpenGL, following the example posted at http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02. I've been able to generate a texture atlas from the font, creating shaders and creating quads. What I seem to get stuck at is passing the texture to the shader and/or getting the correct UVs for my quads. Been struggling for a good while now and really need the help. The following is the struct I use to create my texture

360 viewer in unity, texture appears warped in the top and bottom

邮差的信 提交于 2019-11-27 06:21:29
问题 I am making a 360 viewer in unity, to view a 360 photo I used to have a cubemap attached to a skybox, and it worked great. But the weight of the cubemaps forced me to switch to textures. All of the 360 viewer tutorials say to just put a sphere with a shader on it, and put the camera inside. When I do this, it doesn't work very well, because when I look to the top or bottom, I see the image warped like so: (The chairs are suppossed to look normal) It did not happen when I used a skybox. Does

ffmpeg video to opengl texture

ⅰ亾dé卋堺 提交于 2019-11-27 05:04:34
问题 I'm trying to render frames grabbed and converted from a video using ffmpeg to an OpenGL texture to be put on a quad. I've pretty much exhausted google and not found an answer, well I've found answers but none of them seem to have worked. Basically, I am using avcodec_decode_video2() to decode the frame and then sws_scale() to convert the frame to RGB and then glTexSubImage2D() to create an openGL texture from it but can't seem to get anything to work. I've made sure the "destination" AVFrame

cuda alignment 256bytes seriously?

戏子无情 提交于 2019-11-27 04:34:46
问题 In "CUDA C Programming Guide 5.0", p73 (also here) says "Any address of a variable residing in global memory or returned by one of the memory allocation routines from the driver or runtime API is always aligned to at least 256 bytes". I do not know the exact meaning of this sentence. Could anyone show an example for me? Many thanks. A derivative question: So, what about allocating an one-dimensional array of basic elements (like int) or self-defined ones? The starting address of the array

How can I find the maximum texture size for different phones?

给你一囗甜甜゛ 提交于 2019-11-27 04:31:06
问题 I'm trying to find out the maximum texture size for the original Motorola Droid. I believe the G1 has a maximum texture size of 512, but it would be nice if there was a more official way I could find out so I can build a proper tile system. 回答1: You can request the max texture size using glGetIntegerv: int[] maxTextureSize = new int[1]; gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxTextureSize, 0); Log.i("glinfo", "Max texture size = " + maxTextureSize[0]); 回答2: Also check out http://www

Threading textures load process for android opengl game

我的未来我决定 提交于 2019-11-27 04:28:31
问题 I have a large amount of textures in JPG format. And I need to preload them in opengl memory before the actual drawing starts. I've asked a question and I've been told that the way to do this is to separate JPEG unpacking from glTexImage2D(...) calls to another thread. The problem is I'm not quite sure how to do this. OpenGL (handler?), needed to execute glTexImage2D is only available in GLSurfaceView.Renderer's onSurfaceCreated and OnDrawFrame methods. I can't unpack all my textures and then

Three.js multiple materials on object loaded via OBJMTLLoader

我的未来我决定 提交于 2019-11-27 03:54:23
I have ".obj" and ".mtl" files of a model and I'm loading it via OBJMTLLoader . ".mtl" specifies texture to apply to a model, and three.js loads model and renders it with applied texture just fine. But here's the thing. Once an object is loaded, I would like to apply another texture onto it. This is because first texture represents surface material of an object. And second texture is a drawing, that I'd like to position at a specific location on a model. My question is: how to apply a second texture onto already loaded (and texturized) object ? I see that three.js creates an instance of THREE

How to disable three.js to resize images in power of two?

左心房为你撑大大i 提交于 2019-11-27 03:20:47
问题 three.js automatically resizes the texture image, if it is not power of two. In my case am using a custom canvas as texture , which is not power of two.while resizing makes the texture not appearing properly.Is there any way to disable the resizing of the images in three.js 回答1: three.js actually is trying to do you a favor . Since it is open source we can read the source code of WebGLRenderer.js and see that the setTexture method calls the (non public visible) method uploadTexture . The

iOS4: how do I use video file as an OpenGL texture?

荒凉一梦 提交于 2019-11-27 02:53:11
I'm trying to display the contents of a video file (let's just say without the audio for now) onto a UV mapped 3D object in OpenGL. I've done a fair bit in OpenGL but have no idea where to begin in video file handling, and most of the examples out there seems to be for getting video frames from cameras, which is not what I'm after. At the moment I feel if I can get individual frames of the video as CGImageRef I'd be set, so I'm wondering how to do this? Perhaps there are even be better ways to do this? Where should I start and what's the most straight forward file format for video playback on

Using QImage with OpenGL

梦想的初衷 提交于 2019-11-27 02:20:36
问题 I've very recently picked up Qt and am using it with OpenGL The thing though is that when moving my SDL code to Qt and changing the texture code to use QImage it stops working. The image does load correctly, as shown through the error checking code. Thanks! P.S: Please don't suggest I use glDrawPixels, I need to fix the problem at hand. Some of the reasons for that being 1. slow 2. android (which this code may be running on eventually) is OpenGL ES and does not support glDrawPixels Here's the