Search the Community
Showing results for tags 'structuredbuffer'.
-
Add StructuredBuffer support to material file/api
helmut.bressler posted a topic in Feedback for UNIGINE team
Hello, it seems to me that the material API and the material file offers only support for Textures and Uniform/Constant buffers as shader resources. It would be great if support for Structured Buffers could be added, i.e. for the material file the following xml tag: <structuredBuffer unit="43" name="myBufferData"/> and for the Material API the following methods: void setStructuredBuffer( int num, const Ptr<StructureBuffer> & structBuffer); Ptr<StructureBuffer> getStructuredBuffer( int num ); Many thanks, Helmut -
Writing to a StructuredBuffer from a Vertex/GeometryShader (DX11)
helmut.bressler posted a topic in Rendering
Hello, I would like to write the vertices from a ObjectMeshSkinned into a StructuredBuffer (with bone transforms and blend shapes applied) for further processing. I need to do that per frame and I found that doing that on the CPU with getSkinnedVertex() and getSkinnedTangent() is too slow unfortunately. The best place to do that seems to me to 'intercept 'the skinned vertices in a VertexShader, which writes them to a structured buffer through an unordered access view. I have tried to utilise the Object::render() method for that purpose, but it seems this method doesn't trigger any draw calls: Game* game = Game::get(); auto player = game->getPlayer(); auto camera = player->getCamera(); texturerender->enable(); texturerender->setUnorderedAccessBuffer(1, structuredBuffer); texturerender->setColorTexture(0, texture); objMeshSkinned->render(Render::PASS_AUXILIARY, 0); //viewport->renderNode(camera, objMeshSkinned->getNode()); works but I don't get the structured buffer bound as unordered access view texturerender->disable(); I have tried with other render passes as well. (Shaders are not modified yet, I first want to check if the structured buffer is bound as unordered access view somewhere) Many thanks and cheers Helmut