# Tag Info

## Hot answers tagged scene-graph

9

Doing math with uniforms is a shader won't usually get you any performance over doing it on the CPU. A CPU isn't slower than a GPU at doing matrix math, it just isn't structured so as to do large amounts of math in parallel. But you have to actually do that large amount of math to get a win. Sending extra data to the GPU just to have the GPU multiply two ...

7

Short answer: Yes, It can be done. But no one does so. Long answer: Scene graphs can be stored and processed on a GPU using OpenCL/WebCL. But it is not practical to do so. Updating scene graphs (a tree not in flat memory) on a GPU is slow, and processing it on a GPU is also slow (again, the tree is not in flat memory), while computing transformation ...

7

As far as I can tell, the main advantage of half-edge is that traversal can be a bit simpler due to a guarantee of edges having a consistent orientation within each face. Consider the problem of iterating over all the vertices or edges of a given face, in counterclockwise order. In the half-edge structure, this can be done by starting with an arbitrary half-...

5

Rarely, if ever. You half-answered it in your own question: a vertex shader runs once per-vertex, a fragment shader once per-fragment. If you're not doing something that's unique to that vertex or fragment, then you're doing literally the exact same thing every time you invoke a shader. That doesn't sound more efficient to me.

4

The easiest way to do this is by rendering the 3D scene the way you usually would through OpenGL, using whatever 3D Python library you already have loading the scene. Instead of the perspective camera you would usually use, render through an orthographic camera looking down on the scene from above (making sure the camera plane is above any part of the scene)....

4

Using OpenGL, or any such library, you could transform your scene with an orthogonal matrix and move your camera view point to be looking above (and parallel to) the scene (in a vertex shader) and then use an empty fragment shader which is going to write to the depth buffer of the current attached framebuffer. Finally retrieving this depth buffer gives you ...

4

It depends on your GPU. "Tiled renderers" do this for you so the benefit of doing it yourself is minimal (unless you have some more efficient way of knowing the order, e.g. sorting a fixed-viewpoint scene in advance). In this case, your best way of keeping efficiency is by ensuring they are allowed to draw the scene all in one go by avoiding glReadPixels and ...

2

Not 3D as such, but it seems in 1963 Ivan Sutherland's seminal "Sketchpad" (and wikipedia) had instancing. eg. See "Chapter VI RECURSIVE FUNCTIONS" of the 2nd reference. IIRC somewhere there's a video of it in action - it made me annoyed as to how some of today's vector drawing tools don't seem to be able to do some of what sketchpad ...

1

Yes, scene graphs can be non-tree graphs. Your question is a little vague, but assuming you're talking about something like the scene graph in rendering a frame of video, for say a feature film, then yes, there are often references between objects. For example, in a compositing application, you might have a piece of footage with an effect applied. The effect ...

1

A gpu only cares about the full transform used for a particular object. It's much better that the CPU (webworker) collates the transformation hierarchy into a single matrix. What you can do is use UBO and create a block where the final transform is stored and as you traverse the scenegraph update the data on the gpu. In the vertex shader you then index into ...

1

A prism is a polyhedron with a polygonal base, another parallel base of the same shape, and joining faces between corresponding edges of the two base faces. The word "prism" is commonly used to describe a right prism with base faces perpendicular to the joining faces. In this case the joining faces are also rectangles, and so a rectangular right prism is ...

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