HLSL Advanced Shader Language (High level Shader Language, HLSL), a language owned and developed by Microsoft, can only be used by Microsoft's Direct3D. HLSL is the product of Microsoft to contend with GLSL,
is not compatible with OpenGL standards. He is very similar to Nvidia's CG.
Having read the above jargon, it may not be clear how this thing relates to the current Silverlight. In fact, the brother in the garden has sent this article, describes "SILVERLIGHT3 filter effect."
And its in the source code used in the. ps file (Note: This is not PowerShell AH), it should be compiled using this language, the source file looks like the use of FX as an extension, and the language of this introductory tutorial can be downloaded from here: http:// CID-123EC1ED6C72A14A.SKYDRIVE.LIVE.COM/BROWSE.ASPX/PUBLIC/HLSL)
I was watching Mtaulty blog when I saw the effect of the relevant filters, hehe: http://mtaulty.com/downloads/Silverlight3/run/Mix09TestPage.html
SOURCE Download Address: Http://mtaulty.com/downloads/Silverlight3/source/Mix09.zip
At first I was naïve to think that Silverlight really supported the kind of "water ripple" effect that only WPF had. Because the demo effect is really "shocking".
Until you start writing a corresponding "water ripple" example, you will find that there is one line in the corresponding RippleEffect.cs file, namely:
Code highlighting produced by Actipro Codehighlighter (freeware)
http://www. codehighlighter.com/
-->static rippleeffectsample ()
{
pixelshader = new PixelShader ();
Pixelshader.urisource = new Uri ("rippleeffect;component/shaders/ripple.fx", urikind.relative);
}
And after opening the ripple.fx file is "binary code", it seems that this filter effect is a flexible implementation, and I began to think of the C # implementation of the filter code seems to be the opposite, hehe. But fortunately the effect is still very good, basically run very smooth, it is a shrinking water "water ripple" bar:
The other is the Shadereffect interface that it implements (in System.Windows.Media.Effects), because any graphical effect is inherited from this abstract class.
It seems that in the future, Silverlight may integrate more. ps files (as long as it is referenced in the project, and the FX file can be excluded after compilation). One of the benefits of integrating PS is that it is convenient to use, and the second is to reduce the volume of xap packages. and filter development This aspect of the work is still to Microsoft's developers, hehe:
Well, today's content is here first.
Reference to Mix09.zip wrote "Water Ripple" source code: Http://files.cnblogs.com/daizhj/RippleEffect.rar
Note: The associated PS build Action is in "Resource" mode. The picture is compiled in "Content" mode.
Original link: http://www.cnblogs.com/daizhj/archive/2009/04/01/1427189.html