How converts to this?

How converts to this?

Post by sunghyuck ki » Fri, 27 Jun 2003 11:41:34



DX8.1 Vertex Shader Declaration code

DWORD  declBasicTr[] =
      {
      D3DVSD_STREAM(0),
      D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3 ),  // position
      D3DVSD_REG(D3DVSDE_BLENDWEIGHT, D3DVSDT_FLOAT2 ), // 2 blending
weights
      D3DVSD_REG(D3DVSDE_BLENDINDICES, D3DVSDT_UBYTE4 ), // 4 indices
      D3DVSD_REG(D3DVSDE_NORMAL, D3DVSDT_FLOAT3 ),  // normal for light
calcula
      D3DVSD_REG(D3DVSDE_TEXCOORD0,D3DVSDT_FLOAT2 ),  // texture
co-ordinates
      D3DVSD_END()
     };

how convert to DX9.0?

please answer me.

 
 
 

How converts to this?

Post by Cronus3 » Fri, 27 Jun 2003 11:58:17


Look up D3DVERTEXELEMENT9.


Quote:> DX8.1 Vertex Shader Declaration code

> DWORD  declBasicTr[] =
>       {
>       D3DVSD_STREAM(0),
>       D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3 ),  // position
>       D3DVSD_REG(D3DVSDE_BLENDWEIGHT, D3DVSDT_FLOAT2 ), // 2 blending
> weights
>       D3DVSD_REG(D3DVSDE_BLENDINDICES, D3DVSDT_UBYTE4 ), // 4 indices
>       D3DVSD_REG(D3DVSDE_NORMAL, D3DVSDT_FLOAT3 ),  // normal for light
> calcula
>       D3DVSD_REG(D3DVSDE_TEXCOORD0,D3DVSDT_FLOAT2 ),  // texture
> co-ordinates
>       D3DVSD_END()
>      };

> how convert to DX9.0?

> please answer me.


 
 
 

How converts to this?

Post by Francisc » Fri, 27 Jun 2003 12:09:33


Look at SDKdoc->DirectX Graphics->Programming Guide->Programmable
Pipeline->VertexShaders->Decoupling Vertex Shaders and Vertex Declarations.

There is a section on mapping DX8 to DX9.

Francisco


Quote:> DX8.1 Vertex Shader Declaration code

> DWORD  declBasicTr[] =
>       {
>       D3DVSD_STREAM(0),
>       D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3 ),  // position
>       D3DVSD_REG(D3DVSDE_BLENDWEIGHT, D3DVSDT_FLOAT2 ), // 2 blending
> weights
>       D3DVSD_REG(D3DVSDE_BLENDINDICES, D3DVSDT_UBYTE4 ), // 4 indices
>       D3DVSD_REG(D3DVSDE_NORMAL, D3DVSDT_FLOAT3 ),  // normal for light
> calcula
>       D3DVSD_REG(D3DVSDE_TEXCOORD0,D3DVSDT_FLOAT2 ),  // texture
> co-ordinates
>       D3DVSD_END()
>      };

> how convert to DX9.0?

> please answer me.

 
 
 

1. Convert a DIB to a DDB (Help converting C++ to VB)

I need to convert a DIB to a DDB and all I have is the handle to the DIB
I found C++ code to do it, but I don't know C very well at all.
I've converted what I could to VB code, I need a little help with the rest.

All the stuff in RED is still C...can someone please convert it for me, or
help me with VB code to do it otherwise.

Private Function DibtoDDB(hDIB As Long) As Long
Dim lpbi As BITMAPINFOHEADER
Dim lpbi2 As BITMAPINFO
lpbi2.bmiHeader

Dim hbm As BITMAP
Dim pal As Long, poldpal As Long, dc As Long

    If (hDIB = 0) Then Exit Function
    lpbi = (LPBITMAPINFOHEADER)hDIB;
    Dim nColors As Long

    nColors = lpbi.biClrUsed ? lpbi.biClrUsed : 1 << lpbi.biBitCount

    Dim bmInfo As BITMAPINFO
    BITMAPINFO &bmInfo = *(LPBITMAPINFO)hDIB ;
    LPVOID lpDIBBits;
    if  bmInfo.bmiHeader.biBitCount > 8  then
        lpDIBBits = ((bmInfo.bmiColors + bmInfo.bmiHeader.biClrUsed) + _
            ((bmInfo.bmiHeader.biCompression == BI_BITFIELDS) ? 3 : 0));
    Else
        lpDIBBits = bmInfo.bmiColors + nColors
   End if
'    // Create and select a logical palette if needed
    If (nColors <= 256 And (dc.GetDeviceCaps(RASTERCAPS) And RC_PALETTE))
Then

        Dim nSize As Long
        nSize = Len(LOGPALETTE) + (Len(PALETTEENTRY) * nColors)
        LOGPALETTE *pLP = (LOGPALETTE *) new BYTE[nSize];

        pLP.palVersion = &H300
        pLP.palNumEntries = nColors

        For i = 0 To nColors - 1
            pLP.palPalEntry(i).peRed = bmInfo.bmiColors(i).rgbRed
            pLP.palPalEntry(i).peGreen = bmInfo.bmiColors(i).rgbGreen
            pLP.palPalEntry(i).peBlue = bmInfo.bmiColors(i).rgbBlue
            pLP.palPalEntry(i).peFlags = 0
        Next

        pal.CreatePalette(pLP)
        delete[] pLP;

'        // Select and realize the palette
        poldpal = dc.SelectPalette(pal, False)
        dc.RealizePalette ()
    End If

    hbm = CreateDIBitmap(dc.GetSafeHdc(), lpbi, CBM_INIT, lpDIBBits,  lpbi,
DIB_RGB_COLORS );
    If pal.GetSafeHandle() Then dc.SelectPalette(poldpal, False)

    DibtoDDB = hbm

End Function

2. Flattening QTVR?

3. .cph convert - can someone convert?

4. MAC --> PC Color fidelity?

5. Q:Is there any converting tools to convert Explore, Wavefront , SoftImage format to Renderman?

6. Zebra stripes

7. Convert Quark

8. World Weather Database

9. converting MAC Graphics files to PC

10. Converting bitmaps to 8bit

11. Converting jpeg to mpeg

12. Converting .art files into .jpg files

13. My images keep getting converted to VB Script