Announcement

Collapse
No announcement yet.

Problem with DrawPortal and ScriptedTexture

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

    Problem with DrawPortal and ScriptedTexture

    Hello,

    I am trying to render the view from another Actor into a ScriptedTexture, which I can then draw onto my HUD. I've tried to use DrawPortal on a ScriptedTexture, but I always end up with nothing (just blackness). Has anyone ever got DrawPortal to work on a texture? DrawText works fine, so I'm confident that the ScriptedTexture itself is OK.

    I can almost achieve the effect I want using DrawPortal directly on my HUD's Canvas, but DrawPortal does not provide the ability to clip or warp the resulting view in the same way as DrawTile and DrawTileClipped do for materials. I want to be able to clip and stretch the portal view in strange ways...

    Any pointers to a mod or code that already does this would be fantastic.

    Thanks in advance,
    mrbo.

    #2
    I did something similar using CameraTextureClients attached to actors.

    Comment


      #3
      Thanks

      Thanks for the reply.

      I looked up CameraTextureClient on the Wiki and it looked promising until I read:

      Info for coders: CameraTextureClient are declared as bNoDelete=True, so they can't be spawned from UnrealScript.

      I really want to be able to control this all from my code, rather than having to modify maps by adding in extra actors. I will however check out the UnrealScript for CameraTextureClient and see if I can create something similar.

      mrbo.

      Comment


        #4
        Nearly...

        Hi,

        OK - had some success with creating a class similar to CameraTextureClient. I am getting the portal drawn into the texture, and the texture is being drawn to the HUD, but I am also getting a strange effect...

        It appears as though the texture is being drawn, and then drawn again inside itself. Here is a screenshot to illustrate:



        Has anyone encountered this before? It's almost like the render texture command is being run on itself? Very confusing.

        Thanks in advance,
        mrbo.

        Comment


          #5
          Re: Thanks

          Originally posted by mrbo
          Info for coders: CameraTextureClient are declared as bNoDelete=True, so they can't be spawned from UnrealScript.
          Just subclass it and set it to false.

          Comment


            #6
            Hmm...

            Just subclass it and set it to false.
            That's what I did

            Plus I added several other modifcations such as:

            DestTexture = ScriptedTexture(Level.ObjectPool.AllocateObject( class'ScriptedTexture' ) );

            because I want to render to a new texture rather than an existing skin.

            I'll keep playing...

            mrbo.

            Comment

            Working...
            X