Open adallafontana opened 10 years ago
Hi,
I have never test this function in the plugin. But maybe we need to add something to support more vars. Actually only u and v are setted as vars: https://github.com/tuttleofx/TuttleOFX/blob/develop/plugins/image/generator/SeExpr/src/SeExprProcess.tcc#L65
And it can explain why others example works, they use only u and v variables.
I don't know nothing about OFX code, but SeExpr is realy powerful, the possibility of linking a image/sequence source node and use that in the SeExpr composition for create effect will be the max for me, blur, warp,....and so on. All demo from disney works, the example with "purple" sphere with light too. But I'm thinking SeExpr is only for "generate", is it working only with cpu, GPU/pixelshader are not support?
Yes I can ake a look on it to made it work. Can you send me your SeExpr code with the sample image ?
About the GPU no it's not actually upported. But last summer they wan't to participate at the Google Summer of Code to add JIT compiler (Just In Time compiler) using LLVM to build on CPU and GPU. A litle like halide [http://halide-lang.org]
I did refer at this screenshot, the only stuff what I found on web and at to the disney documents:
vector map( string filename, [float format-arg], [float u, float v], [int channel] ) Access a texture map. Note: strings must be enclosed in single or double quotes.
tnx
Thank you for the link really interesting. My goal will be to can use SeExpr also for compositing not only for generate "funny noise" or gradient. In SeExpr I can separate and combine channels color: color=[color[0], color[1],color[2]] I can create for example a Despill filter in easy way just substrat channel, or convert rgb to yuv,..... but I must have access to the sample image linked to the SeExpr node. The other big features will be have the variable on interface of node, so I will have the possibility to change parameter and insert keyframe. I use Lightworks that have a good way for create in easy way a custom filter with a interface-compiler, I can write a pixellshader but with pragma information too for create slider/bool/color-picker, so I have filter and I can modifier it on interface:
//-------------------------------------------------------------- // KeyDespiil Despill Background Based // http://www.alessandrodallafontana.it/ //-------------------------------------------------------------- int _LwksEffectInfo < string EffectGroup = "GenericPixelShader"; string Description = "KeyDespill"; string Category = "Keying";
= 0;
//-------------------------------------------------------------- // Inputs //-------------------------------------------------------------- texture InputFg; texture InputBg;
sampler FgSampler = sampler_state { Texture =
//-------------------------------------------------------------- // Parameters //--------------------------------------------------------------
int SetTechnique < string Description = "Key"; string Enum = "Green,Blue";
= 0;
float RedAmount < string Description = "RedAmount"; float MinVal = 0.0; float MaxVal = 1.00;
= 0.5;
//-------------------------------------------------------------- // Shader //--------------------------------------------------------------
float4 Green(float2 xy1 : TEXCOORD1, float2 xy2 : TEXCOORD2 ) : COLOR {
float4 color = tex2D(FgSampler, xy1);
float4 Back = tex2D(BgSampler, xy2);
float mask = clamp(color.g-mix(color.r, color.b, RedAmount), 0, 1);
color.g = color.g-mask;
color += Back * mask;
return color;
}
float4 Blue(float2 xy1 : TEXCOORD1, float2 xy2 : TEXCOORD2 ) : COLOR {
float4 color = tex2D(FgSampler, xy1);
float4 Back = tex2D(BgSampler, xy2);
float mask = clamp(color.b-mix(color.r, color.g, RedAmount), 0, 1);
color.b = color.b-mask;
color += Back * mask;
return color;
}
///---------------------------------------------------- /// Technique ////// ///----------------------------------------------------
technique GreenDespill { pass p0 { PixelShader = compile PROFILE Green(); } }
technique BlueDespill { pass p0 { PixelShader = compile PROFILE Blue(); } }
So I can create many input, slider for controll the parameters etc.... and all can be compiling inside Lightworks cross platform. But Lightworks is basically a video Editor, I'm looking for have the same in the node based compositing. SeExpr will be the way?
tnx
Hi Alessandro,
Nice to share your goal, because it's a very interesting case ;-) In fact it could be interesting for you if I can create a node with 2 inputs, one for the image, the other one for the map. And with that we can purpose to have a process node based on SeExpr.
I need to take a look on that, on possibilities to pass a data array for map, not a filename. But maybe I can also contact SeExpr for that.
It can be very very interesting to present nodal processing to research labs with this tool.
But yes maybe the other way is to based the process on the Halide library, but a little more complicated to provide a multi platform distribution (Windows, Linux, Mac...). But it will be a little more programming think than SeExpr who was more mathematical oriented.
I will take a look on that and I'll get some feed back soon.
Marc-Antoine |e:arnaud.marcantoine@gmail.com |tel: 06-84-71-84-45 | ohloh: http://bit.ly/1iwtlsU [image: LinkedIn] http://s.wisestamp.com/links?url=https%3A%2F%2Fwww.linkedin.com%2Fpub%2Fmarc-antoine-arnaud%2Fb%2F7b8%2F2a3&sn=YXJuYXVkLm1hcmNhbnRvaW5lQGdtYWlsLmNvbQ%3D%3D [image: Google Plus]
thanks for your interest
I have build the master of SeExpr for test the ImageSynth app on Ubuntu, all done but after some test and some research, I don't believe there is the possibility of the manage texture with "master" version of SeExpr because I can't find "map" function, for this I found this branch: https://github.com/dboogert/SeExpr/tree/texture But I can't build without OIIO, EXR and bla.. bla.. bla... too complicate for me.... Also Ramen had a version of SeExpr with the possibility of insert slider etc... but the project seem closed.
Could you ask them the status of this branch? If it will be merged or not? We are interested if you have recommandations for the version of SeExpr to provide in our next release.
"We are interested if you have recommandations for the version of SeExpr to provide in our next release.": Custom variable widgets, I don't know nothing about OFX-dev, so I don't know if I'm asking you to do the impossible; I don't know if this one is possible on OFX plugin, but in Shake and I believe in Nuke you can add for example a float slider call "Var1" and after use $Var1 in code for drive the value. We will have a different level of utilization of SeExpr node also leaving aside the pixel/image managing. For animate parameter now in SeExpr node I can only use $frame, good but for to be useful we must have the possibility of insert keyframe too.
It is not possible to create parameters interactively in OpenFX. But it is possible to generate plugins when loading OpenFX files. So we can imagine to test your SeExpr expression dynamically and then create a simple file to describe your parameters. Then close/reopen nuke, and get a new ofx node for each of thoses files. And then we need to add something to access param values with an extension to the SeExpr syntax.
More or less like on Renderman/3Delight shaders where you can write pragma information for generate widget on the interface of Maya, the widget parameters are inside the shader code. Could be good, the interactively for widget is not so important, yes you can write only what you need after created the effect, maybe also better. 1) create the "effect" dynamically on Nuke/Natron etc.... 2) save code in .txt and add code for widgets. 3) import the .txt in SeExpr node like file instead code.
I don't know how much on rendering performance an effect created with SeExpr can be lower respect to the same in standard OFX. noise through->SeExpr vs. noise->OFX; will be try.
"Could you ask them the status of this branch? If it will be merged or not?" I ask but I have little hope. If I understand, maybe the way is "only" compile the plugin what you find on that git address; from the file texture.cpp generate the plugin texture.so and install ENV, I tried follow the them example from here: http://wdas.github.io/SeExpr/doxygen/plugins.html
....but is not my job!! I had install all lib, oiio, exr, bla... bla... but I always miss something.
Hi, i'm starting using tuttle seexpr on Natron, but I don't knok "how" or "if" I can input/link image and manage that with seexpr. "Cs" is color source but not the "sample image" source. I have tried use: sample=map("path/to/image", [u,v,0]); sample but without result. All other code for create noise, ramp, ect.... works.
tnx