| |
Post here comments on the VirtualDJ Plugins (audio effects, video effects, video transitions, devices mapper, ...).
We remind you that plugins are downloadable by registered users only. Home users may download - plugins marked home level , pro users may download all plugins.
See the latest plugins submissions
|
|
|
- Topic or forum closed -
|
|
| Author |
- Topic: VirtualDJ Video Plugins - |
djcel
         

|
| Posted Mon 08 Aug 05 @ 04:59:08 |
Since v3.1, there are two kinds of video plugins:
* effect
* transition |
djcel
         

|
| Posted Tue 09 Aug 05 @ 00:06:16 |
Default values of TVertex:
vertex[0].position.x=-1.f;vertex[0].position.y=1.f;vertex[0].position.z=0.5f;
vertex[1].position.x=1.f;vertex[1].position.y=1.f;vertex[1].position.z=0.5f;
vertex[2].position.x=-1.f;vertex[2].position.y=-1.f;vertex[2].position.z=0.5f;
vertex[3].position.x=1.f;vertex[3].position.y=-1.f;vertex[3].position.z=0.5f;
vertex[0].color=D3DCOLOR_RGBA(0xFF,0xFF,0xFF,0xFF);
vertex[1].color=D3DCOLOR_RGBA(0xFF,0xFF,0xFF,0xFF);
vertex[2].color=D3DCOLOR_RGBA(0xFF,0xFF,0xFF,0xFF);
vertex[3].color=D3DCOLOR_RGBA(0xFF,0xFF,0xFF,0xFF);
tx=(float)ImageWidth/(float)TextureWidth;
ty=(float)ImageHeight/(float)TextureHeight;
vertex[0].tu=0.f;vertex[0].tv=0.f;
vertex[1].tu=tx;vertex[1].tv=0.f;
vertex[2].tu=0.f;vertex[2].tv=ty;
vertex[3].tu=tx;vertex[3].tv=ty;
NB: 0xFF = 255
x : to the right
y : to the up
z : to the back |
djcel
         

|
| Posted Tue 09 Aug 05 @ 05:08:48 |
For Transition plugins:
virtual HRESULT __stdcall Compose(int crossfader,HRESULT(__stdcall *RenderSurface[2])(),TVertex *vertices[2])=0;
crossfader : value of the video crossfader
RenderSurface[0]() : function to show the left deck video
RenderSurface[1]() : function to show the right deck video
vertices[0] : vertices for left video
So you have for left deck:
vertices[0][0] : top left corner
vertices[0][1] : top right corner
vertices[0][2] : bottom left corner
vertices[0][3] : bottom right corner
vertices[1] : vertices for right video
So you have for right deck:
vertices[1][0] : top left corner
vertices[1][1] : top right corner
vertices[1][2] : bottom left corner
vertices[1][3] : bottom right corner
Be careful !!
you must restore the vertices if you modify them, and save and restore any directX state you alter during this function. By default, you have:
D3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
D3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
D3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
D3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
D3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
D3DDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
|
djcel
         

|
| Posted Tue 09 Aug 05 @ 05:16:15 |
[b]For effet plugins:[/b]
vertices[0] : top left corner
vertices[1] : top right corner
vertices[2] : bottom left corner
vertices[3] : bottom right corner |
djcel
         

|
| Posted Sat 13 Aug 05 @ 20:27:21 |
Some information about Direct3D (now renamed DirectGraphics) in DirectX:
(Copyright Microsoft DirectX v9.0 help)
IDirect3DDevice9 :
-------------------
Applications use the methods of the IDirect3DDevice9 interface to perform
DrawPrimitive-based rendering, create resources, work with system-level variables,
adjust gamma ramp levels, work with palettes, and create shaders.
IDirect3DTexture9 :
---------------------
Applications use the methods of the IDirect3DTexture9 interface to manipulate a texture
resource.
IDirect3DSurface9 :
--------------------
Applications use the methods of the IDirect3DSurface9 interface to query and prepare surfaces. |
djcel
         

