Mewa Film User's Guide/Nodes Reference/Over node

From Wikibooks, open books for an open world
Jump to navigation Jump to search

About the Over node[edit | edit source]

With the over node you can layer two images, and control how much they should blend.

Over node

Internally the over node does a digital compositing, also known as alpha blending.

The over node has two inputs. The first input, on the left side, is the background. The second input is the foreground. The output image has the same size as the background image input.

Parameters[edit | edit source]

Blend[edit | edit source]

File:OverBlendTab.png
Over parameters

Sets the blend value. The blend value ranges between 0 and 1, where 1 ...

Tested Hardware[edit | edit source]

The following table shows the result of tested graphics hardware on this effect.

Graphics Hardware Result
ATI RADEON X1200 Series OK
ATI RADEON XPRESS 200M Series FAILED

You can check what your graphics hardware is by selecting the menu Help >> System Info.

Source[edit | edit source]

This MFX file comes with the installation of Mewa Film. You can find it in Mewa Film installation directory inside the folder effects.

<MewaFilmNode Name="Over" Output="Image" 
HelpAddress="http://en.wikibooks.org/wiki/Mewa_Film_User's_Guide/Nodes_Reference/Over_node">

<Input ToolTip="Background image"></Input>
<Input ToolTip="over image"></Input>

<Tab Title="Blend">
  <UniformVariable Type="float" Name="alpha">
    <UISlider Name="Blend" Min="0.0" Max="1.0" Step="0.001" Default="0.5"></UISlider>
  </UniformVariable>
</Tab>


<VertexShader>
void main(void)
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
gl_Position = ftransform();
}
</VertexShader>

<FragmentShader>
uniform sampler2DRect back;
uniform sampler2DRect front;

uniform float alpha;
						 
void main(void)
{

  gl_FragColor = texture2DRect(back, gl_TexCoord[0].st )*alpha + texture2DRect(front, gl_TexCoord[0].st)*(1-alpha);

}
</FragmentShader>

</MewaFilmNode>