glsl - How send recursive data structure to OpenGL shader? -
how can send recursive data structure, octree, opengl glsl shader? think, can send array of nodes , use indexes instead of pointers, idea? there other options it?
gpu ray tracing uses recursive data structures such triangles in kd-trees or sparse voxel octrees.
in shader can use 1d texture sampler though array, making easy jump around.
however, performance suffers. shaders in batch (warp or whatever card terms it) work in lock-step, if 1 fragment requires recursing ten steps in tree other fragments in batch have wait fragment ten random-memory-accesses before can proceed.
gpus work best when given list of triangles rasterise.
Comments
Post a Comment