3 ms·
Not everything has to be drawn as a triangle. You can apply a fragment shader symmetrically to every pixel in a framebuffer, instead of using geometry to apply
by oofabz 11y ago
Not everything has to be drawn as a triangle. You can apply a fragment shader symmetrically to every pixel in a framebuffer, instead of using geometry to apply different fragment shaders within each triangle.
This technique is commonly used to post-process already-rendered scenes, like with a tone mapping shader or depth of field effects. But for simple scenes you can also put an entire rendering engine in the fragment shader, typically using ray marching.
Here are some examples of this technique being used to draw voxels:
https://www.shadertoy.com/results?query=voxel https://www.shadertoy.com/results?query=voxel
- Cacti 11y agoThat is a very good point, I forgot about that option. Do you think this will be a realistic option at some point for wide-spread use? The stuff I saw from NVIDIA looked like they think a hybrid approach (voxels are shoveled to the GPU in a octree arrangement to handle ray marching, but the output is traditional triangles) would work best for efficiency reasons.