Click to See Complete Forum and Search --> : EVR and Pixel Shaders


Ellekz
January 15th, 2010, 10:35 AM
Hey guys,

I'm relatively new to the whole DirectShow thing. I've written a small video player application for my own purposes (it uses EVR under Vista/Win7) and now I'd like to use simple pixel shaders for post processing.

I've been googling for quite some time now. From what I understand, I basically need to compile the code via DX3DCompileShader(), then IDirect3DDevice9::CreatePixelShader() and IDirect3DDevice9::SetPixelShader().

However, I have no idea how to get from my built graph (SourceFilter -> VideoDecoder -> EVR Renderer) to that. I guess I somehow have to create my own IDirect3DDevice9 (or get it from the EVRRenderer?), set it up with the shader calls and make the EVR Renderer somehow use that device :confused:

Like I said, I have no real clue what to do and any help would be really great :)

Ellekz
January 15th, 2010, 05:02 PM
Okay, I was able to compile the shader file, retrieve the IDirect3DDevice9 interface, create the IDirect3DPixelShader9 and assign the pixel shader via IDirect3DDevice9::SetPixelShader(). However, it doesn't seem to work (the video stays the same and all HRESULTs from all calls were positive).
My guess is that SetPixelShader() is always called right before each frame is "presented" to the graphics card or something? So, do I actually need to write my own EVR custom presenter for this to work?