Announcement

Collapse
No announcement yet.

TextureRenderTarget2D crashes the game?

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

    #16
    The game still crashes, but not every time. And texture is not showed.

    Code:
    simulated event PostBeginPlay()
    {
    	local StaticMeshActor act;
    	local ScriptedTexture st;
    	local StaticMeshActor sma;
    	local MaterialInstanceConstant mic;
    	local GFxMoviePlayer gfxmp;
    
    	foreach AllActors(class'StaticMeshActor',act)
    	{
    		if(act.name == 'StaticMeshActor_0' )
    		{
    			sma = act;
    			break;
    		}
    	}
    	if(act!= none)
    	{
    		st = ScriptedTexture(class'ScriptedTexture'.static.Create(512, 512));
    		mic = sma.StaticMeshComponent.CreateAndSetMaterialInstanceConstant(0);
    		mic.SetParent(Material'menu.MainMenuMaterial');
    		mic.SetTextureParameterValue('SwfMovie', st);
    		gfxmp = new class'GFxMoviePlayer';
    		gfxmp.RenderTexture = st;
    		gfxmp.SetMovieInfo(SwfMovie'menu.MainMenu.MainMenu1');
    		gfxmp.Start();
    		gfxmp.Advance(0);
    	}
    }

    Comment


      #17
      For me RenderTexture works fine, but not SetExternalTexture().

      Bob_Gneu, I tried your way on my computers screens and it fixed a bug (changes and inputs on a screen were shared on all others). So thanks for your code

      Comment


        #18
        Meardon, did you have another one texture, that rendered in frame buffer in this game? And did you tried to restart the game 5-10 time?

        Comment


          #19
          Originally posted by Flame_xXx View Post
          Meardon, did you have another one texture, that rendered in frame buffer in this game? And did you tried to restart the game 5-10 time
          No, I have only one texture. And I tested the game several times.

          My old code (now I'm using Bob_Gneu's code) :
          Code:
          Begin Object Class=SG_GFxProg_Subsystem Name=SubsystemComp
          	RenderTexture=TextureRenderTarget2D'PR_SGC_Core.System.T_Screen_4-3'
          End Object
          Subsystem=SubsystemComp
          Defined in the DefaultProperties of the Actor and where SG_GFxProg_Subsystem is a GFxMoviePlayer extended class.

          Comment

          Working...
          X