Главная » Файлы » Unreal Engine 4 » Плагины & Моды

trueSKY для Unreal Engine 4
[ · Скачать удаленно (80,1 МБ) ] 09.09.2014, 23:37

Setting up trueSKY on Unreal Engine 4
The installer puts the plugin into the “[UE4]\Engine\Plugins\TrueSkyPlugin” directory in your UE4 installation. After running the installer, you need to run GenerateProjectFiles.bat in order to update the UE4 project to include the trueSKY plugin. CHANGES
There are now two trueSKY modules in the UE4 project – TrueSkyPlugin, and TrueSkyEditorPlugin. This helps with building for standalone cooked projects. Whereas previously your licence key needed to go in TrueSkyPlugin.cpp, now it should go in TrueSkyEditorPlugin.cpp. YOUR LICENCE KEY
Simul will supply you with a licence key for trueSKY. This key should be pasted at the top of the file [UE4]\Engine\Plugins\TrueSkyEditorPlugin\Private\TrueSkyEditorPlugin.cpp. You can find this file easily by entering it in the Search Box in Visual Studio’s Solution Explorer window:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Insert your licence key in the top line of this file, between the quotes:

  • #define TRUESKY_LICENCE_KEY "Your key goes here"
  • // Replace the string above with your own licence key!

IMPORTANT
The TrueSkyPlugin is built for the current (4.4+) version of UE4. You will need to make the following changes:

  • In [ue4]/Engine/Config/BaseEngine.ini, add this line in the plugins section:
+EnabledPlugins="TrueSkyPlugin"
  • add the following lines to [UE4]\Engine\Source\Runtime\Renderer\Public\RendererInterface.h around line 415, before the definition of IRendererModule:
/// 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

 

  • and around line 524 before the closing “};”
/// BEGIN trueSKY Additional code
virtual void RegisterPostOpaqueRenderDelegate( const FPostOpaqueRenderDelegate& PostOpaqueRenderDelegate ) = 0;
virtual void RenderPostOpaqueExtensions( const FSceneView& View ) = 0;
/// END trueSKY Additional code

 

  • add the following lines to [UE4]\Engine\Source\Runtime\Renderer\Private\RendererPrivate.h, around line 64, just before the closing “};”
/// 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

 

  • And to [UE4]\Engine\Source\Runtime\Renderer\Private\DeferredShadingRenderer.cpp around line 18:
/// BEGIN trueSKY Additional code
#include "EngineModule.h"
/// END trueSKY Additional code

 

  • and around line 932, just before “if (ViewFamily.EngineShowFlags.LightShafts)”:
/// 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

 

  • To [UE4]\Engine\Source\Runtime\Renderer\Private\SceneRendering.cpp around line 1034, before “void FRendererModule::DrawRectangle(“
/// 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
Run UnrealEditor, and select Window>>Plugins

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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 asset trueSkyMacros is in [UE4]/Engine/Plugins/TrueSkyPlugin/Assets/Blueprint. You can import this into any project, and use the Blueprint macros in it. Once you’ve added the asset to your project, head over to the Level Blueprint, and find the macros in the search panel:

 

 

 

 

 

 

 

 

 

 

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
To run your game outside the editor, after building the game and cooking the data, first copy the trueSKY DLL’s into your [Project]/Binaries/[Platform] directory from the directory [UE4]/Engine/Plugins/TrueSkyPlugin/Binaries/[Platform]:
SimulBase_MD.dll
SimulCamera_MD.dll
SimulClouds_MD.dll
SimulCrossPlatform_MD.dll
SimulDirectX11_MD.dll
SimulGeometry_MD.dll
SimulMath_MD.dll
SimulMeta_MD.dll
SimulQtWidgets_MD.dll
SimulScene_MD.dll
SimulSky_MD.dll
SimulTerrain_MD.dll
TrueSkyPluginRender_MD.dll
Secondly, create a directory [Project]/Plugins/TrueSkyPlugin/Resources, and copy the contents of [UE4]/Engine/Plugins/TrueSkyPlugin/Resources into it.
Now you are ready to run your game with trueSKY.

Категория: Плагины & Моды | Добавил: VIPVIT | Теги: trueSKY, Unreal Engine 4
Просмотров: 5661 | Загрузок: 417 | Рейтинг: 5.0/1
Всего комментариев: 0
avatar
ДРУЗЬЯ САЙТА
Файлы для:
Связь с нами

VIPVIT
м.Сумы



+380 93 5560 *** udkdev@mail.ru
GameDev
sample map