I am making an image slide show using slimdx and c#. Till now I have done transitions using the matrix transformation but now I am trying to make transitions using some gray scale background image. Can any body please give me an idea how can i perform that or can post some code to give me an idea.
|
If we first consider the simple case of having two images that as a whole fades from one image in a seamless fashion into the other image, this would be cheapest to express as drawing a quad with a pixel shader. This shader would have a float shader parameter you set from your code in the range of [0,1]. You can then bind and sample your two textures and lerp between them based on this constant factor. A value of 0.0 would represent 100% of the first image, a value of 1.0 would be 100% of the second image, 0.25 would be a quarter of the first and three quarters of the second, and so on. You can then use additional textures to alter the value of this interpolation parameter, like:
|
|||
|
|
|
Looking at the SlimDx documentation, I think more information could be useful like what classes you are using to diplay your images? Generally for a fade-in/out transition you can use a quad with a texture or just a plain color, and using the 'tint' Color, you can make the quad more or less transparent. If you are familiar with shaders, you can make a shader take multiple Textures and a float as input, and you can then easily calculate the needed mix. |
|||||
|