<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head><body style=""><div>Hi,</div>
<div> </div>
<div>I am not the ultimate expert on GL shader programming, but I dont think you can do without a vertex shader at all. In the particular case of the debayering stuff, the vertex shader computes the values of xCoord, yCoord and center based on the previously mentioned input parameters. These values are then used by the pixel shader. So unless the input parameters are correctly set, nothing will work.</div>
<div> </div>
<div>chris</div>
<blockquote type="cite" style="position: relative; margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;">Hamdi Rakkez <hamdi.rakez.selotec@gmail.com> hat am 19. August 2015 um 13:26 geschrieben:<br><br>
<div dir="ltr">
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">Great explanation Christian.</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">
<ul>
<li>Actually I am using only the pixel shader file.</li>
<li>The source is successfully entered from gstreamer to the shader.</li>
<li>SourceSize and first red are in the vertex shader which I am not using.</li>
</ul>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">Question :</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">
<ul>
<li>Is it necessary, for the debayering to work, to use both files (vertex and pixel shader). If yes, is it possible to have them both in one file so I can deal with input parameters statically.</li>
</ul>
<div>thanks.</div>
<div> </div>
<div>Best,</div>
<div>Hamdi</div>
</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;"> </div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Aug 19, 2015 at 12:15 PM, Christian Sell <span><<a href="mailto:christian@gsvitec.com" target="_blank">christian@gsvitec.com</a>></span> wrote:<br>
<blockquote style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><span style="text-decoration: underline;"></span>
<div>
<div>Hello,</div>
<div> </div>
<div>I am not sure how the glshader element works, but I do know how that shader program works, because we are successfully using it. Actually, we are using the GL variant for client-side debayering (outside of gstreamer, immediately before the data is displayed) and the CL variant for debayering inside the gstreamer pipeline with a custom element.</div>
<div> </div>
<div>There are 2 things I am doubtful with regard to the glshader element:</div>
<div> </div>
<div>1. the debayering code consists of a vertex and a pixel (aka fragment) shader. How are these integrated into glshader?</div>
<div>2. the code expects several parameters to be set from the outside, namely "source" (input buffer), "sourceSize" (an array with values width, height, 1/width, 1/height) and "firstRed" (a 0/1 combination describing the bayer pattern in use)</div>
<div> </div>
<div>I dont see how these prerequistes would be met by glshader..</div>
<div> </div>
<div>regards,</div>
<div>Chris</div>
<div> </div>
<blockquote type="cite" style="margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;">Hamdi Rakkez <<a href="mailto:hamdi.rakez.selotec@gmail.com" target="_blank">hamdi.rakez.selotec@gmail.com</a>> hat am 19. August 2015 um 12:06 geschrieben:
<div>
<div class="h5"><br><br>
<div dir="ltr">
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">Hi,</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">I am trying to use <strong>shaders</strong> to decode <strong>bayer</strong> images to <strong>RGB</strong> images.</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">I don't want to use the <strong>bayer2rgb</strong> element.</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">So, according to this <em><a href="http://graphics.cs.williams.edu/papers/BayerJGT09/#shaders" target="_blank">http://graphics.cs.williams.edu/papers/BayerJGT09/#shaders</a></em> it is possible to user gl shaders for demosaicing a bayer image.</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;"> </div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;">I have used the shader file along with glshader in a pipeline like this :</div>
<div class="gmail_default" style="font-family: trebuchet ms,sans-serif; font-size: large; color: #073763;"> </div>
<blockquote style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: #cccccc; border-left-style: solid; padding-left: 1ex;"><span style="color: #073763; font-family: trebuchet ms,sans-serif;">gst-launch-1.0 -v filesrc location=bayer_file.avi ! avidemux ! glupload ! glshader location=bayerRGB.GLSL ! glimagesink</span></blockquote>
<div> </div>
<div> </div>
<div class="gmail_default" style="font-family: 'trebuchet ms',sans-serif; font-size: large; color: #073763;">But, I have a very noisy result, and an image of the result is attached to this Email.</div>
<div class="gmail_default" style="font-family: 'trebuchet ms',sans-serif; font-size: large; color: #073763;"> </div>
<div class="gmail_default" style="font-family: 'trebuchet ms',sans-serif; font-size: large; color: #073763;">Any ideas why such behavior.</div>
<div class="gmail_default" style="font-family: 'trebuchet ms',sans-serif; font-size: large; color: #073763;"> </div>
<div class="gmail_default" style="font-family: 'trebuchet ms',sans-serif; font-size: large; color: #073763;">Thank you</div>
</div>
</div>
</div>
_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote>
</div>
<br>_______________________________________________<br> gstreamer-devel mailing list<br> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br> <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br> </blockquote>
</div>
</div>
_______________________________________________<br>gstreamer-devel mailing list<br>gstreamer-devel@lists.freedesktop.org<br>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</blockquote>
<div><br> </div>
Christian Sell<br><br>GS Vitec GmbH <br>Im Ziegelhaus 6-8 <br>D-63571 Gelnhausen<br><br>mail: christian@gsvitec.com<br>mobil: +49 (0) 173 5384289<br><br>Tel: +49 (0) 6051 601.26-90 <br>Fax: +49 (0) 6051 601.26-91</body></html>