Главная » Файлы » Unreal Engine 4 » Плагины & Моды |
[ · Скачать удаленно (80,1 МБ) ] | 09.09.2014, 23:37 |
Setting up trueSKY on Unreal Engine 4
Insert your licence key in the top line of this file, between the quotes:
IMPORTANT
+EnabledPlugins="TrueSkyPlugin"
/// BEGIN trueSKY Additional code class FPostOpaqueRenderParameters { public: FIntRect ViewportRect; FMatrix ViewMatrix; FMatrix ProjMatrix; FRHITexture2D * DepthTexture; FRHITexture2D * SmallDepthTexture; void *Uid; ///< A unique identifier for the view. }; DECLARE_DELEGATE_OneParam(FPostOpaqueRenderDelegate, class FPostOpaqueRenderParameters& ); /// END trueSKY Additional code
/// BEGIN trueSKY Additional code virtual void RegisterPostOpaqueRenderDelegate( const FPostOpaqueRenderDelegate& PostOpaqueRenderDelegate ) = 0; virtual void RenderPostOpaqueExtensions( const FSceneView& View ) = 0; /// END trueSKY Additional code
/// BEGIN trueSKY Additional code public: virtual void RegisterPostOpaqueRenderDelegate( const FPostOpaqueRenderDelegate& PostOpaqueRenderDelegate ) override; virtual void RenderPostOpaqueExtensions( const FSceneView& View ) override; private: FPostOpaqueRenderDelegate PostOpaqueRenderDelegate; /// END trueSKY Additional code
/// BEGIN trueSKY Additional code #include "EngineModule.h" /// END trueSKY Additional code
/// BEGIN trueSKY Additional code if( Views.Num() > 0 ) { SCOPED_DRAW_EVENT(RenderPostOpaqueExtensions,FColor(128,128,255,255)); GetRendererModule().RenderPostOpaqueExtensions(Views[0]); } /// END trueSKY Additional code
/// BEGIN trueSKY Additional code void FRendererModule::RegisterPostOpaqueRenderDelegate( const FPostOpaqueRenderDelegate& PostOpaqueRenderDelegate ) { this->PostOpaqueRenderDelegate = PostOpaqueRenderDelegate; } void FRendererModule::RenderPostOpaqueExtensions( const FSceneView& View ) { check(IsInRenderingThread()); FPostOpaqueRenderParameters RenderParameters; RenderParameters.ViewMatrix = View.ViewMatrices.ViewMatrix; RenderParameters.ProjMatrix = View.ViewMatrices.ProjMatrix; RenderParameters.DepthTexture = GSceneRenderTargets.GetSceneDepthSurface()->GetTexture2D(); RenderParameters.SmallDepthTexture = GSceneRenderTargets.GetSmallDepthSurface()->GetTexture2D(); RenderParameters.ViewportRect = View.ViewRect; RenderParameters.Uid=(void*)(&View); PostOpaqueRenderDelegate.ExecuteIfBound( RenderParameters ); } /// END trueSKY Additional code The modified versions of these files can also be found in the [UE4]\Engine\Plugins\TrueSkyPlugin\UE4-Modifications directory after installation. Also, the current plugin source code, and the files above, can also be found in the trueSKY UE4 plugin repository: https://github.com/simul/ue4. Once you have made these modifications, run [UE4]/GenerateProjectFiles.bat, or in Visual Studio, press the “Refresh Projects” button in the UE4 Visual Studio Add-in Toolbar: Now build the UE4 project – the trueSKY plugin will also be built. INITIALIZING TRUESKY IN THE UNREAL EDITOR
Type “trueSKY” into the search box to find the plugin, and check its “enabled” box, then click “Restart Now”.
After Restart, the “Window” menu will have new options. Select “Add Sequence to Scene”. This creates a TrueSKYSequenceActor in your current scene.
Now you need to create a Sky Sequence Asset for the Actor to refer to. In Content Browser, right-click or select “New>> Miscellaneous>> TrueSkySequenceAsset”, to add the asset to your project.
In the Scene Outliner, select your trueSKY sequence actor , and in the Details panel, set its Active Sequence to be the newly created asset:
To edit the sequence, double-click on the asset:
Blueprints
The macros are shortcuts – you can connect individual trueSKY functions by placing a reference to the trueSKY actor, and the directional light, on the master Level Blueprint. For example, connect the Get Sun Rotation output from trueSKY to the Directional Light’s Set Actor Rotation input.
Running Cooked Games | |
Просмотров: 5661 | Загрузок: 417 | |
Всего комментариев: 0 | |