Sunday, 3 May 2009

Shortcut for viewing alpha overlay with motion blur in Silhouette 3

A big problem for users coming to Silhouette 3 from version 2.3 is the lack of some shortcuts that made the roto workflow in 2.3 so fast and comfortable.
The number one shortcut that is missing is the good old "Shift+A" to toggle between Alpha Overlay (with motion blur) and the Foreground.
The problem is the new "Node" architecture where you can only see motion blur when you're looking at the Output Node.

But the guys at SilhouetteFX listened and have added all the necessary keybinds so the old 2.3 workflow is now possible again (Well done guys!).
The ingredients are actually in the default keybinds.py but you still have to modify it a bit.

Below is an updated rgba() function. Just replace the old one with this one.



# RGBA mode

rgba_mode = False
rgba_prev_view = 0
rgba_prev_view_node = None

def rgba():
global rgba_prev_view_node
global rgba_mode
global rgba_prev_view

rgba_mode = not rgba_mode
if rgba_mode:
rgba_prev_view_node = fx.viewer.viewNode
rgba_prev_view = fx.viewer.viewMode
fx.viewer.setViewNode("OutputNode")
fx.viewer.setOverlay(False)
fx.viewer.setChannelMask(fx.Color(1, 1, 1, 1))
fx.viewer.setViewMode(0)
else:
fx.viewer.setOverlay(True)
fx.viewer.setChannelMask(fx.Color(1, 1, 1, 0))
fx.viewer.setViewNode(rgba_prev_view_node)
fx.viewer.setViewMode(rgba_prev_view)

fx.bind('Shift+a', rgba)


So with this function added you can now tweak your splines in the roto node while looking at the Roto Node Foreground View and by pressing "Shift+a" you can now jump to viewing the Output Node with Alpha Overlay and normal Overlay disabled. Pressing "Shift+a" again brings you back to the Roto Node Foreground View.

One very important shortcut that is still missing is a shortcut for looking at the Composite with motion blur. At the moment this is unfortunately not easily done.
SilhouetteFX would either have to add a keybind to enable/disable nodes (in this case the Composite Node / At the moment i don't know why there is a Composite Node anyway but maybe they want to add more sophisticated stuff to this node later) or add a Composite View to the Output Node (which would make a lot of sense imo).

Friday, 10 April 2009

Customising shaders in Silhouette 3

What i love about Silhouette is that the developers let you customise a lot of stuff.
The ability to script your own keyboard shortcuts is invaluable for something as
keystroke intensive as paint & roto.

Another area that is customisable are the shaders. They control how the pixel values of your images are displayed on your monitor.
In Silhouette all the colour transformations defined in the shader happen inside the GPU of the graphics card in realtime.
That is why no new caching is needed when you change the viewer settings which is really helpful.
In Silhouette 3 these shaders are written in the OpenGL Shading Language (GLSL) which is similar to C and they can be found in the installation directory in the shaders folder.

I want to give you an example where such customisation might be useful.
One thing i was never really happy with in Silhouette are the limited ranges of the black and white point settings.
Per default the ranges are only 0 - 0.2 and 0.8 - 1.2 respectively and the values are used like the values in Shake's "Compress" node.
Well i prefer the "Expand" node usually and would like to extend the ranges of the sliders.
To achive this i changed the viewer_rgb.glsl shader (always a good idea to make a backup before changing the file) which is used for 8 and 16bit projects.
Below you can see the code i replaced the old black/white point code with:

// black/white point
float blackPoint2 = blackPoint*3.0-0.2;
float whitePoint2 = (whitePoint-1.0)*2.0+1.0;
float slope = (1.0/(whitePoint2 - blackPoint2));
c = slope * c - slope * blackPoint2;

First of all i remap the old black and white point slider ranges to -0.2 - 0.4 and 0.6 - 1.4 ( note that a interface blackpoint setting of 0.066 represents 0 in the shader now ).
Then i add the colour transformation function which in a lot of cases and also for an "Expand" is a simple linear function.
Quite easy and very helpful i think.