Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create your texture from the video frame and then LockRect it and copy the data in. You now have the data in a D3D9 Texture.</p> <p>Loading a pixel shader is easy. Use <a href="http://msdn.microsoft.com/en-us/library/bb172768%28v=vs.85%29.aspx" rel="nofollow">D3DXCreateEffectFromFile</a>.</p> <p>Rendering a quad with a texture on it can easily be learnt by looking at any tutorial on the internet. Try this one:</p> <p><a href="http://www.drunkenhyena.com/cgi-bin/view_cpp_article.pl?chapter=2;article=30" rel="nofollow">http://www.drunkenhyena.com/cgi-bin/view_cpp_article.pl?chapter=2;article=30</a></p> <p>If you set it up right the effect will automatically be applied to the quad.</p> <p>Edit: From looking at your code it appears you don't set the world, view or projection matrices. Nor do you set your viewport.</p> <p>Firstly you should set them all the matrices to identity. This means that the vertices you pass in will shift through the pipeline without any changes. You then need to bear in mind that the "projection" space runs from -1 to 1 (left to right bottom to top).</p> <p>Therefore your need to define your quad as follows:</p> <pre><code>ver[0] = new CustomVertex.PositionTextured(-1, 1, 0, 0, 0); ver[1] = new CustomVertex.PositionTextured(1, 1, 0, 1, 0); ver[2] = new CustomVertex.PositionTextured(-1, -1, 0, 0, 1); ver[3] = new CustomVertex.PositionTextured(1, 1, 0, 1, 0); ver[4] = new CustomVertex.PositionTextured(1, -1, 0, 1, 1); ver[5] = new CustomVertex.PositionTextured(-1, -1, 0, 0, 1); </code></pre> <p>You then need to set your viewport as follows (This is a C++ Viewport set as i haven't really used C# much):</p> <pre><code>D3DVIEWPORT9 vp; vp.X = 0; vp.Y = 0; vp.Width = 1920; vp.Height = 1080; vp.MinZ = 0.0f; vp.MaxZ = 1.0f; pDevice-&gt;SetViewport( &amp;vp ); </code></pre> <p>At this point I would expect to see the whole texture on screen.</p> <p>Btw Im also not entirely sure what you are doing in the SetTextureStageState ... Are you just saying "Select Arg1". Are you passing in the equivalent of D3DTA_TEXTURE to COLOR ARG 1?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload