天道酬勤,学无止境

textures

Multiple Textures OpenGL GLUT C++

Okay still having a few problems with it, this is what I have so far: Bitmap Display::m_HeightMap; unsigned int Display:: textures; My initialise method: glEnable(GL_TEXTURE_2D); Bitmap image[2]; GLuint *textures = new GLuint[2]; glGenTextures(1, textures); glGenTextures(2, textures); image[0].loadBMP("myTexture.bmp"); image[1].loadBMP("myOtherTexture.bmp"); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE , GL_MODULATE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D

2021-11-28 19:48:20    分类:问答    c++   opengl   textures

How to fill each side of a cube with different textures on OpenGL ES 1.1?

Please, I need tutorials/code examples of how to fill each side of a cube with different textures on OpenGL ES 1.1 I found a lot of tutorials but none of them explain clearly how to put different textures in each face and none of them gives easy code examples of how to do it. My actual code (from nehe examples) that draws a cube with the same texture on each face: public class Cube { /** The buffer holding the vertices */ private FloatBuffer vertexBuffer; /** The buffer holding the texture coordinates */ private FloatBuffer textureBuffer; /** The buffer holding the indices */ private

2021-11-28 16:56:39    分类:问答    android   opengl-es   textures

Mapping a stereographic projection to the inside of a sphere in ThreeJS

When it comes to 3D animation, there are a lot of terms and concepts that I'm not familiar with (maybe a secondary question to append to this one: what are some good books to get familiar with the concepts?). I don't know what a "UV" is (in the context of 3D rendering) and I'm not familiar with what tools exist for mapping pixels on an image to points on a mesh. I have the following image being produced by a 360-degree camera (it's actually the output of an HTML video element): I want the center of this image to be the "top" of the sphere, and any radius of the circle in this image to be an

2021-11-28 10:50:28    分类:问答    javascript   3d   three.js   textures   mesh

SurfaceTexture updateTexImage to shared 2 EGLContexts - Problems on Android 4.4

I am referring to this excellent example of how to encode the preview frames of the camera directly into an mp4 file: http://bigflake.com/mediacodec/CameraToMpegTest.java.txt I have adopted the code in the way that I also would like to render the preview image on the screen. Therefore I got something like a GLTextureView with its own EGLContext. This Context is then used as shared EGLContext when I create the EGLContext for the encoder rendering: mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], sharedContext == null ? EGL14.EGL_NO_CONTEXT : sharedContext, attrib_list, 0); In my

2021-11-28 03:31:56    分类:问答    android   textures   android-mediacodec

Can OpenGL ES render textures of non base 2 dimensions?

This is just a quick question before I dive deeper into converting my current rendering system to openGL. I heard that textures needed to be in base 2 sizes in order to be stored for rendering. Is this true? My application is very tight on memory, but most of the bitmaps are not powers of two. Does storing non-base 2 textures consume more memory?

2021-11-28 00:22:35    分类:问答    android   opengl-es   textures

Convert 3D model to SceneJS JSON, including texture

Motive I'm trying to create a small demo application using WebGL. I chose to use SceneJS, because it seemed an easy framework and would more than suffice for this purpose. I have downloaded a couple of .blend models (Amy Rose, amongst others) and exported them as a Collada (.dae) file using Blender. Then I used scenejs-pycollada to convert them to a json model. I just spent a couple of hours getting the scenejs-pycollada convertor to work. Apparently getting those Python dependencies to work in Windows isn't that easy if you've never used Python before. ;) Problem But now I'm stuck (again). My

2021-11-27 20:20:41    分类:问答    json   textures   blender   scenejs

Is it possible to bind a OpenCV GpuMat as an OpenGL texture?

I haven't been able to find any reference except for: http://answers.opencv.org/question/9512/how-to-bind-gpumat-to-texture/ which discusses a CUDA approach. Ideally I'd like to update an OpenGL texture with the contents of a cv::gpu::GpuMat without copying back to CPU, and without directly using CUDA (although i presume this may be necessary until this feature is added).

2021-11-27 19:57:23    分类:问答    opengl   opencv   cuda   textures   gpgpu

OpenGL ES 2.0 中的浮点纹理(Floating Point Textures in OpenGL ES 2.0)

问题 我一直在试图弄清楚如何在 GLES2 中使用浮动纹理。 API 参考说只能使用无符号字节和shorts,但我看到有人说其他地方支持它。 我可以使用GL_LUMINANCE作为纹理格式,但这只会给我一个浮点值。 回答1 在 OpenGL ES 2.0 中,仅当实现导出 OES_texture_float 扩展时才支持浮点纹理。 请注意,此扩展仅允许在纹理级别内进行最近的过滤,而不允许在纹理级别之间进行过滤。 此限制因 OES_texture_float_linear 的存在而放松。 另一个潜在的警告是OES_texture_float的存在不需要实现支持渲染到具有帧缓冲区对象的浮点纹理。 你想用浮动纹理做什么?

2021-11-27 07:47:19    分类:技术分享    opengl-es   textures

如何让纹理在 OpenGL 中工作?(How do I get textures to work in OpenGL?)

问题 我正在使用 http://arcsynthesis.org/gltut/ 上的教程来学习 OpenGL,这是必需的,我必须使用它。 大多数情况下,我想将教程 15 中的纹理应用到教程 7(带有 UBO 的世界)中的对象上。 现在似乎纹理只有在打开 mipmap 时才有效。 这有一个缺点:唯一使用的 mipmap 是索引为零的 mipmap,即 1 颜色的 1x1 像素。 我尝试将 mipmap 的最低级别设置得更高或完全关闭 mipmaps,但即使这样也不能解决问题,因为那样一切都会变黑。 现在我将列出我的程序中最重要的部分 编辑:我想我会添加更多细节...... 顶点着色器有这样的东西: #version 330 layout(location = 0) in vec4 position; layout(location = 1) in vec4 color; layout(location = 2) in vec3 normal; //Added these later layout(location = 5) in vec2 texCoord; out vec2 colorCoord; smooth out vec4 interpColor; out vec3 vertexNormal; out vec3 modelSpacePosition; out vec3

2021-11-27 05:54:12    分类:技术分享    c++   opengl   textures

如何在 opengl/SDL 中使用 ARGB 颜色?(How can I use ARGB color in opengl/SDL?)

问题 我正在使用开罗渲染 SVG。 Cairo 输出格式是 ARGB。 然后我将渲染图像放在 SDL_Surface 中,以便我可以将其用作 openGL 纹理。 当我直接使用 SDL_Surface 时,渲染的图像看起来很好。 但是我不得不在 openGL 中使用表面作为纹理,因为我需要一些 openGL 函数。 问题是,所有的颜色都被翻转了。 OpenGL 使用 RGBA 而不是 ARGB。 我想知道是否有人可以帮助我将 SDL_Surface ARGB 转换为 RGBA。 有用的信息: 我使用本教程来渲染我的 SVG。 http://tuxpaint.org/presentations/sdl_svg_svgopen2009_kendrick.pdf 我的软件是用 C 编写的。 编辑:我使用本教程将 SDL_Surface 用作 openGL 纹理。 http://www.sdltutorials.com/sdl-tip-sdl-surface-to-opengl-texture 渲染过程和opengl贴图都和教程一样。 回答1 根据您的 Tux 示例代码,您可以完全跳过 SDL 并使用以下代码手动向 OpenGL 提供像素数据: GLuint tex; glGenTextures (1, &tex); glBindTexture (GL_TEXTURE_2D, tex)

2021-11-27 05:52:12    分类:技术分享    c   opengl   colors   textures   sdl