Questions tagged [textures]

Textures are series of images used in computer graphics to associate locations on a visible surface with varying values. This association is typically done by mapping locations on the texture (usually two-dimensional, but other dimensions and types of textures exist) to locations on the rendered surface. Filtering is often used to smooth away aliasing when sampling values from the texture, usually involving multiple images within a texture called mipmaps.

In 3D graphics, the digital representation of the surface of an object. In addition to two-dimensional qualities, such as color and brightness, a texture is also encoded with three-dimensional properties, such as how transparent and reflective the object is. Once a texture has been defined, it can be wrapped around any 3-dimensional object. This is called texture mapping.

Well-defined textures are very important for rendering realistic 3-D images. However, they also require a lot of memory, so they're not used as often as they might be. This is one of the rationales for the development of the new graphics interface, AGP, which allows texture to be stored in main memory, which is more expansive than video memory. AGP also speeds up the transfer of large textures between memory, the CPU and the video adapter.

5888 questions
26
votes
0 answers

Texture coordinate Cocos3d

Here is how I put my texture on my object : _obj = (CC3MeshNode *)[_world getNodeNamed:@"s0"]; _obj.material.texture = [CC3Texture textureFromFile:@"objTextureLayout.png"]; My object is loaded from 3DMAX and I don't understand why my texture…
klefevre
  • 8,595
  • 7
  • 42
  • 71
26
votes
1 answer

how to manage memory with texture in opengl?

In my application I am using extensively glTexImage2D. I copy some image of an image and render it as a texture, I do it frequently at every mouse click. I give it as a byte array for rendering. The memory is being eaten up and the swap memory is…
Shan
  • 18,563
  • 39
  • 97
  • 132
25
votes
3 answers

How to manipulate texture content on the fly?

I have an iPad app I am working on and one possible feature that we are contemplating is to allow the user to touch an image and deform it. Basically the image would be like a painting and when the user drags their fingers across the image, the…
funckymonk
  • 556
  • 1
  • 4
  • 15
24
votes
2 answers

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

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…
Billy
  • 1,374
  • 1
  • 17
  • 25
24
votes
1 answer

CUDA - Multiprocessors, Warp size and Maximum Threads Per Block: What is the exact relationship?

I know that there are multiprocessors on a CUDA GPU which contain CUDA cores in them. In my workplace I am working with a GTX 590, which contains 512 CUDA cores, 16 multiprocessors and which has a warp size of 32. So this means there are 32 CUDA…
Ufuk Can Bicici
  • 3,589
  • 4
  • 28
  • 57
23
votes
3 answers

Transparent textures behaviour in WebGL

Environment: WebGL, Chrome. I have the following behavior when using transparent png's as textures for models: Image A - the tree hides the building behind it and I see the world box texture. It also hides itself (back branches are not visible) At…
Vecnas
  • 1,387
  • 1
  • 10
  • 13
23
votes
3 answers

OpenGL Texture transparency doesn't work

I'm having an OpenGL texture that is binded to a simple quad. My problem is: My texture is 128x128 pixels image. I'm only filling up about 100x60 pixels on that image, the other pixels are transparent. I saved it in a .png file. When I'm drawing,…
Curtain
  • 1,972
  • 3
  • 30
  • 51
23
votes
5 answers

Multiple textures in GLSL - only one works

My problem is getting more than one texture accessible in a GLSL shader. Here's what I'm doing: Shader: uniform sampler2D sampler0; uniform sampler2D sampler1; uniform float blend; void main( void ) { vec2 coords = gl_TexCoord[0]; vec4 col =…
appas
  • 4,030
  • 2
  • 19
  • 17
23
votes
1 answer

sRGB textures. Is this correct?

I've recently been reading a little about sRGB formats and how they allow the hardware to automatically perform colour correction for typical monitors. As part of my reading, I see that you can simulate this step with an ordinary texture and a pow…
Robinson
  • 9,666
  • 16
  • 71
  • 115
22
votes
1 answer

Updating a texture in OpenGL with glTexImage2D

Are glTexImage2D and glTexSubImage2D the only ways to pass a buffer of pixels to a texture? At the moment I use in a setup function glTexImage2D passing null as the buffer, and then on the render loop I call glTexSubImage2D with the new buffer data…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
22
votes
3 answers

OpenGL - Associate Texture Coordinates Array With Index Array Rather Than Vertex Array?

Whenever we use an index array to render textured polygons with glDraw*Elements*, we can provide an array of vertices and an array of texture coordinates. Then each index in the index array refers to a vertex at some position in the vertex array and…
Fejwin
  • 707
  • 1
  • 8
  • 14
21
votes
3 answers

How many mipmaps does a texture have in OpenGL

Nevermind that I'm the one who created the texture in the first place and I should know perfectly well how many mipmaps I loaded/generated for it. I'm doing this for a unit test. There doesn't seem to be a glGetTexParameter parameter to find this…
Ted Middleton
  • 6,859
  • 10
  • 51
  • 71
21
votes
2 answers

Difference between sprite and texture?

Can you please explain the difference between texture and sprite? When we zoom in a sprite, it appears blurry because it's basically an image. Is it the same for a texture? I read this comment on the image below online: The background layers are…
user5622430
20
votes
4 answers

Can I use a grayscale image with the OpenGL glTexImage2D function?

I have a texture which has only 1 channel as it's a grayscale image. When I pass the pixels in to glTexImage2D, it comes out red (obviously because channel 1 is red; RGB). glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, dicomImage->GetColumns(),…
Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
20
votes
4 answers

Packing rectangular image data into a square texture

I have N items of 2D image data that will be rectangular and I want to pack them into a single power of 2 texture as efficiently as possible. A simple non-efficient and naive implementation of an algorithm to pack these rects would be easy to whip…
TexturePacker