tag:blogger.com,1999:blog-563071785757928434.post6720745934832163492..comments2024-02-21T08:31:04.853+01:00Comments on Kodierer [Coder]: Ye Olde Kamera - Silverlight 4 Webcam & Old Movie ShaderRene Schultehttp://www.blogger.com/profile/12777157871967896549noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-563071785757928434.post-13068153384507717052011-05-12T18:07:49.753+02:002011-05-12T18:07:49.753+02:00Excellent demo man, I can see you're really cr...Excellent demo man, I can see you're really creative and original, I'd like to develop something similar because I have to do a task related to it at the highschool.kamagrahttp://www.buykamagraonline.com/noreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-57397912200926890342010-06-17T00:13:59.059+02:002010-06-17T00:13:59.059+02:00Thanks a zillion Rene!
Have't got it working ...Thanks a zillion Rene!<br /><br />Have't got it working yet, but I'm sure this is enough input to get there.<br /><br />KomawiAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-87334614832821844802010-06-01T22:23:15.217+02:002010-06-01T22:23:15.217+02:00Hi Komawi,
The first shader sounds like a Color K...Hi Komawi,<br /><br />The first shader sounds like a Color Key shader. There's also one as part of the WPF FX library (ColorKeyAlpha):<br />http://wpffx.codeplex.com<br /><br />Your second shader uses a static bitmap and a stream. I guess you apply it to a MediaElement or a shape that is filled with a VideoBrush.<br />You need two registers in the shader:<br />sampler2D InputSampler : register(S0);<br />sampler2D StaticSubSampler : register(S1);<br /><br />In the relevant code they map to:<br />public static DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(ScratchedShader), 0);<br />public static DependencyProperty StaticImageProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("StaticImage", typeof(ScratchedShader), 1);<br /><br />As you see, the Input (live feed) has to use the S0 register. This is important! Silverlight passes the element the shader is applied to into the S0 register. The static image will be passed to the S1 register. <br />Both properties are typeof System.Windows.Media.Brush. So you can't use the WriteableBitmap directly, instead you have to do this:<br />ImageBrush brush = new ImageBrush();<br />brush.ImageSource = writeableBmp;<br />StaticImage = brush;<br /><br />See how I use them in my old movie shader code. I do all these things there.<br />The Shazzam Tool is also great for devleloping shaders and now supports multiple inputs.<br /><br />Good luck!Rene Schultehttps://www.blogger.com/profile/12777157871967896549noreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-81130334732226186942010-06-01T21:01:51.970+02:002010-06-01T21:01:51.970+02:00Hello Rene,
I used your OldCam as a strting point...Hello Rene,<br /><br />I used your OldCam as a strting point to learn more about pixel shaders. Excellent work and exactly enough features to get a hold of it.<br /><br />Now I am working on two pixel shaders for myself:<br />* the first one is a green screen shader to isolate a subject in front of a green screen. This one works good enough.<br />* The second one serves the same purpose in another fashion; first shooting an image of the background without subject, then processing a live feed with (moving) subject and 'subtracting' the background to isolate the subject.<br /><br />The second one doesn't work yet. I think this has something todo with the way I pass the initial static image to the shader (as a WritableBitmap) to register 0 (I hope).<br /><br />Can you advice on how to do this?<br /><br />Best regards,<br /><br />Komawi --> Martijn at komawi.comKomawihttp://www.komawi.comnoreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-16278485261571441522010-01-03T14:12:31.761+01:002010-01-03T14:12:31.761+01:00@Riddlemaster: Sure, that's fine with me.@Riddlemaster: Sure, that's fine with me.Rene Schultehttps://www.blogger.com/profile/12777157871967896549noreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-41587727375534737562010-01-03T13:17:33.440+01:002010-01-03T13:17:33.440+01:00OK, so I'll go with your implementation then (...OK, so I'll go with your implementation then (of course there will be note you're the author of it).Anonymoushttps://www.blogger.com/profile/12746925806334085844noreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-50457819929385111902009-12-31T13:16:02.638+01:002009-12-31T13:16:02.638+01:00Thanks. It's done with shader model 2 only and...Thanks. It's done with shader model 2 only and I'm a bit proud of the changing noise trick. I only use one generated static noise texture and just 4 random base coordinates that change every frame for the noise texture lookup.<br />The details were covered in the original blog post:<br />http://kodierer.blogspot.com/2009/08/ye-olde-pixels-silverlight-3-old-movie.html<br /><br />But why re-implement it, feel free to use my shader for nGene directly if possible. The HLSL .fx file is also included in the source code and the usage code can be found in the associated .cs file. You can also copy it from the original blog post's listing:<br />http://kodierer.blogspot.com/2009/08/ye-olde-pixels-silverlight-3-old-movie.htmlRene Schultehttps://www.blogger.com/profile/12777157871967896549noreply@blogger.comtag:blogger.com,1999:blog-563071785757928434.post-37892304713112809752009-12-31T08:49:32.825+01:002009-12-31T08:49:32.825+01:00Hi! I like your movie shader :) have to implent it...Hi! I like your movie shader :) have to implent it for nGENE :)Anonymoushttps://www.blogger.com/profile/12746925806334085844noreply@blogger.com