WPF animations are described through the use of Storyboard objects. They’re nice because a designer can create them in Blend and nobody has to mess with their XAML. Write a couple storyboards manually and you’ll see just how important that is. But storyboard objects animate only with respect to the simple passage of time. This [...]
Archive for the ‘Code’ Category
Most projects I’ve worked on had to, at one time or another, required some manner of custom code to be executed in a loop, in real time (i.e. every frame or so), without interfering with other execution. Custom animations, poll-based listeners, and synchronized interop with D3DImage all fall into this category. One easy way to [...]
It’s been a while since I’ve said anything here (actually I haven’t said much at all), but I wanted to share a general philosophy I take towards multithreading. I’ve seen a number of misconceptions out there, many of which I shared for some time, that I’d like to comment on. In my area of specialization, [...]
Texture vs. Surface pixel addressing in DirectX
Posted: October 28, 2008 in Code, GraphicsTags: directx pixel center texture surface addressing uv coordinate coordinates
Let’s say you’re rendering a D3DImage, and you want to blit a texture to it. The logical thing to do is draw an untransformed quad to the scene, with corners at (-1,1), (1,1), (1,-1), and (-1,-1). Those same vertices would have a UV coordinate to read into the texture at, respectively, (0,1), (1,1), (1,0), and [...]
Sampler Filters in ShaderEffect
Posted: October 12, 2008 in Code, GraphicsTags: bug WPF ShaderEffect filtering
The ShaderEffect object allows you to register a dependency property bound to a texture sampler. It has a parameter allowing you to specify whether to use nearest-neighbor (point) filtering, or bilinear filtering. Unfortunately, WPF currently appears to completely ignore this parameter. After a little experimentation, I’ve discovered a simple rule it follows: If the brush [...]