Results 1 to 14 of 14
  1. #1
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default Fade out everything but the player

    I would like to use a death effect where the whole scene fades to black (or if possible, to a post-process material) EXCEPT for the player pawn.

    I've been thinking about it though, and I can't quite figure out how to pull this off.

    I had a couple loose thoughts that I can't bring anywhere. I know you can set a mesh to a higher scene depth priority group; I was already planning on having an duplicate player mesh in this group to serve a few other effects. If I could somehow fade out a particular scene-depth group then I could use that method to pull this off, but I don't know if that is even possible. I find myself thinking I could alternatively set it to a group that is higher than the post-process effect I could run a post-process effect behind the player, but there is no such group.
    I also think that if I could somehow get the post-process effect to recognize the player pawn and exclude it, that would work. Even if all I had was the Silhouette of the player I could use that. I imagine it would only be possible with a post-process material, but I know of no node that can identify any property that I could set on the player model.

    Has anyone tried this before? Does anyone have any thoughts on how to pull this off?
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  2. #2
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    So, nobody's done this before?
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  3. #3

  4. #4
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    Code:
    class Scene extends Object
    	native(Scene);
    
    /**
     * A priority for sorting scene elements by depth.
     * Elements with higher priority occlude elements with lower priority, disregarding distance.
     */
    enum ESceneDepthPriorityGroup
    {
    	// unreal ed background scene DGP
    	SDPG_UnrealEdBackground,
    	// world scene DPG
    	SDPG_World,
    	// foreground scene DPG
    	SDPG_Foreground,
    	// unreal ed scene DPG
    	SDPG_UnrealEdForeground,
    	// after all scene rendering
    	SDPG_PostProcess
    };
    There may be something that technically exists, but there is no variable for it in the enum, so I can't set it to that.
    I'd like to think that I could extend scene and add in new variables to that enum, but I can't think of any place in my code where I could specify the use of a new scene.

    By the way, while trying to put together a death effect I could use (even if it is not the one I want) I realize that I can't figure out how to adjust the post-processing from within my code. (Kismet, sure, but I want this available on all levels.) The only example I can think of to reference is the hit effect in UT, but it doesn't even appear in UDK so I have no idea what code examples from that are relevant and not. But it's a bit pointless anyway, because for some reason the hud disappears when I die. I can't seem to find any code that causes this, but the HUD ceases to be once the player is dead.

    EDIT/UPDATE:
    Oh hey I just found something!
    It turns out that within the post-processing chain I can set various nodes to specific depth groups!
    I just tested it and I can set a material node to the World group and anything in the foreground group in left untouched!
    It doesn't work with the UberPostProcess node so I have to use a material to control desaturation and fading to black, but that puts me well on my way to setting this up the way I want!

    So now what I need to know is this:
    -How do I select a specific PPC to use with all levels in my game?
    -How do I adjust parameters of the material used in the PPC?
    -How can I adjust the Blur Kernal Size of the BlurEffect node in my PPC from the code?
    Last edited by marscaleb; 05-23-2012 at 02:12 PM.
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  5. #5
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,274

    Default

    I found some old test code in my toolkit that might help, but I don't guarantee it! It's been awhile since post-process was on my todo list

    Code:
    /*--------------------------------------------------------------------------*\
        Post process management
    \*--------------------------------------------------------------------------*/
    
    
    function AddPPEOverride()
    {
        local PostProcessSettings    pps;
        
    //    pps.bOverride_AllowAmbientOcclusion        = true;        // Override the setting for AllowAmbientOcclusion...
    //    pps.bAllowAmbientOcclusion                = false;    // ... with this
        pps.bOverride_Scene_Desaturation        = True;        // Override Scene_Desaturation...
        pps.Scene_Desaturation                    = 1.0;        // ... with this
        
        LocalPlayer(GetALocalPlayerController().Player).OverridePostProcessSettings(pps, 2.0);
    }
    
    
    
    
    function RemovePPEOverride()
    {
        LocalPlayer(GetALocalPlayerController().Player).ClearPostProcessSettingsOverride(2.0);
    }
    
    
    /*
        !important: the default chain has unnamed effects, making FindPostProcessEffect useless
        To fix this I've added the missing names in the package.
    */
    
    
    function PostProcessTest()
    {
        local PostProcessEffect    effect;
        
        effect = GetPostProcessEffect('PPFxUber', class'UberPostProcessEffect');
        
        if( effect != None )
        {
        //    UberPostProcessEffect(effect).ToneMapperType = Tonemapper_Off;
            effect.bShowInGame = !effect.bShowInGame;
        }
        
        effect = GetPostProcessEffect('PPFxAO', class'AmbientOcclusionEffect');
        
        if( effect != None )
        {
            effect.bShowInGame = !effect.bShowInGame;
        }
    }
    
    
    function PostProcessEffect GetPostProcessEffect( name effectName, class effectClass )
    {
        local LocalPlayer            localPlayer;
        local PostProcessEffect        effect;
        
        localPlayer = LocalPlayer(GetALocalPlayerController().Player);
        
        if( localPlayer != None && localPlayer.PlayerPostProcess != None )
        {
            effect = localPlayer.PlayerPostProcess.FindPostProcessEffect(effectName);
            
            if( effect != None && effect.Class == effectClass )
            {
                return effect;
            }
        }
        return None;
    }

  6. #6
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    Well it's something, so I'll take a look at it. Thank you!

    Also, I love how you commented out the section header. I may steal that.
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  7. #7
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    Okay, I have been looking over that code and finding everything it references. It would be very useful to adjust individual settings. However I just can't find the options to override everything I would need.

    Perhaps I could take a much simpler approach.

    All I need is an ability to tell the game to use a particular post-process chain, as well as supplying an amount of time to blend into the new chain.
    But the only function I can find is "InsertPostProcessingChain" which seems to just add one chain onto another, (without any blend time variable) which isn't quite what I'm looking for...
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  8. #8
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,274

    Default

    I need to look into PPE again sometime but I think the override method is only for the built-in Uber effect chain. Blending between custom chains will probably require adding both chains and manually interpolating their values to cross-fade between them.

  9. #9
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    I've got everything working properly except for a transition time to the effect. I used local player's "InsertPostProcessChain" to put in my custom PPC that only effects the world DPC. I have a foreground mesh of the player that stays visible despite the effect performed in this PPC. It works, except that the transition is instantaneous instead fading.

    Does anyone know how to set a specific PPC and fade slowly into it?
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  10. #10
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Posts
    213

    Default

    Matinee, probably. That's where most of the other keyframed animations happen. The effect sounds interesting so far, nice work.

  11. #11
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    Hmm, but isn't Matinee saved as part of the level data? If so then the effect would be level-dependent. It might "work" that way but I would have set up every level in the game to run a Matinee sequence. I suppose it could be a level that is streamed into every level, but either way it requires the level to be set up properly.

    I guess it would be better than nothing, but there has to be a way to do it properly.
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  12. #12
    MSgt. Shooter Person
    Join Date
    Feb 2011
    Posts
    213

    Default

    Yeah,good point. Hmmm, problems like these intrigue me, because I can totally see using it myself at some point. I think I found something for you:

    http://forums.epicgames.com/threads/...1#post25417838
    [Quotes "Controlling through Gameplay Script" from UDN].

    The problem with the using the overrides is that mapper placed PostProcessEffects won't work while they're being used, but that might be fine. Alternatively you can create a PostProcessChain in UEd and set up the effect as part of that, and change players to use that PostProcessChain.

    Which lead me to the UDN here and here:

    http://udn.epicgames.com/Three/PostP...ameplay Script

    http://udn.epicgames.com/Three/PostP...ameplay Script


    I hope that turns up something useful.

  13. #13
    Iron Guard
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    501

    Default

    How about fading in an object like a flat plane taking up all the screen space while setting the player to be always drawn on the foreground?
    /ninjapirates/
    ---Roccy Laboratories//#1 Crossmedia 2010[Multimedia]

    I hate reference images...I never find good ones

  14. #14
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    562
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    Quote Originally Posted by joshua.fontany View Post
    I think those pages must be out-dated. I searched through all the source scripts and I found only one occurrence of CurrentPPInfo, which was where it was declared as a variable. And since it doesn't get used anywhere (except perhaps by native code) it is effectively useless. I also couldn't find the Post Process Manager class mentioned on those same pages, so really I seem to be stuck looking at the same problem:
    I can't replace the post process chain with a blend time, and LocalPlayer.OverridePostProcessSettings doesn't give me access to the variables I need to control.

    Quote Originally Posted by HavocInferno View Post
    How about fading in an object like a flat plane taking up all the screen space while setting the player to be always drawn on the foreground?
    That's actually a really cool idea, I just don't think I can create quite the effect I want using it. I could create some other cool effects, though.
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.