20 votes
Accepted

Difference between BVH and Octree/K-d trees

Well I researched quite a lot after that and this paper helped a lot. "Space Subdivision algorithms" by Macdonald 1988. So just summing what I understood. Some of them are obvious reasons but after ...
gallickgunner's user avatar
13 votes
Accepted

What is the definition of a Half Edge?

A half-edge is an edge split along its length, and having a directional component, that is, a beginning vertex and an end vertex. Where two polygons share an edge, each polygon gets a single half-edge ...
russ's user avatar
  • 2,382
9 votes

Why are oct trees so much more common than hash tables?

Lots of things here. "When reading papers". What papers? If the topic of the paper is about something other than the spatial partitioning structure, it could be fair to use whatever knowing that the ...
Angelo Pesce's user avatar
8 votes
Accepted

What is the benefit of using Half Edge over Winged Edge?

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 ...
Nathan Reed's user avatar
7 votes
Accepted

Why sending data from gpu to cpu is slower than cpu to gpu?

The actual sending of data is the same. The PCIe bus is the same speed in both directions. However when programming there is a big difference namely that when you send you can immediately start doing ...
ratchet freak's user avatar
6 votes
Accepted

Dealing with wasted space when using SIMD on CPU for vector maths

There's a third option you've neglected. Because of how graphics APIs work, typically you have to copy the data between the CPU and GPU anyway - even if you're on a mobile SoC where they share the ...
Dan Hulme's user avatar
  • 6,770
5 votes
Accepted

Why are oct trees so much more common than hash tables?

My 2 cents from writting the Chipmunk2D physics engine is that spatial hashing is great when you have a lot of objects that are all the same size. I had a demo 10 years ago that ran with 20k ...
slembcke's user avatar
  • 166
5 votes

The meaning of early ray termination and front-to-back traversal in ray tracing

Front-to-back traversal is the idea that when traversing a ray through the acceleration structure, we want to examine nodes that are in front, i.e. closer to the camera, before other nodes. If you ...
Nathan Reed's user avatar
4 votes

Is it possible to store the plain buffer data in gltf files?

Embedding human readable data is not supported. However you can put the data into a data uri to store the data inline in base64 format. ...
ratchet freak's user avatar
3 votes
Accepted

Why is pixel 0,0 at the top left of some formats and bottom left of others?

It comes down to history. The original interfaces for drawing stuff on the screen were for text, not images. Since the people who designed those early computers spoke languages that are read left-to-...
Dan Hulme's user avatar
  • 6,770
3 votes
Accepted

Creating glsl library

GLSL does not support C++ style namespaces. You might want to do some regex magic before parsing the shader, replacing '::' with '_' or something. You might want to have a preprocessor of sorts - or ...
Stephanus Tavilrond's user avatar
3 votes
Accepted

Which coding strategies exist to handle opengl texture size limit?

First, a correction: GL_MAX_TEXTURE_SIZE contains 3379 No, it does not. That is the value of the GL_MAX_TEXTURE_SIZE enumerator (0x0D33). The actual ...
Nicol Bolas's user avatar
  • 9,752
3 votes

Dealing with wasted space when using SIMD on CPU for vector maths

While the existing answer adress your question quite well, I'd like to add some general advice, even if you might already be aware of that. Rather than just wasting that fourth component on the GPU, ...
Christian Rau's user avatar
2 votes
Accepted

How to generate binary gltf array buffers?

I've finally managed to write the buffers myself using JavaScript. The result is a base64 encoded String, like: ...
q9f's user avatar
  • 703
2 votes

How to generate binary gltf array buffers?

Technically any file format where you can dump the entire file into a VBO and then render from that will work for the .bin files. Unfortunately those formats are less well known than they should be. ...
ratchet freak's user avatar
2 votes
Accepted

Is it possible to store the plain buffer data in gltf files?

It's not possible to store the plain text array buffers in gltf, however, here is the code I use to generate buffers in JavaScript: ...
q9f's user avatar
  • 703
2 votes

is a scene graph actually a tree?

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 ...
user1118321's user avatar
  • 3,401
2 votes
Accepted

How to assign a texture to a single entry of a texture array?

The full explanation of what I was doing wrong is: The depth parameter in the glTexSubimage3D refers to the depth of the data being sent. Since I am trying to ...
Makogan's user avatar
  • 1,696
2 votes

How to assign a texture to a single entry of a texture array?

glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, 894, 894, 0, color_format, GL_UNSIGNED_BYTE, data); You're transmitting 3D data. But you told OpenGL that the 3D ...
Nicol Bolas's user avatar
  • 9,752
2 votes
Accepted

How do you load multiple textures into an array texture with OpenGL?

The memory layout of a (2D) array texture is pretty similar to a 3D texture, with the individual image layers stored one after the other in a big 3D-array of pixels. So that's also how you set them. ...
Christian Rau's user avatar
2 votes
Accepted

Dynamic array approach for GPU buffers

This is a perfectly reasonable thing to do. GPU to GPU copies are fast. This is best suited to API's like Vulkan or DX12 but I don't see any reason why doing it under OpenGL/DX11 wouldn't work. How ...
pmw1234's user avatar
  • 3,129
2 votes

Which provides better intuition: THREE.Geometry or THREE.BufferGeometry?

Note that BufferGeometry still supports both indexed and non-indexed meshes. It contains arrays of vertex attributes and indices, and works in non-indexed mode if the indices array is null. You can ...
Nathan Reed's user avatar
2 votes
Accepted

Smart half edge iteration?

If anyone ever runs into this. There is a mathematical property of the half edge, that makes it such that any proper half edge can be expressed as an even permutation of vertices. This sounds abstract ...
Makogan's user avatar
  • 1,696
2 votes

Smart half edge iteration?

One possibility would be to create a bit array with 1 bit per half-edge. When you start iterating, initialize them all to 1, then clear the bits of each half-edge and its partner as you iterate. The ...
Nathan Reed's user avatar
2 votes
Accepted

Data structure of IFC-files

You need to learn and understand STEP data exchange format (ISO 10303-21) which is the fundamental exchange format which the IFC schema is built on top of. This is no easy feat though, especially when ...
lfgtm's user avatar
  • 446
1 vote
Accepted

Compute shader textures compared 2D float4 arrays

It depends on what you’re doing. If any given thread of your shader is working with data from multiple nearby pixels, like by sampling from fractional between-pixel locations or doing some calculation ...
Noah Witherspoon's user avatar
1 vote
Accepted

How to modify a part of VBO data without Compute Shader or OpenCL?

Is it possible to change the buffer data uploaed directly without uploading the whole data again? "Again"? You didn't upload "the whole data" the first time: ...
Nicol Bolas's user avatar
  • 9,752
1 vote

Dealing with wasted space when using SIMD on CPU for vector maths

The conversion from option A is likely faster than you think. See, for example, Intel's version which claims to do the round trip at 1.5 cycles per vector with AVX. There are also some operations ...
Olivier's user avatar
  • 1,585
1 vote

Data structure and algorithm for clipping triangulation with leaf nodes of an octree

Rather than making one spatial subdivision structure do double duty in representing both the voxels and the triangles, I would suggest creating a separate BVH for the mesh. You can find many articles ...
Nathan Reed's user avatar

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