Coffeehouse Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

WPF 3D Vertex Shader Support

Back to Forum: Coffeehouse
  • User profile image
    indiegamedev

    Hi guys,

    In WPF 3.5 SP1, there is a directx shader compiler fxc.exe in the utilities folder of the directx feb 2010 release. From what I have found so far, there is no Vertex Shader support in WPF as of yet, only pixel shader for 2d objects. Can someone confirm this?

     

    Also I have someone wanting to build a control in WPF that would read Collada 3d Models and display them in WPF. They want to have normal maps, bump maps, specular maps, cube maps implemented as well. First of all my knowledge about shaders tells me without a vertex shader you can't render normal maps or of the mappings on the 3d model.

     

    Input would be appreciated.

  • User profile image
    rhm

    Yeh, the shader support in WPF is just pixel shaders for doing 2d effects.

     

    To do what you want to do you'll have to use Direct3d (either directly or via XNA) to draw to a D3D surface and than composite with the 2d parts of your UI via the D3DImage element. This is pretty hard stuff (and quite hackey in the case of XNA), but it can be done.

  • User profile image
    DCMonkey

    There was supposed to be more direct support for XNA in .Net 4.0 but was apparently postponed.

     

    As rhm says, you can use D3DImage and Interop to call DirectX or use a managed wrapper like SlimDX

  • User profile image
    rhm

    DCMonkey said:

    There was supposed to be more direct support for XNA in .Net 4.0 but was apparently postponed.

     

    As rhm says, you can use D3DImage and Interop to call DirectX or use a managed wrapper like SlimDX

    Yeh, a lot of stuff got cut from .NET4 and XNA integration was one of them. Turns out that the demo they did at PDC09 was actually a mock-up of how the integrated API might work, implemented using the technique I just described.

  • User profile image
    indiegamedev

    rhm said:

    Yeh, the shader support in WPF is just pixel shaders for doing 2d effects.

     

    To do what you want to do you'll have to use Direct3d (either directly or via XNA) to draw to a D3D surface and than composite with the 2d parts of your UI via the D3DImage element. This is pretty hard stuff (and quite hackey in the case of XNA), but it can be done.

    I am not a fan of hacking classes to get them to work. On the other hand, Slimdx would work best with wpf. Using D3DImage in wpf to display direct3d content. The direct3d content will be the actual collada model (model loading and effects will be handled by slimdx) where as wpf will provide UI elements, in this case they just want model zoom and camera rotation via mouse, which can be handled via mouse click/scroll events - something interop can easily accompolish.

    But it would be good to see more support in .net 4.x for xna + wpf.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.