textures

Can an OpenGLES 2.0 framebuffer be bound to a texture and a renderbuffer at the same time?

那年仲夏 提交于 2020-01-13 11:22:49
问题 Brad Larson provides some great code here and here for 'rendering your scene into a texture-backed framebuffer', but it's not clear whether this is the same framebuffer that I use for the rest of the drawing. If you attach a renderbuffer to a framebuffer, can the framebuffer also render into a texture with the same call? 回答1: Sounds like you might be a bit confused with FBO usage. If you need it, this should get you started: Apple Developer - Drawing offscreen. This could help too.

Texture buffer objects or regular textures?

╄→гoц情女王★ 提交于 2020-01-13 08:28:08
问题 The OpenGL SuperBible discusses texture buffer objects, which are textures formed from data inside VBOs. It looks like there are benefits to using them, but all the examples I've found create regular textures. Does anyone have any advice regarding when to use one over the other? 回答1: According to the extension registry, texture buffers are only 1-dimensional, cannot do any filtering and have to be accessed by accessing explicit texels (by index), instead of normalized [0,1] floating point

How exactly is GLSL's “coherent” memory qualifier interpreted by GPU drivers for multi-pass rendering?

眉间皱痕 提交于 2020-01-13 03:53:19
问题 The GLSL specification states, for the "coherent" memory qualifier: "memory variable where reads and writes are coherent with reads and writes from other shader invocations" . In practice, I'm unsure how this is interpreted by modern-day GPU drivers with regards to multiple rendering passes. When the GLSL spec states "other shader invocations", does that refer to shader invocations running only during the current pass, or any possible shader invocations in past or future passes? For my

How to use glDrawElements while keeping Texture Coordinates correct?

给你一囗甜甜゛ 提交于 2020-01-12 13:51:31
问题 I'm using/targetting OpenGL 4.20, GSLSL 4.20, core. Using C. I'm exploring graphics with OpenGL and have decided to make a tile based game. I'm at the point where i'd like to actually draw a bunch of tiles, and am trying to use glDrawElements to draw individual triangles. Relevant code: const float vertexPositions[] = { -1.0f, -0.8f, //0 -0.8f, -0.8f, //1 -0.6f, -0.8f, //2 -0.4f, -0.8f, //3 -0.2f, -0.8f, //4 0.0f, -0.8f, //5 -1.0f, -1.0f, //6 -0.8f, -1.0f, //7 -0.6f, -1.0f, //8 -0.4f, -1.0f,

XNA draw / paint onto a Texture2D at runtime

。_饼干妹妹 提交于 2020-01-12 07:17:29
问题 Morning all (if its morning where you are) I have been looking around and have not seen a satisfactory method for doing this so thought I would ask around... Ideal world I would like to be able to generate a transparent Texture2D object. Drawing this to the screen I would like to be able to "paint" to it, i.e. when the left mouse button is down whatever pixel the cursor is over should be set to black. Following this I would then need to be able to use this texture. Using the texture is the

OpenGL trying to Draw Multiple 2d Textures, only 1st one appears

橙三吉。 提交于 2020-01-11 09:55:40
问题 I've got a problem in that I'm trying to draw a solar system using textures (one texture for each planet) and as I draw my textures, only the 1st one appears. None of the rest do. My init function iterates through my files, saves the textures into an object, and then iterates through the objects. As it's iterating, it generates the textures and binds them to a name using the OpenGL calls. SharpGL.OpenGL gl = args.OpenGL; gl.Enable(SharpGL.OpenGL.GL_BLEND); gl.Enable(SharpGL.OpenGL.GL_TEXTURE

White lines(or spaces) shows up on the borders of the Textures as I move camera. Java, OpenGL

被刻印的时光 ゝ 提交于 2020-01-11 07:39:07
问题 Textures are drawn incorrectly. As I see, Program changes the top line of pixels with the bottom line. And it changes the left column with the right one. If Texture is empty, let's say, on the top, but there are black pixels on the bottom -- when you "move camera" Up or Down you'll see that bottom line becomes empty, and top line becomes black from time to time. So it changes columns as you're moving Left or Right as well. To escape this, I've tried to erase all of the pixels on the borders

Image loading using openGL, SOIL

丶灬走出姿态 提交于 2020-01-11 07:28:14
问题 I tried a lot of examples for loading and displaying images in openGL using SOIL. while running the source code below, it displays just a wite quad without an image. I tried to open an image called: foto. I placed the image-file in the folder of the program. bool* keyStates = new bool[256]; GLuint texture[0]; void resize(int height, int width) { const float ar = (float) width / (float) height; glViewport(0, 10, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-ar, ar,

WPF 3D transparent textures - clipping?

社会主义新天地 提交于 2020-01-11 05:44:09
问题 http://www.youtube.com/watch?v=gZNdfVwkttM - you can see all of the problem described on this video if you can't see pictures. All of walls in all images below have a semitransparent PNG texture. Each square wall, floor and ceiling tile is a separate GeometryModel3D (I know that is no good for performance but...). The floor and the ceiling of the central cube have no any geometry and textures - so they have a color the same as Window.Background (black). But the effect considered appears in

libgdx texture filters and mipmap

China☆狼群 提交于 2020-01-11 04:57:07
问题 When I try to use mipmap filtering in LibGDX, none of the images appear. I'm new to LibGDX, and I have a simple 2d scene with three rotating, scaled circles. In order to anti-alias them, I wanted to use linear filtering. For advice, I looked to this article,which said that, for heavily scaled images, a mipmap can be used to improve speed or quality. The first unexpected appearance was that, despite the fact that all of my images were scaled down, I would only see a linear filter if the