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).
Asked
Active
Viewed 86 times
0
-
The answer to this question depends a lot on the feature-set of the API you're using. – LJᛃ Feb 10 '20 at 15:07
-
@LJ i'd like to target a low feature set. maximally ES 3.0 – matthias_buehlmann Feb 10 '20 at 15:46