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
19
votes
4 answers

Does it make sense to use own mipmap creation algorithm for OpenGL textures?

I was wondering if the quality of texture mipmaps would be better if I used my own algorithm for pre-generating them, instead of the built-in automatic one. I'd probably use a slow but pretty algorithm, like Lanczos resampling. Does it make sense?…
GhassanPL
  • 2,679
  • 5
  • 32
  • 40
19
votes
2 answers

Three.js texture / image update at runtime

I am trying to change a cube image at run time by selecting an option from Select Form element. When running the code, the image changes after selecting, but the previous cube and image stays in the scene. How I clear / refresh / update the scene…
Miloud Eloumri
  • 779
  • 1
  • 8
  • 14
19
votes
5 answers

How to load a bmp on GLUT to use it as a texture?

I've been searching all around for a simple solution to add sprites to my OpenGl GLUT simple moon lander game in c++ and it appears I must use bmp's since they're easiest to load and use them as textures on a rectangle. How exactly can I load the…
Patricio Jerí
  • 528
  • 2
  • 5
  • 15
18
votes
1 answer

WebGL create Texture

I successfully created a WebGL texture from an image and drew it into a canvas element. function initTexture(src) { texture = gl.createTexture(); texture.image = new Image(); texture.image.onload = function() { …
alex
  • 4,922
  • 7
  • 37
  • 51
18
votes
7 answers

How to use GL_REPEAT to repeat only a selection of a texture atlas? (OpenGL)

How can I repeat a selection of a texture atlas? For example, my sprite (selection) is within the texture coordinates: GLfloat textureCoords[]= { .1f, .1f, .3f, .1f, .1f, .3f, .3f, .3f }; Then I want to repeat that sprite N…
Kriem
  • 8,666
  • 16
  • 72
  • 120
18
votes
2 answers

How to access automatic mipmap level in GLSL fragment shader texture?

How do I determine what mipmap level was used when sampling a texture in a GLSL fragment shader? I understand that I can manually sample a particular mipmap level of a texture using the textureLod(...) method: uniform sampler2D myTexture; void…
Christopher Bruns
  • 9,160
  • 7
  • 46
  • 61
18
votes
1 answer

How to write right repeat texture with three.js

I search to repeat texture on the model. On all examples or questions I found only this like as: var lavaTexture = THREE.ImageUtils.loadTexture( 'images/lava.jpg' ); lavaTexture.wrapS = lavaTexture.wrapT =…
Laurane Bernard
  • 209
  • 1
  • 2
  • 10
17
votes
4 answers

Share OpenGL frame buffer / render buffer between two applications

Let's say I have an application A which is responsible for painting stuff on-screen via OpenGL library. For tight integration purposes I would like to let this application A do its job, but render in a FBO or directly in a render buffer and allow an…
Thomas Vincent
  • 2,214
  • 4
  • 17
  • 25
17
votes
2 answers

What exactly is a floating point texture?

I tried reading the OpenGL ARB_texture_float spec, but I still cannot get it in my head.. And how is floating point data related to just normal 8-bit per channel RGBA or RGB data from an image that I am loading into a texture?
lokstok
  • 231
  • 1
  • 2
  • 7
17
votes
1 answer

Vulkan - draw texture directly without vertices and shaders

Is it possible to draw texture (if it is with correct width, height and pixel format) directly to frame buffer without using vertices and shaders in Vulkan?
zedrian
  • 296
  • 3
  • 10
17
votes
1 answer

SDL2 / Surface / Texture / Render

I'm trying to learn SDL2. The main difference (as I can see) between the old SDL and SDL2 is that old SDL had window represented by it's surface, all pictures were surfaces and all image operations and blits were surface to surface. In SDL2 we have…
Viktor
  • 295
  • 1
  • 3
  • 10
17
votes
1 answer

OpenGLES 2 -- when to glBindTexture, and when to glActiveTexture?

Alright, so these textures are really confusing me. I've been looking at this tutorial (which I think is great), particularly the image captioned with "You can define up to 32 Texture Units, but just up to 8 textures per shader.". As I understand…
Shitesh
  • 1,111
  • 1
  • 10
  • 13
16
votes
6 answers

What are the usual troubleshooting steps for OpenGL textures not showing?

After making a few changes in my application, my textures are no longer showing. So far I've checked the following: The camera direction hasn't changed. I can see the vectors (when colored instead of textured). Any usual suspects?
Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
16
votes
1 answer

How to scale sprites in libgdx according to screen resolutions?

I am trying to scale the texture to fit the screen width. This is what I tried, but it simply repeats the texture. It does not scale it. In the init method: TextureLoader.TextureParameter param = new TextureLoader.TextureParameter(); param.minFilter…
Z0q
  • 1,689
  • 3
  • 28
  • 57
16
votes
4 answers

How to apply texture to glutSolidCube

I can find tutorials about mapping textures to polygons specifying vertices etc. but nothing regarding how to apply a texture to a cube (or other stuff) drawn with glut (glutSolidCube). I am doing something like: glTexEnvfv(GL_TEXTURE_ENV,…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242