RenderChannel

Object Hierarchy | Related C++ Class: RenderChannel

Inheritance

SIObject

RenderChannel

Introduced

v6.0

Description

A render channel is a container for rendered image data output. The channel describes what kind of data can be recorded into it.

There are two types of channels: renderer-provided and user-defined. The renderer-provided type consists of channels that are implicitly provided by the rendering engine (such as the main render output and a depth output).

User-defined channels are used in conjunction with shaders which can be set to record any data into those channels, depending on their channel type.

The render channels are global to the scene and can be found on the SceneRenderProperty.

Methods

IsClassOf operator IsEqualTo operator    
       

Properties

Application Categories ChannelType FullName operator
Help Name operator NestedObjects Origin
OriginPath Parent Type operator UserDefined

Examples

JScript Example

// Create a new render channel to use to pipe a texture
// into an output framebuffer before shading the object.
// The create two regions to show the difference.
NewScene( null, false );
oScene = ActiveProject.ActiveScene;
// Create the render channel to pipe into.
oSceneProp = oScene.PassContainer.Properties( "Scene Render Options" );
oChannel = oSceneProp.CreateRenderChannel( "TextureBypass", siRenderChannelColorType );
// Create a framebuffer to output the channel with.
oScene.ActivePass.CreateFramebuffer( oChannel );
// Create a textured sphere with a Store In Channel shader
oSphere = oScene.Root.AddGeometry( "Sphere", "MeshSurface", "TexturedSphere" );
oMaterial = oSphere.AddMaterial("Blinn");
oBlinn = oMaterial.Shaders("Blinn");
oStoreShd = oBlinn.diffuse.ConnectFromPreset( "Render_Channels/Color_StoreInChannel", 
        siTextureShaderFamily );
oTextureShd = oStoreShd.input.ConnectFromPreset( "Terrain", siTextureShaderFamily );
oStoreShd.channel = oChannel.Name;
// Make sure both viewports are looking at the same thing.
oVM = Application.Desktop.ActiveLayout.Views( "vm" );
oVM.SetAttributeValue( "activecamera:a", "Camera" );
// Create two render regions in viewport A and B.
// Set the B viewport to view the contents of the
// "TextureBypass" render channel.
RenderRegionCreate( siViewportA );
RenderRegionCreate( siViewportB );
RenderRegionSetRenderChannel( siViewportB, oChannel.Name );

See Also

RenderChannelCollection Framebuffer SceneRenderProperty Pass