[Bf-committers] OSL Composite Node

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Jan 9 00:32:32 CET 2013


As I understand it, libjit doesn't actually come with any language
compiler, it's just a way to generate instructions manually. So I'm
not sure how using that would be trivial, LLVM gives you the same
functionality as libjit, but the actual implementation of OSL on top
of LLVM is still a lot of code?

However, OSL is probably missing some things to work as a language for
writing compositing plugins. When it was developed the idea might have
been to use it for various purposes but for now it's been geared
towards writing shaders for render engines. I don't know of anyone who
has used it as a language for e.g. compositing yet, so changes to OSL
may be needed to get that working well.

If you're going to allow only basic pixel processors, i.e. just
reading and writing to pixels in the same location then it fits quite
well already. You can have basic input/output parameters of shaders
and it could run for each pixel.

If you want to do things like blurring it gets more complicated
because there is no concept of image buffers to read/write to, so some
sort of mechanism for that would need to be implemented.

On Tue, Jan 8, 2013 at 11:32 PM, Dan Eicher <dan at trollwerks.org> wrote:
> Hi all,
>
> During the Developer Meeting Ton suggested that someone look into creating
> a comp node based on OSL so I've been (semi-)diligently working on that the
> last couple of days. So far I have done all the plumbing and am ready to
> tackle the trick bits of hooking into OSL.
>
> >From what I can find on the interwebs the way to do it would be like in
> OSL/testshade (
> https://github.com/imageworks/OpenShadingLanguage/tree/master/src/testshade)
> where you set up a 'fake' plane the size of the image (or tile I suppose)
> and evaluate the x, y points on said plane after passing in the
> input/output socket data as parameters.
>
> While this is good and all for complex algorithms it does seem a bit
> overkill for simple pixel filter functions (which the IRC discussion
> proposed). Something like this would be super trivial using libjit (which
> is the only other similar library I'm familiar with) so I'm hoping someone
> knows a method to just call a function using OSL without having to setup a
> shading context. Ton said he'd read on the OSL website that it is also
> designed for stuff like this so I'm guessing that it must be possible
> without too much trouble.
>
> Anyhoo, off to plunge into the deep, dark depths of the OSL codebase.
>
> Dan
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list