Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


particle system with stream output not working


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 rgc183   Members   -  Reputation: 164

Like
0Likes
Like

Posted 24 July 2014 - 02:00 PM

I am working on particle system using DX11 stream output. But there are some issues with it and not working as expected. Here are the steps I am following.
 
Technique 1: to update stream buffer
1. Create vertex and pixel shader using CreateShader() call. Set pixel shader to null. 
2. create geometry shader using: 
 
    D3D11_SO_DECLARATION_ENTRY pDecl[] =
    {
        
        { 0, "SV_POSITION", 0, 0, 4, 0 },   
        { 0, "VELOCITY", 0, 0, 3, 0 },     
        { 0, "AGE", 0, 0, 1, 0 },    
    { 0, "TYPE", 0, 0, 1, 0 }
    };  
       
       hr=pD3dDevice->CreateGeometryShaderWithStreamOutput(blob->GetBufferPointer(), blob->GetBufferSize(),pDecl, sizeof(pDecl)/sizeof(D3D11_SO_DECLARATION_ENTRY),NULL,0,0,NULL,&GeometryShader);
 
3. Create two buffers with flags: `D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_STREAM_OUTPUT` .
 
technique 2: to render particles
1. compile the shaders using createshader call. 
 
Render:
 
1. set pixel shader to NULL and disable rasterization using `OMSetDepthStencilState`. 
2. update one of the buffers by generating particles in geometry shader.
3. Set both buffer targets to NULL.
4. Use the above buffer to render particles.
5. Set both buffer targets to NULL.
6. swap the buffers.
 
The problem is that something going wrong while reading from stream buffers. Both the techniques when run individually, works fine and gives correct output but problem arises when stream buffer comes into the picture. 
Is there anything i am missing?

Edited by rgc183, 24 July 2014 - 02:04 PM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS