textures

Multiple Textures OpenGL GLUT C++

痴心易碎 提交于 2019-12-04 12:15:37
问题 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

How do I improve Direct3D streaming texture performance?

北战南征 提交于 2019-12-04 11:23:32
I'm trying to accelerate the drawing of a full-screen texture which changes every frame. On my system, I can get around 1000 FPS using GDI and BitBlt(), but I thought I could improve performance by using Direct3D and dynamic textures. Instead I'm only getting around 250 FPS. I'm running on a Mac Pro with an ATI HD 4870 with current drivers. I've tried using dynamic textures and that gives me a small gain (~15FPS) and I've tried using a texture chain to avoid pipeline stalls and that has no effect. I've looked around quite a bit and there's very little information on using dynamic textures this

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

好久不见. 提交于 2019-12-04 10:32:30
问题 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

How do you scale SKSpirteNode without anti aliasing

戏子无情 提交于 2019-12-04 10:32:01
问题 I am trying to scale an SKSpriteNode object without smoothing/anti-aliasing (I'm using pixel-art so it looks better pixelated). Is there a property I need to set to do this? This is the code I am using to render the sprite: SKTextureAtlas *atlas = [SKTextureAtlas atlasNamed:@"objects"]; SKTexture *f1 = [atlas textureNamed:@"hero_1.png"]; SKSpriteNode *hero = [SKSpriteNode spriteNodeWithTexture:f1]; [self addChild: hero]; hero.scale = 6.0f; The image is scaled correctly but blurry/smoothed out

Three.js tile which has multiple textures using plane geometry

拈花ヽ惹草 提交于 2019-12-04 10:25:13
So I am trying to build a 3D based world consisting of tiles. I have successfully managed to do this using the plane geometry and height values etc. But now I have come to a point where I possibly have to change everything. The problem is that I want a tile to have multiple textures (using a shader because I want to blend them). I was able to do this globally (so each tile would have same textures + using some uv mapping). However I fail to understand how I would be able to specify which tile has which textures (and I have about a 100 textures), since the plane geometry has only 1 shader

How to manage multiple textures in OpenGL ES 2.0?

爷,独闯天下 提交于 2019-12-04 09:26:16
I have a OpenGL ES 2.0 app with 6 different textures. What I need is to draw and move them all at the same time. I was able to do it, but the movement was laggy because I was loading the bitmaps into the textures all the time. For each texture, I do the following on the Render method: setupImage(texture1); GLES20.glVertexAttribPointer(mPositionHandle, 3, GLES20.GL_FLOAT, false, 0, vertexBufferT1); GLES20.glVertexAttribPointer(mTexCoordLoc, 2, GLES20.GL_FLOAT, false, 0, uvBufferT1); GLES20.glDrawElements(GLES20.GL_TRIANGLES, indicesT1.length, GLES20.GL_UNSIGNED_SHORT, drawListBufferT1); And on

Android OpenGL - ES Texture bleeding

≯℡__Kan透↙ 提交于 2019-12-04 08:27:17
I am writing a small app that at the moment generates a random map of textures. I am drawing this map as a 10 x 15 group of "quads" which are infact all triangle strips. I use the "map" to grab an int which I then take as the location of the texture for this square in the textureAtlas. so for example 0 is the bottom left "tile". The atlas is 128 x 128 and split into 32 pixel tiles. However I seem to be getting some odd artifacts where the texture from the one tile is creeping in to the next tile. I wondered if it was the image itself but as far as I can tell the pixels are exactly where they

Android opengl issue (weird)

谁说我不能喝 提交于 2019-12-04 07:59:07
this is a weird one. I have a basic application (dashboard, ...) and a GLSurfaceview in which I draw 3D objects and textures. All runs pretty but when I go back in other activities, hmm well a screenshot is better than words: This is the dashboard before this is the opengl: And this is my dashboard when I press back: As you can see, the images are gone and text too. I run on 4.0+ so I suppose this is because android draws elements with opengl, as it doesn't do that on my 2.2 device. Do you have an idea of what is causing this? It does not happen when I don't use texture btw. Ok I found what

Create a health bar

喜夏-厌秋 提交于 2019-12-04 07:02:36
问题 I am trying to create a working health bar, and I have tried methods like Creating GUI.Box() that contains the health bar texture that I have created, but this makes the health bar resize to scale like this: Resizing the texture itself without the GUI.Box(), using the Texture2D.Resize() Method, but when I used the Texture2D.Resize() method, my texture turned black . It looks like this: My code looks like this. It was edited so that the irrelevant parts were deleted for ease of reading. Why

Texture doesn't draw

佐手、 提交于 2019-12-04 06:30:22
问题 I want to draw a image to the screen, but what I get is the black square but without the texture on it. The image path is correct and loaded, because the rect have the correct size. I have a separate class for loading the texture named Texture and a class for drawing the texture called Sprite. Here is the code: // Class Texture public void loadFromResources(final Context context, int id) { GLES20.glGenTextures(1, mTextureID, 0); final BitmapFactory.Options options = new BitmapFactory.Options(