Simon F
  • Member for 6 years, 4 months
  • Last seen this week
  • You 'K?
2 answers
15 votes
4k views
How does hardware texture compression work?
32 votes

"How (hardware) texture compression works" is a large topic. Hopefully I can provide some insights without duplicating the content of Nathan's answer. Requirements Texture compression typically ...

View answer
4 answers
23 votes
6k views
Why do T-junctions in meshes result in cracks?
Accepted answer
23 votes

lhf's answer is good from the perspective of tessellation, but these can occur with simpler triangle mesh use cases. Take this trivial example of three, screen-space triangles, ABC, ADE and DBE... ...

View answer
5 answers
27 votes
11k views
Does a sphere projected into 2D space always result in an ellipse?
Accepted answer
20 votes

Assuming a perspective projection and a view point external to the sphere, then the 'boundary' formed by the view point and the circle on the sphere which forms the horizon WRT the view point, will be ...

View answer
2 answers
10 votes
1k views
Is using many texture maps bad for caching?
Accepted answer
16 votes

Just adding to imallett's answer, it is true that increasing the number of accesses to different texture data in a shader will increase pressure on the GPU cache(s), but there are several other ...

View answer
2 answers
8 votes
3k views
Why do GPUs divide clip space Z by W, for position?
13 votes

If you are doing a perspective image and your model has implicit intersections then, if you use "linear Z", those intersections will appear in the wrong places. For example, consider a simple ground ...

View answer
1 answers
11 votes
958 views
Why do adjacent triangles never overlap when rasterized?
Accepted answer
10 votes

This is the same problem as discussed in What are sample gaps during scan conversion? Briefly, rasterisation - at least with the majority of hardware systems - tests at a single 'infinitesimal' point ...

View answer
1 answers
9 votes
441 views
What are sample gaps during scan conversion?
Accepted answer
8 votes

Sample gaps will occur if you don't do things "properly". In OpenGL or D3D, assuming a consistent winding order, if you have triangles ABC and CBD, then when a sample point - that is a test during ...

View answer
3 answers
6 votes
3k views
Gaussian blur with transparency
7 votes

I apologise for only skimming through your question/answer and the links you gave but I thought it would be a good idea to post what needs to be done to correctly do any blending and/or filtering on ...

View answer
1 answers
4 votes
330 views
Double buffering always necessary?
Accepted answer
7 votes

Indeed there are/were 'just in time' renderers. For example, Dreamcast (PowerVR CLX2) had a mode where the 'frame buffer' only had to be a few rows of tiles in size. The system would be rendering ...

View answer
1 answers
5 votes
705 views
Blur with alpha transparency
7 votes

