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
152
votes
3 answers

Differences and relationship between glActiveTexture and glBindTexture

From what I gather, glActiveTexture sets the active "texture unit". Each texture unit can have multiple texture targets (usually GL_TEXTURE_1D, 2D, 3D or CUBE_MAP). If I understand correctly, you have to call glActiveTexture to set the texture unit…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
57
votes
8 answers

Simplex noise vs Perlin noise

I would like to know why Perlin noise is still so popular today after Simplex came out. Simplex noise was made by Ken Perlin himself and it was suppose to take over his old algorithm which was slow for higher dimensions and with better quality (no…
55
votes
4 answers

Android OpenGL Texture Compression

I need some help finding information (or an example) of how to use texture compression for Android. I have a lot of PNG's right now and I need to reduce the amount of memory they take up. I was looking at PVR compression but I can't figure out how…
Chris
  • 1,766
  • 1
  • 21
  • 36
55
votes
1 answer

Abysmal OpenCL ImageSampling performance vs OpenGL TextureSampling

I've recently ported my volumeraycaster from OpenGL to OpenCL, which decreased the raycaster's performance by about 90 percent. I tracked the performance decrease to the OpenCL's imagesampling functions, which are much slower than the respective…
user1449137
  • 651
  • 5
  • 3
44
votes
2 answers

ffmpeg video to opengl texture

I'm trying to render frames grabbed and converted from a video using ffmpeg to an OpenGL texture to be put on a quad. I've pretty much exhausted google and not found an answer, well I've found answers but none of them seem to have worked. Basically,…
Infiniti Fizz
  • 1,726
  • 4
  • 24
  • 40
35
votes
3 answers

glPixelStorei(GL_UNPACK_ALIGNMENT, 1) Disadvantages?

What are the disadvantages of always using alginment of 1? glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glPixelStorei(GL_PACK_ALIGNMENT, 1) Will it impact performance on modern gpus?
ronag
  • 49,529
  • 25
  • 126
  • 221
34
votes
1 answer

Custom Texture Shader in Three.js

I'm just looking to create a very simple Fragment Shader that draws a specified texture to the mesh. I've looked at a handful of custom fragment shaders that accomplished the same and built my own shaders and supporting JS code around it. However,…
rrowland
  • 2,734
  • 2
  • 17
  • 32
34
votes
5 answers

Stretch background image for UIButton

I got texture, which really shorter, than my UIButton. I got this texture: And i should create this button: How should i stretch (not tile), this texture? Stretching in horizontal direction Thnx
Eugene Trapeznikov
  • 3,220
  • 6
  • 47
  • 74
33
votes
1 answer

Multiple transparent textures on the same mesh face in Three.js

Is it possible to lay multiple textures on top of each other on the same face in Three.js so that the alpha blending is done GPU accelerated in webGL? The textures are (or should be) applied to the same face so that the bottom texture (texture 1) is…
Timo Kähkönen
  • 11,962
  • 9
  • 71
  • 112
32
votes
3 answers

What is the point of an SDL2 Texture?

I'm kind of stuck on the logic behind an SDL2 texture. To me, they are pointless since you cannot draw to them. In my program, I have several surfaces (or what were surfaces before I switched to SDL2) that I just blitted together to form layers.…
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
30
votes
4 answers

Remove paper texture pattern from a photograph

I've scanned an old photo with paper texture pattern and I would like to remove the texture as much as possible without lowering the image quality. Is there a way, probably using Image Processing toolbox in MATLAB? I've tried to apply FFT…
yuk
  • 19,098
  • 13
  • 68
  • 99
30
votes
2 answers

Loading PNG with stb_image for OpenGL texture gives wrong colors

I am using stb_image to load a 32-bit PNG file (RGBA) and I am creating an OpenGL texture with it. It works fine for 24-bit PNG files (with no alpha channel), but when I use a 32-bit PNG file, something goes wrong. This is what the texture should…
brettwhiteman
  • 4,210
  • 2
  • 29
  • 38
30
votes
4 answers

Old paper background texture with just css

Is it possible to create a background texture with pure CSS (without using an image) that looks like an old paper, e.g. like this: https://i.stack.imgur.com/kb0Zm.jpg I'm aware that there are limitations, the texture does not need to be as complex…
Michael
  • 537
  • 1
  • 5
  • 13
29
votes
3 answers

How to get texture data using textureID's in openGL

I'm writing some code where all I have access to is a textureID to get access to the required texture. Is there any way that I can get access to the RGB values of this texture so I can perform some computations on it? EDIT: I am looking for the…
Sonoman
  • 3,379
  • 9
  • 45
  • 61
27
votes
2 answers

Best method to copy texture to texture

What is the best method to copy pixels from texture to texture? I've found some ways to accomplish this. For instance, there's a method glCopyImageSubData() but my target version is OpenGL 2.1, so I cannot use it. Also, because the performance is…
slyx
  • 2,063
  • 1
  • 19
  • 28
1
2 3
99 100