我需要使用 Silverlight 4 编写一个应用程序,并且需要显示像包裹在圆柱体上的图像。我需要一些 HLSL 代码,因为我不会使用 Silverlight 的效果来做到这一点。
我不习惯对 silverlight 的 3D 库这样做。我只需要 HLSL 代码来更改像素。
我需要让我的图像看起来像 这个
谢谢。
I need to write an application with Silverlight 4 and need to show images like wrapped on cylinder. I need some HLSL code, as I wont to do that with Effects of Silverlight.
I don't wont to do that with 3D libarries for silverlight. I only need HLSL code for changing pixels.
I need for my image to look like this
Thanks.
发布评论
评论(2)
这似乎是您想要的效果,您可能希望更改 0.2 值来增加或减少效果,或者在着色器中进行调整,但这是一个简单的更改。如果您不使用 Shazzam 为 WPF 或 Silverlight 编写着色器,我推荐使用 Shazzam。
This seems to be the effect you want, you may wish to change the 0.2 value to increase or decrease the effect or make this adjustable in your shader but that's a simple change to do. I'd recommend Shazzam if your not using it for writing shaders for WPF or Silverlight.
如果您确实愿意的话,可以使用 HLSL 来完成此操作,但通常可以通过创建所需形状的网格,然后将图片应用到网格来实现作为纹理。
While you could do this with HLSL if you really wanted to, you'd normally do it by creating a mesh in the shape you want, then applying the picture to the mesh as a texture.