Thank you to all for being so helpful! Cyrille, that looks exactly what I'm looking for. I can stop pulling the hair out of my head.<div><br></div><div>Thanks again everyone.</div><div><br></div><div>Cheers!</div><div>
<br></div><div>Ryan<br><br><div class="gmail_quote">On Sat, Jun 12, 2010 at 2:23 AM, cyrille henry <span dir="ltr"><<a href="mailto:ch@chnry.net">ch@chnry.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
Le 12/06/2010 11:17, Jack a écrit :<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes it is working fine ;)<br>
I thought about a solution without the translation.<br>
</blockquote></div>
without the translation, it could work, but i'm not sure the result will be the same on every GPU.<div><div></div><div class="h5"><br>
<br>
c<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is a nice example for the importance of the rendering order.<br>
++<br>
<br>
Jack<br>
<br>
<br>
<br>
Le samedi 12 juin 2010 à 09:25 +0200, cyrille henry a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hello,<br>
<br>
i may have misunderstood the question, because i think there is a much simple solution using rendering order.<br>
see attachment.<br>
c<br>
<br>
<br>
Le 12/06/2010 07:05, patko a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi again,<br>
<br>
after reflexion, I don't think it's a good idea to snap and apply alpha<br>
when you want to apply a texture on the outer rectangle, some pixels might<br>
disappear when they have the same amount of color that is supposed to disappear on the masking process.<br>
<br>
It might be possible to apply a texture mapping on vertices drawn with openGL functions rather,<br>
but I've no clue about how it could be done yet.<br>
<br>
Or just use the method proposed by jack that is about using four rectangles if you don't use a texture, you can connect them together like this:<br>
<br>
[gemhead]<br>
|<br>
[translateXYZ -1 0 0]<br>
|<br>
[rectangle 0.2 1]<br>
|<br>
[translateXYZ 0.8 1 0]<br>
|<br>
[rectangle 1 0.2]<br>
|<br>
etc...<br>
<br>
<br>
<br>
Just loading an image containing the alpha hole, like attached would be cpu wise, very simple to do with an image editor,<br>
and wouldn't add artefacts on your texture.<br>
I've attached an example patch and the gimp image, on gimp just draw the two rectangles, select the inner rectangle, go to Colors menu,<br>
and then choose "Color to alpha".<br>
I've choosen the tiff format because it works on most platforms, unlike png.<br>
<br>
Patrice Colet - 06 32 66 03 57<br>
<br>
----- "Jack"<<a href="mailto:jack@rybn.org" target="_blank">jack@rybn.org</a>> a écrit :<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
You have several possibilities to do what you are looking for :<br>
- use (as Patrick describe) two rectangles to create a mask (with<br>
[gemframebuffer], [pix_snap] and [pix_buffer], [pix_buffer_read],<br>
[pix_buffer_write]) then [pix_mask] or [pix_multiply];<br>
- use four [rectangle]s to build 'lines' of the rectangle;<br>
- use GLSL to create the mask and the final image.<br>
Surely, there are other ways (like openGL objects with GEM for<br>
example)...<br>
See in help> browser> examples> GEM (in Pd-extended) to understand<br>
what this objects do.<br>
Hope that helps somewhat.<br>
++<br>
<br>
Jack<br>
<br>
<br>
<br>
<br>
Le vendredi 11 juin 2010 à 10:03 -0700, Ryan Trigg a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Patrice,<br>
<br>
<br>
Thanks for your reply, sounds like interesting options (especially<br>
</blockquote>
the<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
snapping two rectangles together)...could you be more specific with<br>
instructions on what objects to use? Pardon my novice GEM skills.<br>
<br>
<br>
Merci!<br>
<br>
<br>
Ryan<br>
<br>
On Fri, Jun 11, 2010 at 9:49 AM, patko<<a href="mailto:colet.patrice@free.fr" target="_blank">colet.patrice@free.fr</a>><br>
</blockquote>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hello,<br>
you can put an image texture with a rectangle made of<br>
</blockquote>
alpha<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
pixels,<br>
or draw an alpha rectangle using gridflow and then load<br>
</blockquote>
it<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
as a texture<br>
with #to_pix,<br>
or snap two rectangles with different colors,<br>
and turn to alpha all pixels matching the inner rectangle.<br>
<br>
Patrice Colet - 06 32 66 03 57<br>
<br>
----- "Ryan Trigg"<<a href="mailto:ryan.trigg@gmail.com" target="_blank">ryan.trigg@gmail.com</a>> a écrit :<br>
<br>
<br>
> I am trying to mask [rectangle] using GEM with another<br>
smaller<br>
> [rectangle] (that controls the first rectangle's alpha<br>
</blockquote>
value<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wherever<br>
> it is placed) in order to create an adjustable rectangle<br>
outline (that<br>
> has a border of my desired thickness). I noticed that you<br>
can choose<br>
> [draw line( and [width $1( for a rectangle but the<br>
</blockquote>
maximum<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
thickness<br>
> of the line is much too small. Does anyone have any<br>
</blockquote>
thoughts<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
or ideas?<br>
><br>
><br>
> Or maybe there's an object like [disk] (using 4 segments)<br>
but with the<br>
> ability to adjust the height and width just like<br>
</blockquote>
[rectangle]<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br>
><br>
><br>
> Cheers!<br>
><br>
><br>
> Ryan<br>
<br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -><br>
> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -><br>
</blockquote>
<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></blockquote></blockquote>
<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>