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
14
votes
1 answer

sf::Texture applied in a wrong way

In my 2D isometric engine, I have the following classes: maps(variable)/layers(variable)/cubes(variable)/sides(6)/points(4)/coordinates(3) Each sides contains 4 points(1 point = 1 coordinate(x, y, z)). Each cubes contains 6 sides. I can create a…
Madz
  • 287
  • 3
  • 14
14
votes
1 answer

libgdx: Rotate a texture when drawing it with spritebatch

Im trying to rotate textures when I draw them. I figured it would make more sense to do this than to rotate the images 90 degrees in paint.net and save them in different files. I looked thought the api documentation for spritebatch drawing arguments…
vedi0boy
  • 1,030
  • 4
  • 11
  • 32
14
votes
4 answers

Should I vertically flip the lines of an image loaded with stb_image to use in OpenGL?

I'm working on an OpenGL-powered 2d engine. I'm using stb_image to load image data so I can create OpenGL textures. I know that the UV origin for OpenGL is bottom-left and I also intend to work in that space for my screen-space 2d vertices i.e. I'm…
binarez
  • 779
  • 1
  • 8
  • 17
14
votes
1 answer

How to bind an array of textures to a WebGL shader uniform?

I need to handle many objects which share only a few textures. Defining and loading textures one by one manually (as described in another post on SO) does not feel right... even more so since there's no switch (index) {case:...} statement in WebGL.…
virtualnobi
  • 1,140
  • 2
  • 11
  • 35
14
votes
2 answers

cudaArray vs. device pointer

I am confused about the difference between the intended use of device pointers and cudaArray structures. Could someone please explain why I would use one versus the other? My basic problem is that after looking through documentation and reading the…
Joe
  • 2,008
  • 1
  • 17
  • 25
14
votes
1 answer

Read pixels from a WebGL texture

I have a WebGLTexture object. How do I get pixels of that texture (similar to WebGL's readPixels, but for a texture)? One idea I have is to create a canvas and a WebGL context with preserveDrawingBuffer=true, and render my texture on this canvas so…
Andy
  • 145
  • 1
  • 1
  • 4
13
votes
2 answers

Android OpenGL Transparent Texture Draws Black

I'm trying to draw transparent textures (text) in my app. Strangely, it works on the newest Nexus 7 and on my second generation Moto X but on the original Nexus 7 the textures are just black. I've got blending enabled and the texture is 512x512 so…
David M
  • 841
  • 6
  • 23
13
votes
1 answer

Is it possible to use WebGL max texture size?

I am working on an app where higher resolution is always better. But I'm stuck with WebGL max_texture_size problems. I create an image of size exactly this dimension (16384x16384 on my laptop) and WebGL crashes saying that: GL_INVALID_ENUM :…
mrudelle
  • 133
  • 1
  • 1
  • 7
13
votes
1 answer

MeshLab: How to import XYZRGB file

When I import and XYZRGB (that I generate programatically), MeshLab renders the point-cloud, but the colors are missing. How can I assign textures/colors to vertices. I have tried "Vertex Attribute Transfer" but nothing happens.
RawMean
  • 8,374
  • 6
  • 55
  • 82
13
votes
2 answers

dart:web_gl: RENDER WARNING: texture bound to texture unit 0 is not renderable

I'm getting the error [.WebGLRenderingContext]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering or is not 'texture complete' when I run my web app in dartium. I've been…
lightandlight
  • 1,345
  • 3
  • 10
  • 24
13
votes
2 answers

The different addressing modes of CUDA textures

I am using a CUDA texture in border addressing mode (cudaAddressModeBorder). I am reading texture coordinates using tex2D(). When the texture coordinates fall outside the texture, tex2D() returns 0. How can I change this returned…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
13
votes
2 answers

Three.js Update Texture image

I'm using three.js to create a minecraft texture editor, similar to this. I'm just trying to get the basic click-and-paint functionality down, but I can't seem to figure it out. I currently have textures for each face of each cube and apply them by…
shaqb4
  • 283
  • 1
  • 3
  • 11
13
votes
6 answers

How to remove gaps between tiled textures?

I'm using LibGDX to make a platformer. I'm using square tiles for the platforms but when they are drawn some of them have gaps between them. When I zoom in/out or move the camera around the gaps move position. More details: Tiles are 32x32 and I…
user2291015
  • 131
  • 1
  • 4
13
votes
2 answers

Read texture bytes with glReadPixels?

I want to dump raw texture data to disk (to read back later), and I'm not sure about glReadPixel will read from the currently bound texture. How can I read the buffer from my texture?
Geri Borbás
  • 15,810
  • 18
  • 109
  • 172
12
votes
4 answers

Scrolling parallax background, infinitely repeated in libgdx

I'm making a 2D sidescrolling space shooter-type game, where I need a background that can be scrolled infintely (it is tiled or wrapped repeatedly). I'd also like to implement parallax scrolling, so perhaps have one lowest background nebula texture…
fundead
  • 1,321
  • 1
  • 14
  • 15