How would I write an HLSL bevel shader for Silverlight? - silverlight

I know that Silverlight doesn't directly support the WPF bitmap effects, but I also know that Silverlight 3 supports HLSL shaders. Would it be relatively simple to write a bevel effect, ilke the one in WPF, and if so, can somebody recommend a good resource to learn how to do it?

Check out this thread:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d19828e7-560e-4733-97b4-63326be8390c/

Vote below for adding muilti-pass shaders which would make this possible.
http://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions/suggestions/480961-add-gloweffect-and-multipass-shaders-

Related

XNA 3D/WP7 point light without custom shader

I'm wondering if it is possible to create a point light in XNA without writing a custom shader (because WP7 doesn't support this) using only directional light from the basic effect.
Has anyone tried this before?
It is possible, but it will not cast shadow.
The light can be created in BasicEffect, by editing DirectionalLight# propriety.
You can also use BasicEffect.enableDefaultLightning() in order to rapidly create a light.

Need recommendations for Image Editing Library

I am trying to create a WPF based application which will allows users to edit photos and provide features like:
Increase/Decrease Brightness
Crop
Retro looks
and lot more.
I am also looking forward to provide more fancy features like : Framing an image, print to a Tshirt, but these are low on priority.
Any open source libraries for that?
P.S -> This is a POC project, even if i miss some features it will be fine.
I would suggest you to use BitmapEffects available in WPF, the BitmapEffects make use Shading language; at present very few effects available in .net Fx. But it is quite easy create your own shaders to adjust the birghtness, gamma, colour saturation, and they can be data bound too. The great thing about shaders is you apply them to videos as well.
Shazzam Tool is on of the best tool to create shadders, it lets you try the effect on your images and generate the C# or VB.Net binding code to use in WPF/Silverlight.
I guess you have to write code to do the image cropping, or quick Google search would help.
Opensource shader effects available here in codeplex.
For a low-level library that allows GDI like operations on bitmaps please see the WriteableBitmapEx library. This is open source and as a disclaimer, I have made a minor contribution to it.
WriteableBitmapEx has functions for drawing shapes, lines, ellipses, applying filters (via matrices, e.g. convolution blur etc), rotation, resize and cropping. You would have to write your own code to apply framing but this could be done by rendering to a separate bitmap and using the Blit function.
Above all its very fast and portable, to WP7 and Silverlight!
Best regards,

Matrix3DProjection exists in Silverlight but not in WPF?

I need a taper-effect on my transform in WPF.
Charles Petzold wrote some nice stuff about it for example :
http://www.charlespetzold.com/blog/2009/07/Using-the-Matrix3DProjection-Class-in-Silverlight-3.html
But now it seems that the used Matrix3DProjection class only exists in Silverlight, and NOT in WPF..?
(Why would Mirosoft think it could only be useful in Silverlight and not in WPF ?)
Is there any way to get around this ?
Matrix3DProjection is in Silverlight because Silverlight doesn't have full 3D support like WPF has.
You can do everything by using the 3D support.
Yes, Matrix3DProjection is easy and "real" 3D is really difficult and I personally struggled to do something in 3D that would have been easy with Matrix3DProjects and I hope Matrix3DProjection will make it into a future version of WPF - but now that you know the reason don't you feel better? (I don't)

How can I obtain a sketch or hand-drawn look in Silverlight for various controls?

I am looking to create a Silverlight application that employs a control style similar to what one might see when using Balsamiq Mockups or SketchFlow.
I am not sure how this look is best achieved in Silverlight. My initial thought is that clever use of a pixel shader effect on the desired control might just do the trick, however, my searches for a similar solution have failed.
What might be the best approach for drawing controls with a hand-drawn look in Silverlight?
Can this be done with a custom pixel shader?
Note: I am using Silverlight 3, but would not be opposed to using Silverlight 4 Beta if it provided a more elegant solution to the problem.
This guy has a HandDrawnBorder style in the source he provides on his website. An example of using his styles is shown here. It does say that this is for the Beta2 of WPF but that the source should compile and be usable in later releases.
EDIT: Looks like the download is broken. Might have to do some hunting...
Check out UX Musings Rough theme.
There's also a nice set of sketch style icons I found on Icon Finder.

Ambient Occlusion Shader Effect in WPF?

I guess this is a multi-part question.
I can import a 3D model into my WPF application but how do I apply an ambient occlusion shader effect to it?
I know with .NET 3.5 SP1 you can do custom effects but that's limited to pixel shaders and doesn't include vertex shaders.
I think i can do this with an XNA application but Im not familiar with XNA so the second question is:
How much different is WPF and XNA? I don't seem to have any notion of XAML in XNA. How much ramp up would moving from WPF to XNA take?
Thanks,
Chris
To answer your second question:
WPF and XNA are completely different. They do share the following:
Built upon .net
Use DirectX
Can access hardware acceleration of the video card
XNA does not have any GUI support built in and is really aimed at games (for PC and XBOX-360) whilst WPF is usable in business style applications. As you've discovered XNA does not have any XAML support, indeed it is mainly an abstract .net wrapper for DirectX.
If you have an understanding of terms like "ambient occlusion" then you should probably be working with XNA.
XNA as an API is not difficult to learn, but as was mentioned, it is intended for game development. There are lots of great XNA tutorials out there.
You can use both WPF and XNA in concert, read more about that here.
Can you tell us more about what you are trying to do?

Resources