|
| Posted Sun 20 Aug 06 @ 00:28:26 |
Direct3D Help:
* To write text, you can use this example:
(police: height=15, bold, "System")
(text="VirtualDJ")
ID3DXFont* g_pFont = NULL;
D3DXCreateFont( D3DDevice, 15, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "System", &g_pFont );
RECT rc;
// Position on the screen
SetRect( &rc, 15, 15, 0, 0 );
//Show the text, strg, on the screen with a specific color (here yellow)
// Pass in DT_NOCLIP so we don't have to calc the bottom/right of the rect
g_pFont->DrawText( NULL, "VirtualDJ", -1, &rc, DT_NOCLIP, D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ));
* To show a picture, you can use this example: (based on surfaces)
#define DIRECT3D_VERSION 0x9000
#include < d3dx9.h> // We need this header (and not d3d9.h) because of D3DXLoadSurfaceFromFile()
#pragma comment(lib, "d3dx9.lib")
IDirect3DSurface9 *NewSurface;
//--------------------------------------------------------------------------------------------------------
// Init
HRESULT hr;
D3DDISPLAYMODE dm;
hr=D3DDevice->GetDisplayMode(NULL,&dm);
if(FAILED(hr)) dm.Format=D3DFMT_X8R8G8B8;
hr=D3DDevice->CreateRenderTarget(ImageWidth,ImageHeight,dm.Format,D3DMULTISAMPLE_NONE,0, false,&NewSurface,NULL);
if(FAILED(hr)) return hr;
hr=D3DXLoadSurfaceFromFile(NewSurface,NULL,NULL, "picture.jpg" ,NULL, D3DX_DEFAULT, 0,NULL );
if( FAILED(hr) ) return hr;
//----------------------------------------------------------------------------------------------------
// OnDraw(IDirect3DTexture9 *texture,TVertex *vertices)
{
HRESULT hr;
IDirect3DSurface9 *VideoSurface=NULL; // The video surface
hr=texture->GetSurfaceLevel(0,&VideoSurface);
if(FAILED(hr)) return hr;
hr=D3DDevice->StretchRect(NewSurface,NULL,VideoSurface,NULL,D3DTEXF_NONE);
VideoSurface->Release();
if(FAILED(hr)) return hr;
return S_FALSE;
}
//-----------------------------------------------------------------------------------------------
// Exit
if(NewSurface) NewSurface->Release(); |
djcel
         

|
| Posted Sun 20 Aug 06 @ 18:13:13 |
Logics of Video Effects in the new SDK of VirtualDJ v4.x
1) OnLoad()
2) OnGetPluginInfo()
3)OnDxInit()
4) OnStart()
5) OnStop()
6) OnDxClose()
7) Release()
|
djcel
         

|
| Posted Wed 30 Aug 06 @ 01:14:42 |
Video Transition "Cube":
D3DMATRIX newProjection={1,0,0,0, 0,1,0,0, 0,0,1.25,1, 0,0,-0.625,0};
totally equals to:
D3DXMATRIX newProjection;
D3DXMatrixPerspectiveLH( &newProjection, 1.0f, 1.0f, 0.5, 2.5 ); |
djcel
         

|
| Posted Fri 01 Sep 06 @ 21:05:17 |
 |
djcel
         

|
| Posted Sat 02 Sep 06 @ 05:21:36 |
By default:
1) In windows mode: size of the image (in pixels):
ImageWidth= 320
ImageHeight=240
2) Details about the coordinates of the textures:
tx=1.0f => TextureWidth=ImageWidth (in pixels)
ty=1.0f => TextureHeight=ImageHeight (in pixels)
Example: for a zoom, we need TextureWidth >= ImageWidth and TextureHeight >= ImageHeight
=> tx < 1.0f and ty < 1.0f
NB:
tu=(1+x)/2
tv=(1-x)/2
|
|
- Topic or forum closed -
|
|
| | |