hi..
i tried it now for at least 4 hours, but just didn't get it..
i want to use something like the pix_multiply - function to multiply a movie with e.g. a rectangle..
i don't want the movie as a texture of this rectangle..
i want to move and resize a white rectangle, and only show the parts of the movie, where the rectangle currently is..
is there a special function for doing this with movies?
it must be really quite the same as pix_multiply.. just that i want to use a movie on the one, and some graphic-stuff on the other hand..
thanks,
hi lorenz,
please consider the difference between geos and textures in gem. or, for that matter, opengl.
i want to use something like the pix_multiply - function to multiply a movie with e.g. a rectangle..
i don't want the movie as a texture of this rectangle..
i want to move and resize a white rectangle, and only show the parts of the movie, where the rectangle currently is..
the movie you're talking about is a texture. a texture just by itself is kind of wasted - to be visible, it needs to rendered on a geometrical figure, probably a rectangle. objs are geos as well ... there are some objects to change the appearance of the texture of a geo in gem - but you won't find anything pre-fabricted that suits you needs. now, if you're familiar with c or ruby or ... you could code a new pix_ object that does exactly what you need. this solution depends on your coding skills. another - and probably faster - solution would be to render your movie on a rectangle that fills your gem window. After this is done, you could render four rectangles that are totally non-transparent in a pattern like this:
+-----------+ | | +-----------+ | |movie| | +-----------+ | | +-----------+
again covering the whole of the gemwin. by changing the side lengths of the rectangles you should get what you've been asking for ...
It doesn't pay to think photoshop when using gem. the gem-way of doing things is actually the more elegant one. don't forget to share your patch when you're done
hope this helps, thoralf.
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
Thoralf Schulze wrote:
It doesn't pay to think photoshop when using gem. the gem-way of doing things is actually the more elegant one. don't forget to share your patch when you're done
- others might be interested too.
i think i found a better - photoshop-like :) - solution.. there is an example of this solution attached to this mail:
the pix_multiply function just works for pix.. that was my problem. you can't multiply a movie with a "normal" rectangle-object this way..
my workaround:
i took a black image in the same dimensions as my movie-material and used pix_rectangle to draw a rectangle on this black dummy-image.
so i could use pix_multiply to combine the movie with the black-image i painted the rectangle on..
this works quite great for making visuals :D
have fun !
lorenz kirnbauer wrote:
Thoralf Schulze wrote:
It doesn't pay to think photoshop when using gem. the gem-way of doing things is actually the more elegant one.
i woudldn't say that. it is like claiming that pd is more elegant than pro-tools; they are just completely different things, even though something similar might come out (sound with pd/protools, images with gem/photoshop)
i think i found a better - photoshop-like :) - solution.. there is an example of this solution attached to this mail:
the pix_multiply function just works for pix.. that was my problem. you can't multiply a movie with a "normal" rectangle-object this way..
which is actually by design. pix-functions work on pixel-data: very low level; most of the time quite CPU-expensive. most of Gem's functionality (in the domain where the strenghts of Gem are) are rather high-level (and cheap in terms of CPU!)
as a rule of thumb one could say, that you should try to avoid to use pixel-processing whenever possible: e.g. if you want to fade out an image use [color] instead of [pix_gain]
my workaround:
i took a black image in the same dimensions as my movie-material and used pix_rectangle to draw a rectangle on this black dummy-image.
so i could use pix_multiply to combine the movie with the black-image i painted the rectangle on..
this works quite great for making visuals :D
well, if you have spare CPUs...
when working with Gem you should first try to think what you really want to achieve. don't think how you would do it in other applications (at first). then try to do what you want to achieve. and then find some workarounds to make it work ;-(
there are several ways to do what you want to do. a) use texture-coordinates [pix_coordinates] to tell the rectangle (canvas) which part of the texture should be displayed.
b) use something like thoralf proposed: cover the parts of the image that you don't want to see (think of a landscape behind a wall with a moving window; since Gem (openGL) uses positive (additive) geometry, you (unfotunately) cannot just cut out the window, so you have to build the changing walls)
c) use [pix_crop] to cut out a sub-image of an image
d) use [pix_multiply]
e) use shaders to bind the texture-coordinates to the world rather than the manipulated object.
(a), (b) and (e) work on the GPU (your gfx card) and are fast; (c) and (d) work on the CPU (which cannot be used for other things in the meantime) for (e) you need some understanding of how shaders work in openGL (you'll have to write your own), and you need the CVS-version of Gem.
mfg.a.sdr IOhannes
Tebjan Halm wrote:
pix-functions work on pixel-data: very low level; most of the time quite CPU-expensive.
so where are the pixelshaders ??? ;))
as said in the mail (but re-reading it, i admit it is a bit unclear), fragment-shaders (which i guess you are referring to) are in Gem-CVS.
mfg.asdr IOhannes
IOhannes m zmoelnig schrieb:
Tebjan Halm wrote:
pix-functions work on pixel-data: very low level; most of the time quite CPU-expensive.
so where are the pixelshaders ??? ;))
as said in the mail (but re-reading it, i admit it is a bit unclear), fragment-shaders (which i guess you are referring to) are in Gem-CVS.
mfg.asdr IOhannes
to be honest, i dont read the whole mail ... *ashamed* so if i want to use shaders, i have to compile gem together with the shader code ? there is no object, that can load shaders ? ... and which shader language is supported ind gem ?
greets
IOhannes m zmoelnig wrote:
b) use something like thoralf proposed: cover the parts of the image that you don't want to see (think of a landscape behind a wall with a moving window; since Gem (openGL) uses positive (additive) geometry, you (unfotunately) cannot just cut out the window, so you have to build the changing walls)
thank you very much for your quite informative answer !
after all, it's kind of sad for me, that there is no subtractive geometry in pd.. i know a little bit about openGL from an university course.. and know, that in openGL you are able to work easily with subtractive geometry.. you are able to just subtract one object from the other. and that was the functionality i was searching for in gem, in the beginning.
would be glad, if some further version of gem would have this possiblity.. would save me quite a lot of workarounds ;)
thanks so far..
lorenz aka orjo