Open moradin opened 9 years ago
I like the idea of this but the only thing is I'd want to be careful that the feature isn't too particularly specific to a narrow set of use-cases. It seems reasonable to me that most vertex compression would just be a linear transform, but I don't know for sure.
Possibly the more flexible version of this would be to allow you to write custom unpack shaders - exactly like the texture viewer has custom visualisation shaders, except for this case you'd write a vertex shader. You'd get all the constant buffers and resources bound from the drawcall's vertex shader, plus an extra constant buffer that contains the data for the MeshViewer's current camera.
That way you can do whatever crazy stuff you like - including if there's some secondary data you want to visualise that isn't just a straight component, might be useful for visual debugging rather than stepping through a single vertex for debug.
Both sound good to me. I would imagine most people try to keep the unpack overhead minimal and going above a simple mad doesn't necessarily pay off in quality or precision.
Since I'm compressing all my vertices I have a hard time previewing them in the VS Input view. The decompression is just a MAD with 2 vectors that are stored in a mesh specific constant buffer. It would be great if the mesh preview would support adding a scale and bias. If I will have some free time I will try to make this myself but that might take a few weeks before I get there so I'm just adding this here if anyone can help out.