UDN
Search public documentation:

GFxUsingRenderTargets
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > User Interfaces & HUDs > Scaleform GFx > How to use render targets

How to use render targets


Overview


Here is a basic setup for capturing a 3D mesh from the game and rendering it to Flash with a scene capture actor.

Unrealscript
  var TextureRenderTarget2D MyRenderTexture;
  
  function SetRenderTexture()
  {
    SetExternalTexture("MyRenderTarget",MyRenderTexture);
  }
  
  defaultproperties
  {
    MyRenderTexture=TextureRenderTarget2D'MyPackageName.MyRenderTexture'
  }
  

Replace 'MyPackageName.MyRenderTexture' with the actual render target 2D texture resides in your packages.

ActionScript
ExternalInterface.call("SetRenderTexture");

The Flash file would have a movieclip in it. Give that movie clip an instance name of MyRenderTarget_mc. That movieclip should contain a PNG file - any image will do as it will be replaced. The PNG will end up being replaced by the render texture in the game. The PNG file should have its linkage setup to 'Export for ActionScript' and 'Export in frame 1' and the Identifier for this texture should be set to MyRenderTarget. (These things are found by right clicking the PNG in the Library panel and choosing properties.)

In your level, you would set up a SceneCapture2DActor and point it at your object. Create a new TextureRenderTarget2D in the Content Browser and name it to what you've specified in Unrealscript. Select the new render texture, then go into the Texture Target field of the capture actor, and insert TextureRenderTarget2D'MyPackageName.MyRenderTexture' by pressing the green arrow.

My External Texture is rendering transparently!


  1. Select the movie clip containing the texture to be replaced by the SceneCapture2DActor image.
  2. Set the Color Effect to Advanced.
  3. Set Alpha (xA +) to 255
  4. Save, Publish, and Reimport.