Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Pipeline Configuration for Post-Processing Shaders


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
4 replies to this topic

#1 markypooch   Members   -  Reputation: 476

Like
0Likes
Like

Posted 23 July 2014 - 07:00 PM

Hello all,

 

This is a new concept for me, so I apologize if I come across as short-sighted or noobish,

I am writing a post-process shader that will take a scene that has been rendered to a texture and blur it.

Since this blur shader only operates on the texture, there is no need for a Vertex Shader.

 

So, How do I configure the Pipeline?

 

I know with a typical effect, you usually have two shaders, a Vertex Shader and a Pixel Shader.

So I would prime the API like so,

 

d3dContext->IASetInputLayout("Parameters");

d3dContext->IASetIndexBuffer("Parameters");

d3dContext->IASetVertexBuffer("Parameters");

d3dContext->IASetPrimitiveTopology("Parameters");

 

d3dContext->VSSetShader();

d3dContext->PSSetShader();

 

///////////////////////////////////////////////////////////////////////////

//Binding of worldViewProj Matrices and assests to their respective Constant Buffers

////////////////////////////////////////////////////////////////////////////

 

And then eventually,

 

d3dContext->draw || d3dContext->DrawIndexed();

 

But with only a pixel shader, I would only need to do this, maybe?

 

d3dContext->IASetInputLayout("Parameters");

d3dContext->PSSetShader();

d3dContext->PSSetShaderResources();

 

d3dContext->Draw();

 

But what would I be drawing! If I don't have a vertex shader I don't need to submit a vertex or index buffer. Nor any of the corresponding matrices.

 

If I don't have a VertexBuffer submitted to D3D, I wouldn't expect the draw call to do anything.

 

But if I don't make this call: d3dContext->Draw();

How is this shader to be executed?

 

I guess i'm asking is how to execute a post-process shader or point me if possible in the right direction for learning how to utilize post-process shaders

 

Thansk for any replies!

 

Marcus

 

 



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 31153

Like
2Likes
Like

Posted 23 July 2014 - 07:07 PM

You still need a vertex shader - the geometry is a quad or triangle that covers your entire screen!

To work without any geometry at all, you'd use a compute shader instead of a pixel shader, an Dispatch instead of Draw.

#3 markypooch   Members   -  Reputation: 476

Like
0Likes
Like

Posted 23 July 2014 - 07:15 PM

You still need a vertex shader - the geometry is a quad or triangle that covers your entire screen!

To work without any geometry at all, you'd use a compute shader instead of a pixel shader, an Dispatch instead of Draw.

tongue.png It's been a looooong day.

 

I knew better, thank you so much.

 

Marcus


Edited by markypooch, 23 July 2014 - 08:25 PM.


#4 mhagain   Crossbones+   -  Reputation: 8147

Like
3Likes
Like

Posted 24 July 2014 - 02:59 AM

Drawing without a vertex buffer is a common idiom for fullscreen quads.  See Using the Input-Assembler Stage without Buffers on MSDN for a description and sample code.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#5 markypooch   Members   -  Reputation: 476

Like
0Likes
Like

Posted 24 July 2014 - 06:52 PM

Drawing without a vertex buffer is a common idiom for fullscreen quads.  See Using the Input-Assembler Stage without Buffers on MSDN for a description and sample code.

Very informative. So Really for my simple Post-Process Shader, I can pretty much skip Buffer submission to D3D and just define my quad in the Vertex Shader...I Like it!

 

I guess my orginal thought regarding Post-Processing is more akin to utilitizing a Compute Shader (Don't know why at the time I thought no Geometry would be involved, It was a looooong day yesterday!)

 

Thanks for the replies, and sorry for the newebish question. it did give me some interesting ideas!

 

Marcus






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