Henri Verbeet wrote:
Well, you can't set a VBO as rendertarget directly, but you can copy the FBO data into a PBO, which you can bind as a VBO. That's pretty legitimate in OpenGL. But I was wondering how hard it would be to use something like that for ProcessVertices.
Well, you would get the rendered pixels' data written to the VBO then, right?
To use this for ProcessVertices one would have to have a bijective relation between pixel's and processed vertices; p.e. pass the transformed vertex coordinates in varying variables and use'em as the color components and have the pixels stored in the order the vertices are so we can tell afterwards from what vertex they originate, in passing the vertex index as an attribute and so generate appropriate vertex coords ... theoretically.
I don't think its easy or even possible to have exactly one pixel per vertex at sequential positions in the pixel buffer, or is it (using points and knowing the resolution etc.) ?
Am Dienstag 16 Januar 2007 18:01 schrieb Christoph Bumiller:
Henri Verbeet wrote:
Well, you can't set a VBO as rendertarget directly, but you can copy the FBO data into a PBO, which you can bind as a VBO. That's pretty legitimate in OpenGL. But I was wondering how hard it would be to use something like that for ProcessVertices.
I don't think its easy or even possible to have exactly one pixel per vertex at sequential positions in the pixel buffer, or is it (using points and knowing the resolution etc.) ?
I think with R2VB the pixel shader(which writes to the vb) has a resolution for the target vertex buffer. I gather it will be a bit tricky for the programmer of the application to match color components to vertex attributes, but that is nothing we have to care about. I think we can just copy the data from the fbo to the vbo(or pbo or whatever buffer object)
But I prefer to run ProcessVertices in Software. I have not seen a d3d8 or d3d9 application yet which uses it, only some d3d7 apps(Half-Life, Anarchy Online, Shadow Volume 2 sdk demo). But it would be a nice way to read the result of a vertex shader back and compare it in a test case. I don't think it will be practical use for any d3d8/9 app.
By the way, the ProcessVertices implementation in wined3d is wrong. It treats the Vertex Declaration it gets as a vertex buffer, which is wrong. It needs some d3d9 tests too, I gather.