texture

Loading just a part of a texture in DirectX?

If I have a texture file how would I be able to load up only a part of it using a defined rect (top, left, bottom, right)? Is it technically possibly to only read in the parts I want to load while leaving the rest of the texture untouched? ...

Orthogonal projection and texture coordinates in opengl

I'm writing a 2D game in Opengl. I already set up the orthogonal projection so I can easily know where a quad will end up on screen. The problem is, I also want to be able to map pixels directly to texture coords, so I also applied an orthogonal transformation (using gluOrtho2d) to the texture. Now I can map pixels directly using integer...

DirectX: How to render a texture to screen (DirectX10.1)

Hi, I'm having some troubles finding out how i can render an offscreen texture to the screen. Can anyone help me with pointing me in the right direction? Thx ...

Is there a faster alternative to using textures in XNA?

I am writing a map editing program for a 2D game using XNA. To create a Texture2D for all of the tiles that a map requires takes too long. Are there any alternatives to using textures for drawing with XNA? I attempted to create just one texture per tile set instead of a texture for every tile in a tile set, but there is a limit to the...

Using a 3D texture slice as a 2D texture input.

Hello, I am trying to do something with Ogre using 3D textures. I would like to update a 3D-texture by going through it slice-by-slice and recalculating the color values. However, in each step I also need to access the previous slice somehow to read the values. Setting up a slice as a render target is easy, but is it possible to feed su...

Finding OpenGL texture size in bytes after it was loaded

Hey, I have a texture loaded with glTextImage2D. I want to get the texture's size after it was loaded to the VRAM, what do I need to do? My internal format is RGBA and the texture's format varies. ...

How do I map a texture onto a Octahedron?

I'm about to go mad. I cant for the life of me figure out texture coords. I have a Octahedron defined by the 8 triangles below. I want to map a texture of the earth on it. See the texture here: http://img37.imageshack.us/f/earthmap1k.jpg/ I would like the north pole at the top point and the south pole at the oposite point with the equa...

Has anybody got success in texture loading using a secondary thread on iphone?

I have been trying improve the performance of my game on iphone. Most of the cases, I do my all texture loading just before rendering the current frame. That makes big jerk in the frame rate. Anybody tried loading texture in secondary thread or something like that? ...

How can I parse through a texutre in DirectX? (IDirect3DTexture9*)

I've been trying to figure out how to parse textures in directx for two reasons: to write my own texture format and to manipulate data in existing IDirect3DTexture9 type textures. I've been looking at the IDirect3DTexture9::LockRect() function but I'm unsure how it works, are the void* pBits I get out of it in D3DLOCKED_RECT the data in...

how to use glCopyImage2D

I'm trying something like glEnable(texture_2d) glBindTexture glCopyTexImage2D glDisable(GL_TEXTURE_2D); I think glCopyTexImage2D won't work with a non-power of two image, so that's one problem; I've also tried glReadPixels, but it's too slow for my purposes. Thanks! ...

Creating a JOGL texture from a BufferedImage

In previous versions of JOGL, I could create a Texture from a BufferedImage using the following handy function: public static Texture makeTextureFromBufferedImage(BufferedImage b) { return TextureIO.newTexture(b,true); } Now however in the latest JOGL release the TextureIO.newTexture method doesn't seem to accept a BufferedImage a...

How to put textures in one file (power of 2)

Hey I want to create big texture which is power of 2 and put in this file a lot of smaller textures. You know, I have several textures which are not power of 2 so I cant load them to my program. I have to put them in one file (512x512 for example). Do you know any program which can do it for me automaticly? Is there any limit of size o...

Basic OpenGL ES Texture problem / Android

I'm having great difficulty getting basic textures to work in an OpenGL ES app on my Droid (2.1-update1). I trying to render a simple textured quad - four vertices, two faces, with normals and texture coords. When rendered, the texture is garbled and full of static, similar to TV noise. Here's a pic showing the original texture...

using a check box to alternate texturecoordinates and texture

I have created a mesh (uniform grid with height values)by loading information from a file. Besides height data the file also contains a texture. The texture is easily mapped to the mesh, I also want the functionality to be able to assign a gradient texture. This is also quite straight-forward but uses other texture coordinates. Howeve...

OpenGL translucent texture over other texture

I got a 2 png images, being used as textures in a Qt/C++ 2D OpenGL application. The first is used as some kind of "middle" ground and the second is used as an "object" being rendered "ontop" (Note: they all have the same z-value atm, I get the desired behaviour be rendering it in a defined order). The "object"-texture is partly transluce...

Setting a Texture in a shader's constant buffer in D3D10

Ok I have a shader compiled up under D3D10. I am obtaining a shader reflection to get details of all the constants/globals in the shader. However I'm a little confused on something ... how do I set a texture to a constant buffer? I assume I don't just Map the constant buffer and copy the ID3D10Texture pointer into it ... I assume I us...

OpenGL texture mapping

I have two objects drawn on screen in openGL, one is a sphere using the GLU object and one is a texture mapped star. Regardless of the z coordinates, the texture mapped star always seems to draw in front. Is this normal openGL behavior? Is there a way to prevent this? Note: I am working within the worldwind framework, so maybe something...

OpenGL: Texturing a cube.

Hi, Recently I have been looking into OpenGL, and I've got up to the stage were I want to texture things. I thought I would start with texturing a simple cube. I currently have this code, and understand fully how it works: #include <glut.h> #define WINDOW_WIDTH 400 #define WINDOW_HEIGHT 400 float angle = 30.0f; void Draw() { glLoa...

Blender, UV Layer, Image and Python

Hi, I'm trying to access UV Layer in Blender from Python and basically API returns UV Layer only as a string. Thing is I want to assign new Image object to current UV Layer ( I use TexFace on the side of material ) and then just bake lighting. All meshes are currently unwrapped, the only thing which is missing is an Image and I have no ...

Generate Texture in Silverlight imitate leather

Hi, I would like to display textures in different colors pretty much having this texture. How do I do this in Silverlight? Thanks! ...