Skip to main content
Share Your Experience: Take the 2024 Developer Survey
16 votes
Accepted

What is an index buffer and how is it related to vertex buffers?

Could someone ELI5 to me, what is an index buffer and how is it related to vertex buffers Your vertex buffer contains the X and Y coordinates of 5 vertices. They are: ...
Rotem's user avatar
  • 443
10 votes
Accepted

Tone Mapping vs Gamma Correction

I think it would be a good idea to get back to the basics. It's a large post, so there's a recap at the end. Colour can be represented in a couple of ways. We can have Red, Green and Blue (RGB). We ...
bram0101's user avatar
  • 1,605
10 votes
Accepted

Perspective Correct Texture Mapping

You are on the right track but what you need to do is to calculate u/w and v/w, and also 1/w for each vertex, which you interpolate linearly in screen space in your rasterizer. Then for every pixel ...
JarkkoL's user avatar
  • 3,636
6 votes
Accepted

The Process of Spherical Harmonics

1 For each texel of the generated diffuse cube map (which has $6$ faces times $32 \times 32$ texels), the diffuse equation combines all texels of the environment map (which has $6$ faces times $64 \...
Julien Guertault's user avatar
6 votes

What is an index buffer and how is it related to vertex buffers?

If you have a vertex buffer like this: var vertices = [ 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.6, 0.0, 1.0, 0.6, 0.0, 0.5, 1.0, 0.0 ] And simply draw it ...
q9f's user avatar
  • 703
6 votes
Accepted

Minimum requirements to uniquely represent a 3D object in space

A rigid body has 6 degrees of freedom, in 3D- space. So that means you need 6 values to represent the object. The common way to do this is to store a position vector for position and 3 rotations. But ...
joojaa's user avatar
  • 8,437
6 votes
Accepted

How do I convert a hit on an infinite plane to UV coordinates for texturing in a Raytracer?

If your plane has a normal of $\begin{pmatrix}0 & 0 & z\end{pmatrix}^T$, then your computation ...
Michael Kenzel's user avatar
5 votes

Tone mapping bright images

There are multiple different ways to do tone-mapping, including both local and global methods. I won't discuss local methods (i.e. methods based on using surrounding information as part of the tone ...
haasn's user avatar
  • 175
3 votes

Is Relief Mapping techniques being used these days?

"Relief Texture Mapping" is comparable to "Parallax Occlusion Mapping" (POM). POM is common in rendering systems/games and more popular then the "Relief Texture Mapping" ...
pmw1234's user avatar
  • 3,219
2 votes
Accepted

Texture Mapping jagged pixel edges

I strongly suspect that you are simply running out of floating point precision (at least in "U" dimension). With this sort of mathematics, the LSBs will soon become noisy resulting in the jagged ...
Simon F's user avatar
  • 4,261
2 votes
Accepted

Confusion about HDR image pipeline

Note that the other answer that you linked to is describing only a tonemapping operator, and does not include any exposure scaling at all. It's not replacing your steps 2 and 3 in the process, but ...
Nathan Reed's user avatar
  • 25.1k
2 votes

Deriving formula for perspective correct interpolation

This is to long for a comment so I put it as an answer (but it is really more of a long comment) Deriving formula for perspective correct texture interpolation : solving for texture coordinate ...
pmw1234's user avatar
  • 3,219
2 votes

How to map texture pixels to the corresponding 3D positions?

Well, there is no 1:1 correspondence the pixel might be in many locations at once. What your asking is relatively easy. Just iterate through each triangle (f). Then get the texture coordinate of each ...
joojaa's user avatar
  • 8,437
2 votes
Accepted

Is there a term for mapping between two arbitrary quadrilaterals without using homography / perspective projection?

Yes, this is called bilinear interpolation or a bilinear mapping. The term "bilinear" crops up more commonly in the context of image resizing or resampling, but it's the same basic idea for ...
Nathan Reed's user avatar
  • 25.1k
2 votes
Accepted

Rotation matrix for a 3D object in space

Skimming the math. Starting with a quaternion $Q=w+\left(x,y,z\right)$ then we can rotate $\mathbf{v}$ by: $$\mathbf{v}' = Q\mathbf{v}Q^{-1}$$ and if $Q$ is unit magnitude this reduces to: $$\...
MB Reynolds's user avatar
2 votes
Accepted

Controlling "zoom" and "position" of a cubemap in shaders

Reflections based on a cubemap best represent a reflection at infinity. That is, since the only factor that a cubemap provides is direction, the cubemap acts as though it were at a distance from the ...
Nicol Bolas's user avatar
  • 9,832
1 vote
Accepted

convert image pixel dimensions to UV

UV coordinates are defined such that (0, 0) is your lower left (or upper left, depending on what you're working with) corner of the image and (1, 1) the opposite corner (technically (1, 1) is outside ...
Tare's user avatar
  • 1,566
1 vote

How is this normals map supposed to work?

Yeah, that doesn’t look like any bump, height, or normal map I’ve ever seen—as you’ve identified, there’s only information about the surface contour along a single axis. If anything, it looks like it’...
Noah Witherspoon's user avatar
1 vote
Accepted

What is mipmapping?

Mipmapping is a pre-computed texture scheme that tries to solve the problem of texturemap aliasing. When a screen pixel from a textured polygon covers many texture pixels, the pixel should be sampled ...
beyond's user avatar
  • 315
1 vote

I need to build my own map renderer

If you have the prerendered images, you can "simply" render them onto a grid of quads. This is done with texturing, i.e. you upload the image to your GPU as a texture and apply texturecoordinates to ...
Tare's user avatar
  • 1,566
1 vote

Getting texture value of cartesian coordinate from a Obj file

Your question is very broad because it is close again to "how to I render 3D objects". So some people might give you a more precise answer than mine but at least I will try to give you some pointers. ...
user18490's user avatar
  • 656
1 vote

Texture Mapping jagged pixel edges

In my case, i fixed the problem adding Dx' for interpolation of x-direction. In edge scan line of x-direction, I use integer-type for speed-up but ingnored dx' as below. I changed variable type from ...
zeroe's user avatar
  • 11
1 vote

Why map Hammersley 2D set's (u,v) to sphere's (θ, φ) coordinates (and not to (φ, θ) )?

The "Uniform Mapping" here is incorrect. It does not transform to a uniform distribution on the sphere. Very very bad me. I misread the equation AND I didn't even consult my own reference [...
MB Reynolds's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible