Announcement

Collapse
No announcement yet.

UI Render To Texture

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Thanks, slow jusko...but not sure how to implement that (probably didnt ask the question right)...this is what I needed:
    http://forums.epicgames.com/threads/...2#post31537392

    Comment


      #17
      I tried swapping the "source" of UILoader based GFXObject.
      Works fine for your basic rectangle (see video).

      If you can't wait for me to upload it somewhere, send me your e-mail

      Comment


        #18
        You mean your video?

        Comment


          #19
          That was strange.
          Fixed/update the video link.
          Should now show what I was talking about.
          Streaming render of your head is replaced with a rockets view when one is fired.
          The scaleform object does not change - just the texture being sent to it.

          Comment


            #20
            I'm getting this errer:

            Code:
            C:\UDK\UDK-2012-10\Development\Src\SLGame\Classes\SLGFxPortraitHUD.uc(49) : Error, Unrecognized type 'MyScaleformRTTObject'

            Comment


              #21
              It should be a GFxClikWidget variable.
              Code:
              var GFxClikWidget MyScaleformRTTObject;
              Not sure why it'd be complaing about it being a 'type'.... ?

              Comment


                #22
                Ya I do have that

                Comment


                  #23
                  With out seeing it in context, I have no idea why it is saying MyScaleformRTTObject is a 'type' then

                  Comment


                    #24
                    ok...here is my GFX Class

                    Code:
                    class SLGFxPortraitHUD extends GFxMoviePlayer;
                    
                    Var TextureRenderTarget2D PortraitRT;
                    var GFxClikWidget MyScaleformRTTObject;
                    
                    //Called from STHUD'd PostBeginPlay()
                    function Init2(PlayerController PC) {
                     //Start and load the SWF Movie
                     Start();
                     Advance(0.f);
                    
                    }
                    
                    
                    
                    //Called every update Tick
                    function TickHUD() 
                    {
                        /*local UserPawn USP;
                    
                        //We need to talk to the Pawn, so create a reference and check the Pawn exists
                        USP = UserPawn(PlayerOwner.Pawn);
                        if (USP == None) 
                        {
                            return;
                        }
                    */
                        
                    }
                    
                    function SetRenderTexture()
                    {
                       SetExternalTexture("portrait",PortraitRT);
                    }
                    
                    
                    function SetMyRTTTexture(string NewTexturePath)
                    {
                        local string FinalTexturePath;
                        
                        FinalTexturePath = "img://" $ NewTexturePath;
                        
                        MyScaleformRTTObject.SetString("source", FinalTexturePath);
                    }
                    
                    event bool WidgetInitialized(Name WidgetName, Name WidgetPath, GFxObject Widget)
                    {
                        local bool bResult;
                        
                        switch(WidgetName)
                        {
                            case 'MyScaleform_RTT':
                                MyScaleformRTTObject = Widget;
                                bResult = true;
                                break;
                        }
                        
                        return bResult ? bResult : Super.WidgetInitialized(WidgetName, WidgetPath, Widget);
                    }            
                    
                    
                    DefaultProperties
                    {
                     //this is the HUD. If the HUD is off, then this should be off
                     bDisplayWithHudOff=false
                     //The path to the swf asset we will create later
                     MovieInfo=SwfMovie'SL_HUD.HUD.SLPortrait'
                     //Just put it in...
                     bGammaCorrection = false
                     portraitRT=TextureRenderTarget2D'SL_HUD.HUD.PortraitRT'
                    
                            SubWidgetBindings.Add((WidgetName="MyScaleform_RTT",WidgetClass=class'GFxObject'))
                    }

                    Comment


                      #25
                      Wow slowJusko ! Your work is great ! I just need sth like that !

                      I have some question about your tutorial.
                      1.First, Did you use SetExternalTexture() ? is this your pipeline : sceneCapture2dActor => a TextureRenderTarget2D => HUD ?
                      or you use UILoader. I knew UILoader as a Scaleform componet for flash-side to show Texture2Ds . Is that what you used ? If yes, I cant make it to show a TextureRenderTarget2D !
                      2. How you remove around your mesh ? UILoader.alpha=255 ? I cant get it.

                      In another word, What is need in addition to Matt Doyle tutorial of setExternalTexture() , to make around area of target mesh transparent ( instead of "clear color" of camera) like youe weapons in bottom of screen?

                      I will be glad if anyone else help me too. And maybe a more detailed tutorial ( preferably AS2 )

                      Thanks for answering my noobie but life-saving questions




                      More:
                      This is what I've done:

                      1.


                      2.


                      3.

                      Comment

                      Working...
                      X