# Tag Info

15

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: index | X | Y 0 | 0.0 | 0.0 1 | 1.0 | 0.0 2 | 0.0 | 0.6 3 | 1.0 | 0.6 4 | 0.5 | 1.0 Your index buffer contains information about which lines to draw between these ...

10

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 you divide the interpolated u/w and v/w coordinates with the interpolated 1/w to get perspective correct uv-coordinates for the pixel. The same applies to all ...

6

A key rule of thumb for high-performance code in general, and graphics in particular, is to batch large amounts of work together rather than doing it in small chunks. In your case, rather than sending one quad's worth of data at a time and drawing one quad at a time, it will be far more efficient to send many quads' data in a large batch, and draw many quads ...

6

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 \times 64$ texels). Thus $32 \times 32 \times 6 \times 64 \times 64 \times 6$ as stated. Since the article considers SH with $9$ coefficients, and each coefficient ...

6

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 as it is: // Create an empty buffer object var vertex_buffer = gl.createBuffer(); // Bind appropriate array buffer to it gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer); // Pass the vertex data to ...

6

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 for obvious reasons any 6 variables that are independent of each other would do this. The problem with vectors is that they aren't the most efficient way to ...

5

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 could have CMYK (used in printing). There's also YCbCr/YUV (one for luminance and two for colour) and similar flavours of that. We have HSV/HSL/HSB (hue, ...

5

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 mapping process) here. Global methods can be broken down into two components: A formula for mapping from $[0,\infty)$ to $[0,1]$. A method of applying this to ...

5

If your plane has a normal of $\begin{pmatrix}0 & 0 & z\end{pmatrix}^T$, then your computation vec3 u = vec3( normal.y, -normal.x, 0 ).normalized(); vec3 v = normal.cross( u ); will result in u and v both being $\begin{pmatrix}0 & 0 & 0\end{pmatrix}^T$. A more general approach would be, for example, to compute the cross product of your ...

4

You can of course, as you suggested, map (u, v) to (φ, θ). Unfortunately, it does not solve the problem for 5 points: I've changed Holger Dammertz' code a bit (switched u and v), and you see that the problem still persists. For a higher number of points, it really doesn't seem to make a (visual) difference. The Hammersley point set is a way to very quickly ...

3

Google said how in 2012, avoiding explaining too many details The never-ending quest for the perfect map ...new imagery rendering techniques and computer vision that let us automatically create 3D cityscapes, complete with buildings, terrain and even landscaping, from 45-degree aerial imagery and here it's a video of the feature. So we know that "...

2

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 appearance when you are (effectively) doing yes/no comparisons against known constants. May I suggest instead that, rather than doing point sampling of your texture,...

2

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 transforming quadrilaterals—it's just that the interpolation is applied to the vertex positions of the quad, instead of the colors of pixels in an image. One paper that ...

2

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: $$\mathbf{v}' = Q\mathbf{v}Q^*$$ To create a matrix we need to apply the rotation to the basis set to form our three equations:  \mathbf{x} = \left(1,0,0\right) \\ ...

2

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 reflective surface where only the direction to the reflecting objects matters. And that only happens if the reflecting objects are infinitely far from the ...

1

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 the UV range, but we ignore this for easiness sake). Thus, if you want the exact middle, you obviously get (0.5, 0.5) Now with your image, the first pixel ...

1

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’s meant to be overlaid on a texture as a cheap form of fake bump-mapping in an era where it was too expensive to do it for real.

1

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 more than only once (nearest neighbor or bilinearly) to get a "correct" average color. So instead of having a regular texture a mipmap is created. The mipmap ...

1

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 quads, such that when you render the quads, the textures are applied correctly to their surfaces. You will however need to learn OpenGL (preferrably with GLSL), ...

1

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. First look on the web. There are plenty of tutorials that explain to you exactly what you to do (which is to raytrace texture mapped objects). While it's great ...

1

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 interger to float and adding dx'. (picture 1)

1

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 [1], if I had I would have seen my mistake. Still the method from [2] is interesting and is described below. Additional note: To map a uniform point set from ...

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