For questions related to textures: procedural generation, encodings, aspect characterisation, filtering, mapping, storage...
Questions tagged [texture]
252 questions
16
votes
2 answers
How does mip-mapping work with non-power-of-2 textures?
I have heard that recent GPUs all support non-power-of-2 textures and all features just work. However, I don't understand how mip-mapping would work in such a scenario. Can someone explain?

ap_
- 2,204
- 1
- 18
- 27
11
votes
1 answer
Algorithms for down sampling an image?
Bicubic sampling is pretty good for up sampling an image and making it larger, but is it a good choice for down sampling as well? Are there better choices?

Alan Wolfe
- 7,801
- 3
- 30
- 76
11
votes
2 answers
Are textures automatically Morton-coded when loaded to VRAM?
I know that texture caching on GPU works to optimize locality in 2D (or 3D if using 3D textures). I believe this is done using space-filling curves like Morton or Hilbert curves.
When passing an array of texture data to the GPU, though, for example…

russ
- 2,392
- 9
- 18
10
votes
1 answer
Do you need to use a lowpass filter before downsizing an image?
Apparently bicubic pixel interpolation is good for scaling up or down an image (in real time or not).
Is it recommended to use a lowpass filter before downsizing though, or does the bicubic sampling handle aliasing problems at all?

Alan Wolfe
- 7,801
- 3
- 30
- 76
6
votes
3 answers
Gaussian blur with transparency
I made a convolution testing program for experimenting with stuff. I've created a 5x5 Gaussian kernel for blurring. Everything looked fine, then I tried to blur a transparent png with a white circle in the middle. On the blurred image, the edge…

Rothens
- 191
- 2
- 7
4
votes
1 answer
What happened to my texture mapping?
Recently, I am writing a simple software rasterizer for self-studying and fun. But the texture mapping has problems. The texture I want to map is below:
But the final image of two triangles is problematic, it shows below:
The triangle rasterizing…

alexunder
- 141
- 2
3
votes
0 answers
How should the texture file look like?
I am wondering why the texture of the following 3D model https://app.ignitionrobotics.org/GoogleResearch/fuel/models/Transformers_Age_of_Extinction_Mega_1Step_Bumblebee_Figure
Looks like the following:
https://i.stack.imgur.com/A9Gd0.jpg
How are…

Mona Jalal
- 163
- 5
2
votes
2 answers
BC7 texture with alpha has the same size as BC7 without alpha
So i've a made a texture. I've saved the RGB one with BC7 compression, then added alpha channel[specular map] with varying levels of grayscale, and saved the file again as RGBA with BC7 compression. The resulting file has the same size as the one…

Piotr Burzała
- 23
- 4
1
vote
1 answer
Are texture binds expensive?
I am trying to get a feel for how much effort I should put into this. I am building a basic 2D engine and for my use case there are only 8 textures. Each draw call in this engine currently requires that its 1 corresponding texture be bound to '0'.…

J.Doe
- 1,445
- 12
- 23
1
vote
1 answer
Barycentric Coordinates of a Point on a Line
Given a point and a line segment, how do you calculate the barycentric coordinates of the point to the line?
bool BarycentricCoordinates(const Vector3& point, const Vector3& a, const Vector3& b, float& u, float& v, float epsilon)

MOJOMO
- 21
- 3
1
vote
1 answer
Best approach for slicing texture images for raycasting
I'm working on a 2D (pseudo-3D) raycaster which operates on a 2D tile grid.
For each ray sent out, the screen draws a rectangle with a certain height depending on the distance between the camera and the wall the ray collided with (like Wolfenstein…

Zoler1337
- 11
- 1
0
votes
1 answer
compressing my [0,1] floats by throwing away the integer part
I am compressing a string of data in the formats of float. The current approach is throwing away eight bits in the integer part as my float is strictly within [0,1].
I wonder how I could do this.

Lilylilyren
- 11
- 4