0

I want to do some raytracing from a fragment shader. I don't want to use a compute shader as I need to do rasterization anyway and want to do some simple raytracing as part of the fragment shader evaluation in a single pass. Simple in the sense as the mesh I want to raytrace against consists of only a few hundred triangles. I have written plenty of shaders and also wrote (cpu based) raytracers, so I'm familiar with all the concepts. What I wonder though is what's the best representation for the mesh plus acceleration structure (some kd-tree probably) to pass it to the fragment shader? most likely they'd be converted to textures in some way (like three pixels for example to represent the positions of a triangle).

LJᛃ
  • 7,655
  • 2
  • 24
  • 35
matthias_buehlmann
  • 4,641
  • 6
  • 34
  • 76

0 Answers0