Two suggestions: If your data is from an image you are displaying on a standard monitor, the chances are it is (or you are implicitly assuming that it's) in sRGB format. This means that the colour ...

View answer
2 answers
3 votes
245 views
Why are texture coordinates often called UVs?
6 votes

This is not a definitive answer, but it is generally accepted that Ed Catmull introduced Texture Mapping in his 1974 thesis, "A SUBDIVISION ALGORITHM FOR COMPUTER DISPLAY OF CURVED SURFACES" ...

View answer
2 answers
6 votes
167 views
Why replicating the higher bits of RGB565 when converting to RGBA8888?
6 votes

There's actually a reasonably good mathematical reason for doing bit replication: First note that the n-bit string, $N$, actually represents the value $\frac{N}{2^n-1}$ and we want to produce the m-...

View answer
1 answers
4 votes
234 views
I dont understand how a GPU computes and branches, could you please help me fix this shader preformance
6 votes

Rather than trying to speed up your shader by fiddling with the code, can I suggest you make use of the GPU's inherent ability to rapidly fill polygons? This will allow it to eliminate the vast bulk ...

View answer
1 answers
8 votes
975 views
How should I fill a shape consisting of Bezier curves and straight lines?
Accepted answer
6 votes

If you are in a hurry to get your renderer working and you already have the filled polygonal routine functioning correctly, can I suggest an alternative, possibly easier approach? Though I'm not ...

View answer
2 answers
6 votes
3k views
Uses for Stencil Buffer
6 votes

Another use, that I think Dan didn't mention, is for filling non-convex polygons, e.g, and The stencil can be used to implement the fill rule which is typically either odd/even (as used in these ...

View answer
2 answers
7 votes
706 views
How to handle a parametric equation in raytracing?
6 votes

Many years ago I worked on a ray tracer that handled parametric surfaces, so this is unlikely to be state of the art, but, IIRC, I used a combination of interval arithmetic with (binary?) subdivision ...

View answer
1 answers
4 votes
1k views
How to implement Constructive Solid Geometry in ray tracing with implicit surfaces (spheres)?
Accepted answer
6 votes

I'm not sure what exactly you are asking but, IIRC, to do CSG with ray tracing, you maintain not just the closest intersection with an object, but a list of ordered pairs of [Inpoint, OutPoint] '...

View answer
1 answers
6 votes
423 views
Algorithms for scan converting b-spline and nurbs
6 votes

Ignoring Non-uniform B-splines (rational or not), I have had some experience with rasterisation of Beziers and, since there is a trivial mapping from Uniform B-Splines to Beziers, those too. I have ...

View answer
4 answers
16 votes
12k views
What does GPU assembly look like?
5 votes

As others have said, GPUs expose a higher-level language, which allows multiple different architectures i.e. different vendors and different GPU generations, to all support the same applications. [...

View answer
3 answers
6 votes
776 views
Turn an enclosed region into a triangle mesh
5 votes

If your aim is just to fill the region and since you say you're using opengl, an alternative to Nathan's suggestion of using a triangulation algorithm++, is to use the stencil buffer. Assuming you ...

View answer
2 answers
2 votes
638 views
How to use multithreading in 3D software renderer to speed up fetching texture values
5 votes

It could be that you have to overcome a different bottleneck first. Have you ever read Jim Blinn's "The Truth About Texture Mapping"? (I had a quick search to see if I could find a non-paywalled ...

View answer
2 answers
8 votes
172 views
Are vertices reprocessed per-poly for indexed meshes?
Accepted answer
5 votes

The key expression you may be looking for is "Post Transform Cache". This is usually effective because of the natural vertex reuse, but reordering your mesh, e.g. with Hoppe's method (note: the page ...

View answer
3 answers
3 votes
333 views
Surface shading on an triangle
5 votes

That completely depends on how you are computing the shading. If you are then just linearly interpolating the shaded colours across the triangle, i.e. Gouraud shading then, clearly, the answer is "no"....

View answer
2 answers
9 votes
482 views
Reliable test for intersection of two Bezier curves
5 votes

[Disclaimer: I think the following should work but have not actually coded it myself] I couldn't think of a "trivial" method of producing a yes/no answer but the following would be a reasonable ...

View answer
2 answers
7 votes
809 views
Moires patterns despite using mipmaps
Accepted answer
5 votes

Two things come to mind: When generating your smaller mip map levels try to avoid using a simple 2x2 box filter because, though cheap and cheerful, they do a really poor job of removing high ...

View answer
5 answers
20 votes
3k views
How to raytrace Bezier surfaces?
5 votes

Another option, which I used a couple of decades ago (yikes!), is to use Toth's scheme from 1985 that employed interval arithmetic to narrow down the search space. IIRC, eventually it will resort to ...

View answer
1 answers
4 votes
482 views
Conversion from cubic catmull-rom spline to cubic b-spline
4 votes

Quoting the comments above for context: Just to confirm, are you asking, given a set of $N$ CatRom control points, $$\{CR_0, CR_1, CR_2, CR_3 ... CR_{n-1}\}$$ forming a piecewise curve, what is the ...

View answer
3 answers
2 votes
646 views
How is a projector handled in a Ray Tracing environment?
4 votes

Just treat it as a special case of a point light + shadow ray. Whenever a ray hits the screen (or any surface onto which you'd like to project the slide), fire another "projector" ray back towards the ...

View answer
3 answers
8 votes
2k views
Does premultiplied alpha give order independent transparency?
4 votes

Alan, Jim Blinn's compositing article also explains why premultiplied is the correct way to do any filtering of transparent images.

View answer
1 answers
3 votes
454 views
What happened to my texture mapping?
4 votes

You aren't doing perspective correct texturing. At each pixel, $(X,Y)$, you need to be computing U and V with the equivalent of: $U=\frac{aX+bY+c}{pX+qY+r}$ $V=\frac{dX+eY+f}{pX+qY+r}$ The ...

View answer