So I downloaded the Unity 4 beta, and the first thing I did was dive into the documentation to see exactly what features of DX11 were actually exposed. I was primarily looking for geometry shaders and the ability to have shaders output to vertex buffers (known as transform feedback in OpenGL), as these are the primary features necessary to implement fast marching cubes in the GPU.
Unfortunately, I found little of use in the documentation. I was able to find forum posts covering geometry shaders, but I can’t find any mention of transform feedback or anything equivalent anywhere. Does anybody know if this is possible in Unity 4?
Edit: Okay, so it looks like what I’m looking for may be what Unity call a “compute shader”. Still need to dig in to whether they actually do what I need.
Bumping this, because it turns out that Compute Buffers can’t quite accomplish all I need (though it handles a lot of it).
When working directly in OpenGL or Direct3D, it’s possible to take the output of the vertex/tesselation/geometry shaders, and instead of forwarding them on to a fragment shader for final rendering, instead store them straight into a VBO for later use. Then you can render the mesh in that VBO with a different shader.
What I want to do, specifically, is run my vertex and geometry shaders to generate a mesh, and then render that mesh with all the fancy lighting and whatnot that I can get out of the standard Unity shaders. Unless I can dump the output of my shaders into a VBO, associated with a Mesh object in Unity, then my only option is to try and re-implement all of that myself.