What’s New in Graphics for 4.0 Beta 2

Last beta I mentioned we were saving the best for Beta 2 so thank you for waiting 🙂 New Features The PixelShader class now accepts Pixel Shader 3.0 shaders when your hardware supports them. Important: There is no software rendering for PS 3.0. For example, you won’t see PS 3.0 Effects over Remote Desktop, when…

7

WPF3D Lighting and Shading

We use the standard fixed-function Blinn-Phong model. You can read up on all of the equations here at MSDN. If you have a Tier 2 card, we actually do our lighting in a vertex shader. If you don’t have a Tier 2 card, we do the lighting on the CPU. Why not just use D3D9’s…

4

What’s New in Graphics for 4.0 Beta 1

.NET 4.0 Beta 1 was released a few weeks ago and there’s a lot to it that you can read about elsewhere so I thought I would just stick to what’s changed for WPF graphics. These are the biggest things of note: RenderOptions.ClearTypeHint: If WPF renders text into a potentially transparent surface (e.g. a layered…

10

Transparent DiffuseMaterials and Depth Sorting

I hinted at this a long time ago and then forgot to follow up, whoops! As the old post says, DiffuseMaterial writes to the depth buffer. This means if you draw one diffuse model and then draw another diffuse model behind it, the card knows not to draw the second one on top of the…

0

3.5 SP1 Software 3D Leak Fix Available

In 3.5 SP1 it was really easy to leak memory when doing software 3D rendering involving a VisualBrush or DrawingBrush. We got this complaint many times online and in person. Unfortunately, there is no work around. It’s described in “Issue 2” from this new Knowledge Base article. The fix should also be in 4.0 Beta…

4

3D Hit Testing

How to do 3D hit testing has come up a bit recently in the forums but essentially it isn’t any different than 2D hit testing which is described on MSDN here. You can either start with a 2D point on the Viewport3D or a 3D point on a Visual3D. Starting at the Viewport3D level is…

6

Transforming Bounds

Many haven’t realized this, but we added the ability to transform between 2D and 3D Visuals back in 3.5. This is handy if you need to draw 2D content around your 3D object or if you want to know the 2D position of a 3D point without doing a hit test. The methods are: GeneralTransform3DTo2D…

2

D3DImage and Software Rendering

If the WPF render thread is doing software rendering, D3DImage will not show up. I don’t think we specifically called this out in the documentation so it can come as a surprise when you first encounter it. Off the top of my head, here are times when the render thread is in software: RenderCapability.Tier ==…

4