# Patching the edge algorithm

**URL:** <http://forum.vvvv.org/t/patching-the-edge-algorithm/19945>\
**Category:** question\
**Created:** [November 4, 2021, 11:51pm UTC](http://forum.vvvv.org/t/patching-the-edge-algorithm/19945 "2021-11-04T23:51:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggml](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/g/999999/32.png) [@ggml](http://forum.vvvv.org/u/ggml)\
**Post date:** [November 4, 2021, 11:51pm UTC](http://forum.vvvv.org/t/patching-the-edge-algorithm/19945/1 "2021-11-04T23:51:21Z")

</div>

while translating the edge shader to fuse nodes, any hint for a non-coder on how to patch this part ?

> float4 q(float2 uv, float2 off, float v)  
> {  
> return Texture0.SampleLevel(Sampler0, uv + off, v);  
> }
> 
> ```
> float4 Filter(float4 tex0col)
> {
> float2 uv = streams.TexCoord; **strong text**
> 
> ```

[edge in fuse.vl](http://forum.vvvv.org/uploads/short-url/g0BEWgf8rhkkbpX9xsJaG05NMf0.vl) (79.1 KB)

---

<div class="post-metadata">

**Author:** ![ggml](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/g/999999/32.png) [@ggml](http://forum.vvvv.org/u/ggml)\
**Post date:** [November 6, 2021, 8:33pm UTC](http://forum.vvvv.org/t/patching-the-edge-algorithm/19945/2 "2021-11-06T20:33:17Z")

</div>

maybe something more basic makes more sense asking,

 ![sample circlepoints](http://forum.vvvv.org/uploads/default/original/2X/f/f2486bde064fe7cfcb16fc9f6d8f1af75967c157.png)

how can i sample the texture at an arbitrary number of points on a circle ?  
[sampletexture.vl](http://forum.vvvv.org/uploads/short-url/gNHCT8uf1lCT4Svk3UM9OA8qPnU.vl) (7.8 KB)

---

<div class="post-metadata">

**Author:** ![ggml](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/g/999999/32.png) [@ggml](http://forum.vvvv.org/u/ggml)\
**Post date:** [November 9, 2021, 9:01am UTC](http://forum.vvvv.org/t/patching-the-edge-algorithm/19945/3 "2021-11-09T09:01:56Z")

</div>

narrowing down even more,

 ![sampletexture zip](http://forum.vvvv.org/uploads/default/original/2X/8/88e4b43b29de5248d14256071fcde2d2155def19.png)  
[sampletexture spread 0.vl](http://forum.vvvv.org/uploads/short-url/dv4V7NBVzm1bmmTMxSC8QX4tTLm.vl) (8.1 KB)  
this should work right ? except it has a bug seemingly related to tovector2, as [reported](https://discourse.vvvv.org/t/some-nodes-hide-render-windows/19951/3)

using a noise as texcoord does work  
[sampletexture noise.vl](http://forum.vvvv.org/uploads/short-url/5QWyNtr3VzmbIBcDceGNZqBDsLC.vl) (7.8 KB)  
but not much control there,  
any idea how i could fiddle with manual sample vectors while circumventing the bug ?

---

<div class="post-metadata">

**Author:** ![ggml](http://forum.vvvv.org/letter_avatar_proxy/v2/letter/g/999999/32.png) [@ggml](http://forum.vvvv.org/u/ggml)\
**Post date:** [November 18, 2021, 8:27am UTC](http://forum.vvvv.org/t/patching-the-edge-algorithm/19945/5 "2021-11-18T08:27:13Z")

</div>

did a line by line clean up  
trying to understand what is happening in line 5 and 12 (marked with frames)  
in line 5, is q the input texture picked by the offset sampler ?  
in line 12, uv contains a texcoord or a sampled pixel, from line 5 ?  
does the patch otherwise hint at a right design or is it missing basic parts ?  
[edge 03.vl](http://forum.vvvv.org/uploads/short-url/9BI0vEOUYK88M5t7wklL3qxm28S.vl) (90.4 KB)

 ![Capture](http://forum.vvvv.org/uploads/default/original/2X/8/82b6cc24017e1a9098f220182bfc4f634f569219.png)
