<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: cf.edgedetect.jxs-help doesn&#039;t seem to be working?</title>
		<atom:link href="http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/feed</link>
		<description></description>
		<pubDate>Mon, 17 Jun 2013 22:53:42 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-47864</guid>
					<title><![CDATA[cf.edgedetect.jxs-help doesn&#039;t seem to be working?]]></title>
					<link>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-47864</link>
					<pubDate>Tue, 19 Jan 2010 07:51:28 +0000</pubDate>
					<dc:creator>gpvillamil</dc:creator>

					<description>
						<![CDATA[
						<p>No matter what I do, the cf.edgedetect.jxs-help patch in examples/jitter-examples/render/slap-helpers doesn&#8217;t seem to do anything: I just see a white output window, when I&#8217;m expecting to see something more like the output of jit.sobel.</p>
<p>Am I doing something wrong or is it broken?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-172117</guid>
					<title><![CDATA[Re: cf.edgedetect.jxs-help doesn&#039;t seem to be working?]]></title>
					<link>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-172117</link>
					<pubDate>Tue, 19 Jan 2010 17:27:07 +0000</pubDate>
					<dc:creator>jason@seeinginvideo.com</dc:creator>

					<description>
						<![CDATA[
						<p>I looked in the javascript file and everything looks fine, but I too ran into complications. If you set the width, height and thresh to 1, 1, .25 you see some black artifacts appear, but no edge detection is happening. I&#8217;m guessing there&#8217;s a glitch somewhere in the javascript file that I can&#8217;t seem to find. Sorry!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-172118</guid>
					<title><![CDATA[Re: cf.edgedetect.jxs-help doesn&#039;t seem to be working?]]></title>
					<link>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-172118</link>
					<pubDate>Tue, 19 Jan 2010 20:27:03 +0000</pubDate>
					<dc:creator>Rob Ramirez</dc:creator>

					<description>
						<![CDATA[
						<p>i was able to get an edge detection shader working based on the tutorial here:</p>
<p><a href="http://www.ozone3d.net/tutorials/image_filtering.php" rel="nofollow">http://www.ozone3d.net/tutorials/image_filtering.php</a></p>
<p>however, this requires you to use non-rectangular textures.<br />
patch and shader below.</p>
<div><span id="toggle172118-0" class="patchtoggle" onmousedown="toggleMaxPatch('post172118-0', 'er172118-0');">&#8211; Pasted Max <span id="maxversion172118-0"></span> Patch, click to <span id="er172118-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A1048.3ocyYlsjZiCEF9Z3oPE0bIwkV7llql7bjZptDXgQc4sXKRyjT4cezhc%0AfzzDD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50%2BbL%0AlQSW%2Buytt5CsaGz1vucB3z3kw6jhJl93SOqS5Y9YcZuHKiWc9IEVJxZpUO06%0AEwUdR5pld0v81ZRexGynld0vcEMkLuZJbB3DlZRrFCSsFizeUxW0FMEpEQL5%0Ayl91fZ0k7Tswe7LA0OsQ2PR2ohhPZdQO%2BQM0%2BmzTGX2cJTBIQKN6IH0qTcAO%0AUZ5DnTnwhjhOmoXuUZx3qT8IWpEWz4JMxakp%2BMVu8Rmv4MhB1knbj4USIe.4%0AjKYCPmcud3annn6SQIV6d6N9SG99HnS33pSeC35fhlWyKm7L7aQ4lbCdGUzL%0AtDzEIg7IQSUget7%2BAlEls.A%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post172118-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode172118-0">----------begin_max5_patcher----------
1048.3ocyYlsjZiCEF9Z3oPE0bIwkV7llql7bjZptDXgQc4sXKRyjT4cezhc
fzzDDHa2c0z.ZwV+5yGcNGI9wxEq1Tej2sB72fu.Vr3GKWrvTkthE8kWrpjc
baAqyzsUU7Wp277p01lj7iRS0E0rrMrp7gFpNTJpJ3RyEgNUY8A4qqUjYtCp
65mvvgqeWckrhUxMM84VAqXnE6cP9eMbqrWYFVv+12bCStcunJ+oV9VosGHZ
T.bM.GB0ejXKn99utF8f0I9t4FhPAQzHTZhtoetbo9s0NxlcE0po3cf.7kH.
ge.DnFXlb0ZGXANknm9HhgBQvIiEk7tNVN+BCk8bQ9dI3uPuIlvtZofHO.lb
hLQoFxDaJj9Q0JAMsVI3n4wJYacYIuRdgUBOKm+oLtToHQcEXmnPxauCjAuD
Yjnair2x4AxXVPrFGnzYGEa2EnogEFAOerySLDdaLnaYGaK+7a7e.MFxPSFv
zaRFLI.QgjjvGfLWIjyyBYvKhpr5W.6X9sbBSez3NqugWED0PGbnIzS3jY87
GXTdQv2DY75lBVEWgJv+zskUvAn.BgndW8xS5k7.zSormJYxVwwayvTn01p2
OD4chhcErMF9obGwAtstD6LDiePHlW7jVnGZ4NCRHztjMZ1i9mykMrVVYgnS
5WB.3nQOA.XnMlexo0pSRB.WwJqok2vqx.F.4YdzgSU1Qol7hRoytkyKhL4d
+SaLYzASepR8oMF9wNsQ3jl1HAafPXx6zdKZYRt2lHzw1BomJwzSrYRLPtFU
5j0M9gjzQeQCM7DRH3fnYFIsbVFHq9671fx5u4GbFcOJ8wkiMqenv4NLjNYm
uJ0bQvA3nX8+940IdVRODAsNhUH48I8vVUvadqIAw5V49Z.1OrEMw6IoOKP0
xuYlWRvF0e7VVG+NHD4RBE5AgF9zJiaiqXS9OwuqGdnpJQopO5c1q7Y5ncDY
Ri42ePY1c+SmaSouVxksWakl66kXZN0YS7d3oSSbR.irNOuf621EPWcVJpjt
3JIYX5MLIGyzWTtUEUMGj.8vpntZu2PO2EP5DEyFmz6Skb2QsMcbUgn50+bL
lQSW+uytt5CsaGz1vucB3z3kw6jhJl93SOqS5Y9YcZuHKiWc9IEVJxZpUO06
EwUdR5pld0v81ZRexGynld0vcEMkLuZJbB3DlZRrFCSsFizeUxW0FMEpEQL5
yl91fZ0k7Tswe7LA0OsQ2PR2ohhPZdQO+QM0+mzTGX2cJTBIQKN6IH0qTcAO
UZ5DnTnwhjhOmoXuUZx3qT8IWpEWz4JMxakp+MVu8Rmv4MhB1knbj4USIe.4
jKYCPmcud3annn6SQIV6d6N9SG99HnS33pSeC35fhlWyKm7L7aQ4lbCdGUzL
tDzEIg7IQSUget7+AlEls.A
-----------end_max5_patcher-----------</code></pre></div>
</div>
<p>
		A 3&#215;3 edge detection filter</p>
<p></p>
<p>#define KERNEL_SIZE 9</p>
<p>// Edge detection kernel (Laplacian filter).<br />
// 0  1 0<br />
// 1 -4 1<br />
// 0  1 0<br />
float kernel[KERNEL_SIZE]; </p>
<p>varying vec2 texcoord0;</p>
<p>uniform sampler2D tex0;<br />
uniform float width;<br />
uniform float height;</p>
<p>float step_w = 1.0/width;<br />
float step_h = 1.0/height;</p>
<p>vec2 offset[KERNEL_SIZE];</p>
<p>void main(void)<br />
{<br />
	int i = 0;<br />
	vec4 sum = vec4(0.0);</p>
<p>	offset[0] = vec2(-step_w, -step_h);<br />
	offset[1] = vec2(0.0, -step_h);<br />
	offset[2] = vec2(step_w, -step_h);</p>
<p>	offset[3] = vec2(-step_w, 0.0);<br />
	offset[4] = vec2(0.0, 0.0);<br />
	offset[5] = vec2(step_w, 0.0);</p>
<p>	offset[6] = vec2(-step_w, step_h);<br />
	offset[7] = vec2(0.0, step_h);<br />
	offset[8] = vec2(step_w, step_h);</p>
<p>	kernel[0] = 0.0;<br />
	kernel[1] = 1.0;<br />
	kernel[2] = 0.0;<br />
	kernel[3] = 1.0;<br />
	kernel[4] = -4.0;<br />
	kernel[5] = 1.0;<br />
	kernel[6] = 0.0;<br />
	kernel[7] = 1.0;<br />
	kernel[8] = 0.0;</p>
<p>	for(i=0; i</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-172119</guid>
					<title><![CDATA[Re: cf.edgedetect.jxs-help doesn&#039;t seem to be working?]]></title>
					<link>http://cycling74.com/forums/topic/cf-edgedetect-jxs-help-doesnt-seem-to-be-working/#post-172119</link>
					<pubDate>Wed, 20 Jan 2010 22:50:23 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>Yeah, this is broken. A fix is in the next release. Here&#8217;s a modified shader for you. The issue was it was using device coordinates and not the texture coordinates, which the example had assumed to be the same thing.</p>
<p>FWIW, This is a greyscale based mask for edges. For jit.sobel style edge detection, please use cf.sobel.jxs.</p>
<p><code><br />
<jittershader name="edgedetect"><br />
	<description><br />
	A 3x3 edge detection filter<br />
	</description></jittershader></code></p>
<param name="width" type="float" default="1" />
<param name="height" type="float" default="1" />
<param name="threshold" type="float" default="0.25" />
	<language name="glsl" version="1.0"><br />
		<bind param="width" program="edgedetect"></bind><br />
		<bind param="height" program="edgedetect"></bind><br />
		<bind param="threshold" program="edgedetect"></bind>
<program name="basic" type="vertex">
< ![CDATA[<br />
varying vec2 texcoord0;
<p>void main( void )<br />
{<br />
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br />
	texcoord0 = vec2(gl_TextureMatrix[0] * gl_MultiTexCoord0);<br />
}</p>
<p>]]>
</p></program>
<program name="edgedetect" type="fragment">
< ![CDATA[<br />
///////////////////////////////////////////////////////////////////////////////<br />
//<br />
// Copyright 2003, ATI Technologies, Inc., All rights reserved.<br />
//<br />
// Permission to use, copy, modify, and distribute this software and its<br />
// documentation for any purpose and without fee is hereby granted,<br />
// provided that the above copyright notice appear in all copies and derivative<br />
// works and that both the copyright notice and this permission notice appear in<br />
// support documentation, and that the name of ATI Technologies, Inc. not be used<br />
// in advertising or publicity pertaining to distribution of the software without<br />
// specific, written prior permission.<br />
//<br />
///////////////////////////////////////////////////////////////////////////////
<p>// vertex to fragment shader io<br />
varying vec2 texcoord0;</p>
<p>// globals<br />
uniform float width;<br />
uniform float height;<br />
uniform float threshold;</p>
<p>// samplers<br />
uniform sampler2DRect tex0;</p>
<p>// getGrey function<br />
float<br />
getGrey(vec4 c)<br />
{<br />
    vec4 onethird;<br />
    vec4 cc;<br />
    float sum;<br />
    onethird = vec4 (0.333333,0.333333,0.333333,0);<br />
    cc = c;<br />
    sum = dot(onethird, cc);<br />
    return sum;<br />
}</p>
<p>// entry point<br />
void<br />
main()<br />
{<br />
    float K00 = -1.0;<br />
    float K01 = -2.0;<br />
    float K02 = -1.0;<br />
    float K10 = 0.0;<br />
    float K11 = 0.0;<br />
    float K12 = 0.0;<br />
    float K20 = 1.0;<br />
    float K21 = 2.0;<br />
    float K22 = 1.0;</p>
<p>    vec2 ox = vec2 (0.0,0.0);<br />
    ox[0] = width;<br />
    vec2 oy = vec2 (0.0,0.0);<br />
    oy[1] = height;</p>
<p>    float g00, g01, g02;<br />
    float g10, g11, g12;<br />
    float g20, g21, g22;<br />
    vec4 CC;</p>
<p>    vec2 PP = texcoord0 - oy;<br />
    CC = texture2DRect(tex0, vec2(PP-ox));<br />
    g00 = getGrey(CC);<br />
    CC = texture2DRect(tex0, vec2(PP));<br />
    g01 = getGrey(CC);<br />
    CC = texture2DRect(tex0, vec2(PP+ox));<br />
    g02 = getGrey(CC);</p>
<p>    PP = texcoord0;<br />
    CC = texture2DRect(tex0, vec2(PP-ox));<br />
    g10 = getGrey(CC);<br />
    CC = texture2DRect(tex0, vec2(PP));<br />
    g11 = getGrey(CC);<br />
    CC = texture2DRect(tex0, vec2(PP+ox));<br />
    g12 = getGrey(CC);</p>
<p>    PP = texcoord0 + oy;<br />
    CC = texture2DRect(tex0, vec2(PP-ox));<br />
    g20 = getGrey(CC);<br />
    CC = texture2DRect(tex0, vec2(PP));<br />
    g21 = getGrey(CC);<br />
    CC = texture2DRect(tex0, vec2(PP+ox));<br />
    g22 = getGrey(CC);</p>
<p>    float sx = 0.0, sy = 0.0;<br />
    sx = sx + g00 * K00;<br />
    sx = sx + g01 * K01;<br />
    sx = sx + g02 * K02;<br />
    sx = sx + g10 * K10;<br />
    sx = sx + g11 * K11;<br />
    sx = sx + g12 * K12;<br />
    sx = sx + g20 * K20;<br />
    sx = sx + g21 * K21;<br />
    sx = sx + g22 * K22;<br />
    sy = sy + g00 * K00;<br />
    sy = sy + g01 * K10;<br />
    sy = sy + g02 * K20;<br />
    sy = sy + g10 * K01;<br />
    sy = sy + g11 * K11;<br />
    sy = sy + g12 * K21;<br />
    sy = sy + g20 * K02;<br />
    sy = sy + g21 * K12;<br />
    sy = sy + g22 * K22;</p>
<p>    float dist = sqrt(sx * sx + sy * sy);</p>
<p>    gl_FragColor = dist > threshold ? vec4 (0,0,0,1) : vec4 (1,1,1,1);<br />
}<br />
]]>
		</p></program>
	</language><br />
<br />
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

