mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-06 19:01:06 +03:00
Improved fades and cinematic bars
This commit is contained in:
parent
e80146e6bf
commit
1d0cfa8554
19 changed files with 408 additions and 103 deletions
Binary file not shown.
|
@ -9,10 +9,6 @@ title = Level.new();
|
||||||
title.script = "andrea2.lua";
|
title.script = "andrea2.lua";
|
||||||
title.soundtrack = 110;
|
title.soundtrack = 110;
|
||||||
title.filename = "Data\\title.trc";
|
title.filename = "Data\\title.trc";
|
||||||
title.horizon = true;
|
|
||||||
title.coladdhorizon = true;
|
|
||||||
title.layer1 = SkyLayer.new(120, 80, 50, -4);
|
|
||||||
title.storm = true;
|
|
||||||
title.background = "Title.png";
|
title.background = "Title.png";
|
||||||
|
|
||||||
Gameflow:addLevel(title);
|
Gameflow:addLevel(title);
|
||||||
|
@ -155,4 +151,56 @@ oldMill.storm = true;
|
||||||
oldMill.laraType = LaraType.Young;
|
oldMill.laraType = LaraType.Young;
|
||||||
oldMill.layer1 = SkyLayer.new(120, 80, 50, -4);
|
oldMill.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
Gameflow:addLevel(oldMill);
|
Gameflow:addLevel(oldMill);
|
||||||
|
|
||||||
|
-- 13th floor
|
||||||
|
rich1 = Level.new();
|
||||||
|
|
||||||
|
rich1.name = 111;
|
||||||
|
rich1.script = "rich1.lua";
|
||||||
|
rich1.soundtrack = 124;
|
||||||
|
rich1.filename = "Data\\rich1.trc";
|
||||||
|
rich1.horizon = true;
|
||||||
|
rich1.coladdhorizon = true;
|
||||||
|
rich1.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(rich1);
|
||||||
|
|
||||||
|
-- Escape with the Iris
|
||||||
|
iris = Level.new();
|
||||||
|
|
||||||
|
iris.name = 112;
|
||||||
|
iris.script = "rich2.lua";
|
||||||
|
iris.soundtrack = 129;
|
||||||
|
iris.filename = "Data\\rich2.trc";
|
||||||
|
iris.horizon = true;
|
||||||
|
iris.coladdhorizon = true;
|
||||||
|
iris.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(iris);
|
||||||
|
|
||||||
|
-- Security breach
|
||||||
|
sec = Level.new();
|
||||||
|
|
||||||
|
sec.name = 113;
|
||||||
|
sec.script = "rich3.lua";
|
||||||
|
sec.soundtrack = 129;
|
||||||
|
sec.filename = "Data\\rich3.trc";
|
||||||
|
sec.horizon = true;
|
||||||
|
sec.coladdhorizon = true;
|
||||||
|
sec.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(sec);
|
||||||
|
|
||||||
|
-- Red alert!
|
||||||
|
redAlert = Level.new();
|
||||||
|
|
||||||
|
redAlert.name = 114;
|
||||||
|
redAlert.script = "rich4.lua";
|
||||||
|
redAlert.soundtrack = 129;
|
||||||
|
redAlert.filename = "Data\\rich4.trc";
|
||||||
|
redAlert.horizon = true;
|
||||||
|
redAlert.coladdhorizon = true;
|
||||||
|
redAlert.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(redAlert);
|
52
Build/Shaders/FinalPass.fx
Normal file
52
Build/Shaders/FinalPass.fx
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
bool CinematicBars;
|
||||||
|
float FadeFactor;
|
||||||
|
|
||||||
|
texture Texture;
|
||||||
|
sampler2D TextureSampler = sampler_state {
|
||||||
|
Texture = (Texture);
|
||||||
|
MinFilter = Linear;
|
||||||
|
MagFilter = Linear;
|
||||||
|
AddressU = Wrap;
|
||||||
|
AddressV = Wrap;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VertexShaderInput
|
||||||
|
{
|
||||||
|
float3 Position : POSITION0;
|
||||||
|
float2 TextureCoordinate : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VertexShaderOutput
|
||||||
|
{
|
||||||
|
float4 Position : POSITION0;
|
||||||
|
float2 TextureCoordinate : TEXCOORD0;
|
||||||
|
float4 PositionCopy : TEXCOORD1;
|
||||||
|
};
|
||||||
|
|
||||||
|
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
|
||||||
|
{
|
||||||
|
VertexShaderOutput output;
|
||||||
|
|
||||||
|
output.Position = float4(input.Position, 1.0f);
|
||||||
|
output.TextureCoordinate = input.TextureCoordinate;
|
||||||
|
output.PositionCopy = output.Position;
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||||
|
{
|
||||||
|
if (CinematicBars && (input.PositionCopy.y < -0.8f || input.PositionCopy.y >= 0.8f))
|
||||||
|
return float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
return float4(tex2D(TextureSampler, input.TextureCoordinate).rgb * FadeFactor, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
technique FullScreenQuad
|
||||||
|
{
|
||||||
|
pass Pass1
|
||||||
|
{
|
||||||
|
VertexShader = compile vs_3_0 VertexShaderFunction();
|
||||||
|
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||||
|
}
|
||||||
|
}
|
BIN
Build/Title.png
Normal file
BIN
Build/Title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,016 KiB |
BIN
Build/savegame.1
Normal file
BIN
Build/savegame.1
Normal file
Binary file not shown.
|
@ -71,8 +71,7 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
{
|
{
|
||||||
if ((DbInput & 0x200000 || GlobalEnterInventory != -1) && !CutSeqTriggered && LaraItem->hitPoints > 0)
|
if ((DbInput & 0x200000 || GlobalEnterInventory != -1) && !CutSeqTriggered && LaraItem->hitPoints > 0)
|
||||||
{
|
{
|
||||||
// stop all sounds
|
// Stop all sounds
|
||||||
|
|
||||||
INVENTORY_RESULT inventoryResult = g_Inventory->DoInventory();
|
INVENTORY_RESULT inventoryResult = g_Inventory->DoInventory();
|
||||||
switch (inventoryResult)
|
switch (inventoryResult)
|
||||||
{
|
{
|
||||||
|
@ -84,11 +83,6 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DbInput & 0x2000)
|
|
||||||
{
|
|
||||||
DoPauseMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Has level been completed?
|
// Has level been completed?
|
||||||
if (LevelComplete)
|
if (LevelComplete)
|
||||||
return GAME_STATUS::GAME_STATUS_LEVEL_COMPLETED;
|
return GAME_STATUS::GAME_STATUS_LEVEL_COMPLETED;
|
||||||
|
@ -177,14 +171,20 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
LaraControl();
|
LaraControl();
|
||||||
InItemControlLoop = false;
|
InItemControlLoop = false;
|
||||||
|
|
||||||
j_HairControl(0, 0, 0);
|
HairControl(0, 0, 0);
|
||||||
if (level->LaraType == LARA_DRAW_TYPE::LARA_YOUNG)
|
if (level->LaraType == LARA_DRAW_TYPE::LARA_YOUNG)
|
||||||
j_HairControl(0, 1, 0);
|
HairControl(0, 1, 0);
|
||||||
|
|
||||||
if (UseSpotCam)
|
if (UseSpotCam)
|
||||||
|
{
|
||||||
|
g_Renderer->EnableCinematicBars(true);
|
||||||
CalculateSpotCameras();
|
CalculateSpotCameras();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
g_Renderer->EnableCinematicBars(false);
|
||||||
CalculateCamera();
|
CalculateCamera();
|
||||||
|
}
|
||||||
|
|
||||||
Wibble = (Wibble + 4) & 0xFC;
|
Wibble = (Wibble + 4) & 0xFC;
|
||||||
|
|
||||||
|
@ -345,6 +345,8 @@ GAME_STATUS __cdecl DoLevel(__int32 index, __int32 ambient, bool loadFromSavegam
|
||||||
|
|
||||||
__int32 nframes = 2;
|
__int32 nframes = 2;
|
||||||
GAME_STATUS result = ControlPhase(nframes, 0);
|
GAME_STATUS result = ControlPhase(nframes, 0);
|
||||||
|
g_Renderer->FadeIn();
|
||||||
|
|
||||||
//JustLoaded = 0;
|
//JustLoaded = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,29 @@ __int32 __cdecl DrawPhaseGame()
|
||||||
return nFrames;
|
return nFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__int32 DrawGame()
|
||||||
|
{
|
||||||
|
// Control routines uses joints calculated here for getting Lara joint positions
|
||||||
|
CalcLaraMatrices(0);
|
||||||
|
phd_PushUnitMatrix();
|
||||||
|
CalcLaraMatrices(1);
|
||||||
|
|
||||||
|
// Calls my new rock & roll renderer :)
|
||||||
|
g_Renderer->Draw();
|
||||||
|
nFrames = g_Renderer->SyncRenderer();
|
||||||
|
|
||||||
|
// We need to pop the matrix stack or the game will crash
|
||||||
|
MatrixPtr -= 12;
|
||||||
|
DxMatrixPtr -= 48;
|
||||||
|
|
||||||
|
return nFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
__int32 DrawInventory()
|
||||||
|
{
|
||||||
|
return g_Renderer->DrawInventory();
|
||||||
|
}
|
||||||
|
|
||||||
void __cdecl DoBootScreen(__int32 language)
|
void __cdecl DoBootScreen(__int32 language)
|
||||||
{
|
{
|
||||||
//printf("DoBootScreen\n");
|
//printf("DoBootScreen\n");
|
||||||
|
@ -144,6 +167,6 @@ void Inject_Draw()
|
||||||
INJECT(0x0044FF40, UndrawPistolsMeshRight);
|
INJECT(0x0044FF40, UndrawPistolsMeshRight);
|
||||||
INJECT(0x0044DBB0, DrawShotgunMeshes);
|
INJECT(0x0044DBB0, DrawShotgunMeshes);
|
||||||
INJECT(0x0044FE60, DrawPistolsMeshes);*/
|
INJECT(0x0044FE60, DrawPistolsMeshes);*/
|
||||||
INJECT(0x0042A400, DrawPhaseGame);
|
//INJECT(0x0042A400, DrawPhaseGame);
|
||||||
INJECT(0x004B8A80, DoBootScreen);
|
INJECT(0x004B8A80, DoBootScreen);
|
||||||
}
|
}
|
|
@ -15,6 +15,8 @@
|
||||||
#define Sub_0042A050 ((void (__cdecl*)()) 0x0042A050)
|
#define Sub_0042A050 ((void (__cdecl*)()) 0x0042A050)
|
||||||
|
|
||||||
__int32 __cdecl DrawPhaseGame();
|
__int32 __cdecl DrawPhaseGame();
|
||||||
|
__int32 DrawGame();
|
||||||
|
__int32 DrawInventory();
|
||||||
void __cdecl DoBootScreen(__int32 language);
|
void __cdecl DoBootScreen(__int32 language);
|
||||||
void __cdecl DrawPistolsMeshes(__int32 weapon);
|
void __cdecl DrawPistolsMeshes(__int32 weapon);
|
||||||
void __cdecl DrawShotgunMeshes(__int32 weapon);
|
void __cdecl DrawShotgunMeshes(__int32 weapon);
|
||||||
|
|
|
@ -307,7 +307,7 @@ void Inventory::Initialise()
|
||||||
ring->objects[j].rotation = 0;
|
ring->objects[j].rotation = 0;
|
||||||
ring->objects[j].scale = 2.0f;
|
ring->objects[j].scale = 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
InsertObject(INV_RING_OPTIONS, INV_OBJECT_PASSAPORT);
|
InsertObject(INV_RING_OPTIONS, INV_OBJECT_PASSAPORT);
|
||||||
InsertObject(INV_RING_OPTIONS, INV_OBJECT_SUNGLASSES);
|
InsertObject(INV_RING_OPTIONS, INV_OBJECT_SUNGLASSES);
|
||||||
InsertObject(INV_RING_OPTIONS, INV_OBJECT_HEADPHONES);
|
InsertObject(INV_RING_OPTIONS, INV_OBJECT_HEADPHONES);
|
||||||
|
@ -455,19 +455,23 @@ INVENTORY_RESULT Inventory::DoInventory()
|
||||||
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_EXIT_TO_TILE ||
|
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_EXIT_TO_TILE ||
|
||||||
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_LOAD_GAME)
|
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_LOAD_GAME)
|
||||||
{
|
{
|
||||||
|
// Fade out
|
||||||
|
g_Renderer->FadeOut();
|
||||||
|
for (__int32 i = 0; i < FADE_FRAMES_COUNT; i++)
|
||||||
|
g_Renderer->DrawInventory();
|
||||||
|
|
||||||
return passportResult;
|
return passportResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEPRECATED: all the followings will be done by passaport
|
if (m_rings[INV_RING_OPTIONS].objects[m_rings[INV_RING_OPTIONS].currentObject].inventoryObject == INV_OBJECT_KEYS)
|
||||||
if (m_rings[INV_RING_OPTIONS].objects[m_rings[INV_RING_OPTIONS].currentObject].inventoryObject == INV_OBJECT_TIMEX)
|
DoControlsSettings();
|
||||||
DoStatisticsMenu();
|
|
||||||
|
|
||||||
if (m_rings[INV_RING_OPTIONS].objects[m_rings[INV_RING_OPTIONS].currentObject].inventoryObject == INV_OBJECT_LOAD_FLOPPY)
|
if (m_rings[INV_RING_OPTIONS].objects[m_rings[INV_RING_OPTIONS].currentObject].inventoryObject == INV_OBJECT_SUNGLASSES)
|
||||||
DoLoadGameMenu();
|
DoGraphicsSettings();
|
||||||
|
|
||||||
if (m_rings[INV_RING_OPTIONS].objects[m_rings[INV_RING_OPTIONS].currentObject].inventoryObject == INV_OBJECT_SAVE_FLOPPY)
|
if (m_rings[INV_RING_OPTIONS].objects[m_rings[INV_RING_OPTIONS].currentObject].inventoryObject == INV_OBJECT_HEADPHONES)
|
||||||
DoSaveGameMenu();
|
DoSoundSettings();
|
||||||
}
|
}
|
||||||
else if (m_activeRing == INV_RING_WEAPONS || m_activeRing == INV_RING_PUZZLES)
|
else if (m_activeRing == INV_RING_WEAPONS || m_activeRing == INV_RING_PUZZLES)
|
||||||
{
|
{
|
||||||
|
@ -806,7 +810,10 @@ INVENTORY_RESULT Inventory::DoTitleInventory()
|
||||||
InventoryRing* ring = &m_rings[INV_RING_OPTIONS];
|
InventoryRing* ring = &m_rings[INV_RING_OPTIONS];
|
||||||
m_activeRing = INV_RING_OPTIONS;
|
m_activeRing = INV_RING_OPTIONS;
|
||||||
|
|
||||||
g_Renderer->DrawInventory();
|
// Fade in
|
||||||
|
g_Renderer->FadeIn();
|
||||||
|
for (__int32 i = 0; i < FADE_FRAMES_COUNT; i++)
|
||||||
|
g_Renderer->DrawInventory();
|
||||||
|
|
||||||
INVENTORY_RESULT result = INVENTORY_RESULT::INVENTORY_RESULT_NONE;
|
INVENTORY_RESULT result = INVENTORY_RESULT::INVENTORY_RESULT_NONE;
|
||||||
|
|
||||||
|
@ -876,24 +883,34 @@ INVENTORY_RESULT Inventory::DoTitleInventory()
|
||||||
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_EXIT_GAME ||
|
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_EXIT_GAME ||
|
||||||
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_LOAD_GAME)
|
passportResult == INVENTORY_RESULT::INVENTORY_RESULT_LOAD_GAME)
|
||||||
{
|
{
|
||||||
|
// Fade out
|
||||||
|
g_Renderer->FadeOut();
|
||||||
|
for (__int32 i = 0; i < FADE_FRAMES_COUNT; i++)
|
||||||
|
g_Renderer->DrawInventory();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ring->objects[ring->currentObject].inventoryObject == INV_OBJECT_TIMEX)
|
if (ring->objects[ring->currentObject].inventoryObject == INV_OBJECT_KEYS)
|
||||||
DoStatisticsMenu();
|
DoControlsSettings();
|
||||||
|
|
||||||
if (ring->objects[ring->currentObject].inventoryObject == INV_OBJECT_LOAD_FLOPPY)
|
if (ring->objects[ring->currentObject].inventoryObject == INV_OBJECT_SUNGLASSES)
|
||||||
DoLoadGameMenu();
|
DoGraphicsSettings();
|
||||||
|
|
||||||
if (ring->objects[ring->currentObject].inventoryObject == INV_OBJECT_SAVE_FLOPPY)
|
if (ring->objects[ring->currentObject].inventoryObject == INV_OBJECT_HEADPHONES)
|
||||||
DoSaveGameMenu();
|
DoSoundSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Renderer->DrawInventory();
|
g_Renderer->DrawInventory();
|
||||||
g_Renderer->SyncRenderer();
|
g_Renderer->SyncRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fade out
|
||||||
|
g_Renderer->FadeOut();
|
||||||
|
for (__int32 i = 0; i < FADE_FRAMES_COUNT; i++)
|
||||||
|
g_Renderer->DrawInventory();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1415,4 +1432,19 @@ __int32 Inventory::PopoverObject()
|
||||||
__int32 Inventory::GetType()
|
__int32 Inventory::GetType()
|
||||||
{
|
{
|
||||||
return m_type;
|
return m_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Inventory::DoControlsSettings()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Inventory::DoGraphicsSettings()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Inventory::DoSoundSettings()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
|
@ -216,6 +216,9 @@ public:
|
||||||
void UseCurrentItem();
|
void UseCurrentItem();
|
||||||
InventoryObjectDefinition* GetInventoryObject(__int32 index);
|
InventoryObjectDefinition* GetInventoryObject(__int32 index);
|
||||||
INVENTORY_RESULT DoPassport();
|
INVENTORY_RESULT DoPassport();
|
||||||
|
void DoControlsSettings();
|
||||||
|
void DoGraphicsSettings();
|
||||||
|
void DoSoundSettings();
|
||||||
__int32 PopupObject();
|
__int32 PopupObject();
|
||||||
__int32 PopoverObject();
|
__int32 PopoverObject();
|
||||||
__int32 GetType();
|
__int32 GetType();
|
||||||
|
|
|
@ -68,6 +68,12 @@ typedef enum RENDERER_POLYGON_SHAPE {
|
||||||
RENDERER_POLYGON_TRIANGLE
|
RENDERER_POLYGON_TRIANGLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef enum RENDERER_FADE_STATUS {
|
||||||
|
NO_FADE,
|
||||||
|
FADE_IN,
|
||||||
|
FADE_OUT
|
||||||
|
};
|
||||||
|
|
||||||
#define SHADOW_MAP_SIZE 2048
|
#define SHADOW_MAP_SIZE 2048
|
||||||
|
|
||||||
#define TEXTURE_ATLAS_SIZE 4096
|
#define TEXTURE_ATLAS_SIZE 4096
|
||||||
|
@ -125,3 +131,6 @@ typedef enum RENDERER_POLYGON_SHAPE {
|
||||||
#define PRINTSTRING_COLOR_ORANGE D3DCOLOR_ARGB(255, 216, 117, 49)
|
#define PRINTSTRING_COLOR_ORANGE D3DCOLOR_ARGB(255, 216, 117, 49)
|
||||||
#define PRINTSTRING_COLOR_WHITE D3DCOLOR_ARGB(255, 255, 255, 255)
|
#define PRINTSTRING_COLOR_WHITE D3DCOLOR_ARGB(255, 255, 255, 255)
|
||||||
#define PRINTSTRING_COLOR_BLACK D3DCOLOR_ARGB(255, 0, 0, 0)
|
#define PRINTSTRING_COLOR_BLACK D3DCOLOR_ARGB(255, 0, 0, 0)
|
||||||
|
|
||||||
|
#define FADE_FRAMES_COUNT 16
|
||||||
|
#define FADE_FACTOR 0.0625f
|
|
@ -384,7 +384,6 @@ bool Renderer::Initialise(__int32 w, __int32 h, bool windowed, HWND handle)
|
||||||
m_outputBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
m_outputBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
||||||
m_lightBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
m_lightBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
||||||
m_vertexLightBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
m_vertexLightBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
||||||
m_shadowBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
|
||||||
m_postprocessBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
m_postprocessBuffer = make_shared<RenderTarget2D>(m_device, ScreenWidth, ScreenHeight, D3DFORMAT::D3DFMT_A8R8G8B8);
|
||||||
|
|
||||||
m_shaderClearGBuffer = make_shared<Shader>(m_device, (char*)"Shaders\\ClearGBuffer.fx");
|
m_shaderClearGBuffer = make_shared<Shader>(m_device, (char*)"Shaders\\ClearGBuffer.fx");
|
||||||
|
@ -441,6 +440,11 @@ bool Renderer::Initialise(__int32 w, __int32 h, bool windowed, HWND handle)
|
||||||
m_shaderDepth->Compile();
|
m_shaderDepth->Compile();
|
||||||
if (m_shaderDepth->GetEffect() == NULL)
|
if (m_shaderDepth->GetEffect() == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
m_shaderFinalPass = make_shared<Shader>(m_device, (char*)"Shaders\\FinalPass.fx");
|
||||||
|
m_shaderFinalPass->Compile();
|
||||||
|
if (m_shaderFinalPass->GetEffect() == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
m_sphereMesh = make_shared<RendererSphere>(m_device, 1280.0f, 6);
|
m_sphereMesh = make_shared<RendererSphere>(m_device, 1280.0f, 6);
|
||||||
m_quad = make_shared<RendererQuad>(m_device, 1024.0f);
|
m_quad = make_shared<RendererQuad>(m_device, 1024.0f);
|
||||||
|
@ -504,7 +508,9 @@ bool Renderer::Initialise(__int32 w, __int32 h, bool windowed, HWND handle)
|
||||||
m_lines3DToDraw.reserve(NUM_LINES_PER_BUCKET * 4);
|
m_lines3DToDraw.reserve(NUM_LINES_PER_BUCKET * 4);
|
||||||
m_lines3DVertices.reserve(NUM_LINES_PER_BUCKET * 2);
|
m_lines3DVertices.reserve(NUM_LINES_PER_BUCKET * 2);
|
||||||
m_firstWeather = true;
|
m_firstWeather = true;
|
||||||
|
m_cinematicBars = false;
|
||||||
|
m_fadeFactor = 1.0f;
|
||||||
|
|
||||||
resetBlink();
|
resetBlink();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -590,7 +596,7 @@ bool Renderer::printDebugMessage(__int32 x, __int32 y, __int32 alpha, byte r, by
|
||||||
rct.right = 700;
|
rct.right = 700;
|
||||||
rct.top = y;
|
rct.top = y;
|
||||||
rct.bottom = rct.top + 16;
|
rct.bottom = rct.top + 16;
|
||||||
// m_debugFont->DrawTextA(NULL, Message, -1, &rct, 0, fontColor);
|
m_debugFont->DrawTextA(NULL, Message, -1, &rct, 0, fontColor);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1293,7 +1299,7 @@ bool Renderer::PrepareDataForTheRenderer()
|
||||||
{
|
{
|
||||||
__int32 objNum = MoveablesIds[i];
|
__int32 objNum = MoveablesIds[i];
|
||||||
OBJECT_INFO* obj = &Objects[objNum];
|
OBJECT_INFO* obj = &Objects[objNum];
|
||||||
|
|
||||||
if (obj->nmeshes > 0)
|
if (obj->nmeshes > 0)
|
||||||
{
|
{
|
||||||
RendererObject* moveable = new RendererObject(m_device, MoveablesIds[i], obj->nmeshes);
|
RendererObject* moveable = new RendererObject(m_device, MoveablesIds[i], obj->nmeshes);
|
||||||
|
@ -2154,7 +2160,10 @@ __int32 Renderer::DumpGameScene()
|
||||||
|
|
||||||
__int32 Renderer::Draw()
|
__int32 Renderer::Draw()
|
||||||
{
|
{
|
||||||
return drawScene(false);
|
drawScene(false);
|
||||||
|
drawFinalPass();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::insertLine2D(__int32 x1, __int32 y1, __int32 x2, __int32 y2, byte r, byte g, byte b)
|
void Renderer::insertLine2D(__int32 x1, __int32 y1, __int32 x2, __int32 y2, byte r, byte g, byte b)
|
||||||
|
@ -2456,7 +2465,10 @@ __int32 Renderer::DrawSettingsMenu(__int32 selectedIndex, bool resetBlink)
|
||||||
|
|
||||||
__int32 Renderer::DrawInventory()
|
__int32 Renderer::DrawInventory()
|
||||||
{
|
{
|
||||||
return drawInventoryScene();
|
drawInventoryScene();
|
||||||
|
drawFinalPass();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__int32 Renderer::drawObjectOn2DPosition(__int16 x, __int16 y, __int16 objectNum, __int16 rotX, __int16 rotY, __int16 rotZ)
|
__int32 Renderer::drawObjectOn2DPosition(__int16 x, __int16 y, __int16 objectNum, __int16 rotX, __int16 rotY, __int16 rotZ)
|
||||||
|
@ -2625,6 +2637,7 @@ __int32 Renderer::drawInventoryScene()
|
||||||
rect.bottom = ScreenHeight;
|
rect.bottom = ScreenHeight;
|
||||||
|
|
||||||
// Clear screen
|
// Clear screen
|
||||||
|
bindRenderTargets(m_outputBuffer.get(), NULL, NULL, NULL);
|
||||||
m_device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
|
m_device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
|
||||||
m_device->BeginScene();
|
m_device->BeginScene();
|
||||||
|
|
||||||
|
@ -2960,7 +2973,8 @@ __int32 Renderer::drawInventoryScene()
|
||||||
effect->End();
|
effect->End();
|
||||||
|
|
||||||
m_device->EndScene();
|
m_device->EndScene();
|
||||||
m_device->Present(NULL, NULL, NULL, NULL);
|
//m_device->Present(NULL, NULL, NULL, NULL);
|
||||||
|
restoreBackBuffer();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3169,12 +3183,6 @@ bool Renderer::drawScene(bool dump)
|
||||||
restoreBackBuffer();
|
restoreBackBuffer();
|
||||||
|
|
||||||
// Bind the light target
|
// Bind the light target
|
||||||
restoreBackBuffer();
|
|
||||||
bindRenderTargets(m_shadowBuffer.get(), NULL, NULL, NULL);
|
|
||||||
m_device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_COLORVALUE(1.0f, 0.0f, 0.0f, 1.0f), 1.0f, 0);
|
|
||||||
m_device->BeginScene();
|
|
||||||
m_device->EndScene();
|
|
||||||
|
|
||||||
restoreBackBuffer();
|
restoreBackBuffer();
|
||||||
bindRenderTargets(m_lightBuffer.get(), NULL, NULL, NULL);
|
bindRenderTargets(m_lightBuffer.get(), NULL, NULL, NULL);
|
||||||
|
|
||||||
|
@ -3252,6 +3260,8 @@ bool Renderer::drawScene(bool dump)
|
||||||
|
|
||||||
if (dump)
|
if (dump)
|
||||||
bindRenderTargets(m_renderTarget.get(), NULL, NULL, NULL);
|
bindRenderTargets(m_renderTarget.get(), NULL, NULL, NULL);
|
||||||
|
else
|
||||||
|
bindRenderTargets(m_outputBuffer.get(), NULL, NULL, NULL);
|
||||||
|
|
||||||
// Combine stage
|
// Combine stage
|
||||||
setCullMode(RENDERER_CULLMODE::CULLMODE_CCW);
|
setCullMode(RENDERER_CULLMODE::CULLMODE_CCW);
|
||||||
|
@ -3479,10 +3489,11 @@ bool Renderer::drawScene(bool dump)
|
||||||
if (!dump)
|
if (!dump)
|
||||||
{
|
{
|
||||||
drawDebugInfo();
|
drawDebugInfo();
|
||||||
m_device->Present(NULL, NULL, NULL, NULL);
|
//m_device->Present(NULL, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
/*else*/
|
||||||
restoreBackBuffer();
|
|
||||||
|
restoreBackBuffer();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5413,4 +5424,65 @@ void Renderer::FreeRendererData()
|
||||||
m_spritesIndices.clear();
|
m_spritesIndices.clear();
|
||||||
m_meshPointersToMesh.clear();
|
m_meshPointersToMesh.clear();
|
||||||
MoveablesIds.clear();
|
MoveablesIds.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Renderer::EnableCinematicBars(bool value)
|
||||||
|
{
|
||||||
|
m_cinematicBars = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Renderer::FadeIn()
|
||||||
|
{
|
||||||
|
m_fadeStatus = RENDERER_FADE_STATUS::FADE_IN;
|
||||||
|
m_fadeFactor = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Renderer::FadeOut()
|
||||||
|
{
|
||||||
|
m_fadeStatus = RENDERER_FADE_STATUS::FADE_OUT;
|
||||||
|
m_fadeFactor = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
__int32 Renderer::drawFinalPass()
|
||||||
|
{
|
||||||
|
// Update fade status
|
||||||
|
if (m_fadeStatus == RENDERER_FADE_STATUS::FADE_IN && m_fadeFactor > 0.99f)
|
||||||
|
m_fadeStatus = RENDERER_FADE_STATUS::NO_FADE;
|
||||||
|
|
||||||
|
if (m_fadeStatus == RENDERER_FADE_STATUS::FADE_OUT && m_fadeFactor <= 0.01f)
|
||||||
|
m_fadeStatus = RENDERER_FADE_STATUS::NO_FADE;
|
||||||
|
|
||||||
|
UINT cPasses = 1;
|
||||||
|
|
||||||
|
setCullMode(RENDERER_CULLMODE::CULLMODE_CCW);
|
||||||
|
setBlendState(RENDERER_BLENDSTATE::BLENDSTATE_OPAQUE);
|
||||||
|
setDepthWrite(true);
|
||||||
|
|
||||||
|
LPD3DXEFFECT effect = m_shaderFinalPass->GetEffect();
|
||||||
|
m_device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
|
||||||
|
m_device->BeginScene();
|
||||||
|
effect->Begin(&cPasses, 0);
|
||||||
|
|
||||||
|
effect->SetTexture(effect->GetParameterByName(NULL, "Texture"), m_outputBuffer->GetTexture());
|
||||||
|
effect->SetFloat(effect->GetParameterByName(NULL, "FadeFactor"), m_fadeFactor);
|
||||||
|
effect->SetBool(effect->GetParameterByName(NULL, "CinematicBars"), m_cinematicBars);
|
||||||
|
|
||||||
|
effect->BeginPass(0);
|
||||||
|
effect->CommitChanges();
|
||||||
|
m_device->DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE::D3DPT_TRIANGLELIST, 0, 6, 2, m_fullscreenQuadIndices, D3DFORMAT::D3DFMT_INDEX32,
|
||||||
|
m_fullscreenQuadVertices, sizeof(RendererVertex));
|
||||||
|
effect->EndPass();
|
||||||
|
effect->End();
|
||||||
|
m_device->EndScene();
|
||||||
|
|
||||||
|
m_device->Present(NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
// Update fade status
|
||||||
|
if (m_fadeStatus == RENDERER_FADE_STATUS::FADE_IN)
|
||||||
|
m_fadeFactor += FADE_FACTOR;
|
||||||
|
|
||||||
|
if (m_fadeStatus == RENDERER_FADE_STATUS::FADE_OUT)
|
||||||
|
m_fadeFactor -= FADE_FACTOR;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
|
@ -498,8 +498,7 @@ class Renderer
|
||||||
shared_ptr<RenderTarget2D> m_normalBuffer;
|
shared_ptr<RenderTarget2D> m_normalBuffer;
|
||||||
shared_ptr<RenderTarget2D> m_colorBuffer;
|
shared_ptr<RenderTarget2D> m_colorBuffer;
|
||||||
shared_ptr<RenderTarget2D> m_outputBuffer;
|
shared_ptr<RenderTarget2D> m_outputBuffer;
|
||||||
shared_ptr<RenderTarget2D> m_lightBuffer;
|
shared_ptr<RenderTarget2D> m_lightBuffer;
|
||||||
shared_ptr<RenderTarget2D> m_shadowBuffer;
|
|
||||||
shared_ptr<RenderTarget2D> m_vertexLightBuffer;
|
shared_ptr<RenderTarget2D> m_vertexLightBuffer;
|
||||||
shared_ptr<RenderTarget2D> m_postprocessBuffer;
|
shared_ptr<RenderTarget2D> m_postprocessBuffer;
|
||||||
shared_ptr<Shader> m_shaderClearGBuffer;
|
shared_ptr<Shader> m_shaderClearGBuffer;
|
||||||
|
@ -512,6 +511,7 @@ class Renderer
|
||||||
shared_ptr<Shader> m_shaderSprites;
|
shared_ptr<Shader> m_shaderSprites;
|
||||||
shared_ptr<Shader> m_shaderRain;
|
shared_ptr<Shader> m_shaderRain;
|
||||||
shared_ptr<Shader> m_shaderTransparent;
|
shared_ptr<Shader> m_shaderTransparent;
|
||||||
|
shared_ptr<Shader> m_shaderFinalPass;
|
||||||
RendererVertex m_fullscreenQuadVertices[4];
|
RendererVertex m_fullscreenQuadVertices[4];
|
||||||
__int32 m_fullscreenQuadIndices[6];
|
__int32 m_fullscreenQuadIndices[6];
|
||||||
shared_ptr<RendererSphere> m_sphereMesh;
|
shared_ptr<RendererSphere> m_sphereMesh;
|
||||||
|
@ -547,7 +547,7 @@ class Renderer
|
||||||
__int32 m_currentCausticsFrame = 0;
|
__int32 m_currentCausticsFrame = 0;
|
||||||
vector<shared_ptr<RendererAnimatedTextureSet>> m_animatedTextureSets;
|
vector<shared_ptr<RendererAnimatedTextureSet>> m_animatedTextureSets;
|
||||||
map<__int16*, RendererMesh*> m_meshPointersToMesh;
|
map<__int16*, RendererMesh*> m_meshPointersToMesh;
|
||||||
|
|
||||||
__int32 getAnimatedTextureInfo(__int16 textureId);
|
__int32 getAnimatedTextureInfo(__int16 textureId);
|
||||||
RendererMesh* getRendererMeshFromTrMesh(RendererObject* obj, __int16* meshPtr, __int16* refMeshPtr, __int16 boneIndex, __int32 isJoints, __int32 isHairs);
|
RendererMesh* getRendererMeshFromTrMesh(RendererObject* obj, __int16* meshPtr, __int16* refMeshPtr, __int16 boneIndex, __int32 isJoints, __int32 isHairs);
|
||||||
void fromTrAngle(D3DXMATRIX* matrix, __int16* frameptr, __int32 index);
|
void fromTrAngle(D3DXMATRIX* matrix, __int16* frameptr, __int32 index);
|
||||||
|
@ -601,6 +601,7 @@ class Renderer
|
||||||
bool doSnow();
|
bool doSnow();
|
||||||
bool drawSprites();
|
bool drawSprites();
|
||||||
bool drawLines3D();
|
bool drawLines3D();
|
||||||
|
__int32 drawFinalPass();
|
||||||
void setCullMode(RENDERER_CULLMODE mode);
|
void setCullMode(RENDERER_CULLMODE mode);
|
||||||
void setBlendState(RENDERER_BLENDSTATE state);
|
void setBlendState(RENDERER_BLENDSTATE state);
|
||||||
void setDepthWrite(bool value);
|
void setDepthWrite(bool value);
|
||||||
|
@ -608,7 +609,10 @@ class Renderer
|
||||||
bool isRoomUnderwater(__int16 roomNumber);
|
bool isRoomUnderwater(__int16 roomNumber);
|
||||||
bool isInRoom(__int32 x, __int32 y, __int32 z, __int16 roomNumber);
|
bool isInRoom(__int32 x, __int32 y, __int32 z, __int16 roomNumber);
|
||||||
void updateAnimatedTextures();
|
void updateAnimatedTextures();
|
||||||
|
RENDERER_FADE_STATUS m_fadeStatus;
|
||||||
|
float m_fadeFactor;
|
||||||
|
bool m_cinematicBars;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
D3DXMATRIX ViewMatrix;
|
D3DXMATRIX ViewMatrix;
|
||||||
D3DXMATRIX ProjectionMatrix;
|
D3DXMATRIX ProjectionMatrix;
|
||||||
|
@ -641,4 +645,7 @@ public:
|
||||||
void ClearDynamicLights();
|
void ClearDynamicLights();
|
||||||
void AddDynamicLight(__int32 x, __int32 y, __int32 z, __int16 falloff, byte r, byte g, byte b);
|
void AddDynamicLight(__int32 x, __int32 y, __int32 z, __int16 falloff, byte r, byte g, byte b);
|
||||||
void FreeRendererData();
|
void FreeRendererData();
|
||||||
|
void EnableCinematicBars(bool value);
|
||||||
|
void FadeIn();
|
||||||
|
void FadeOut();
|
||||||
};
|
};
|
|
@ -28,7 +28,7 @@ GameScript::GameScript()
|
||||||
"g", &GameScriptFog::G,
|
"g", &GameScriptFog::G,
|
||||||
"b", &GameScriptFog::B
|
"b", &GameScriptFog::B
|
||||||
);
|
);
|
||||||
|
|
||||||
m_lua.new_usertype<GameScriptLevel>("Level",
|
m_lua.new_usertype<GameScriptLevel>("Level",
|
||||||
sol::constructors<GameScriptLevel()>(),
|
sol::constructors<GameScriptLevel()>(),
|
||||||
"name", &GameScriptLevel::Name,
|
"name", &GameScriptLevel::Name,
|
||||||
|
|
|
@ -9,10 +9,6 @@ title = Level.new();
|
||||||
title.script = "andrea2.lua";
|
title.script = "andrea2.lua";
|
||||||
title.soundtrack = 110;
|
title.soundtrack = 110;
|
||||||
title.filename = "Data\\title.trc";
|
title.filename = "Data\\title.trc";
|
||||||
title.horizon = true;
|
|
||||||
title.coladdhorizon = true;
|
|
||||||
title.layer1 = SkyLayer.new(120, 80, 50, -4);
|
|
||||||
title.storm = true;
|
|
||||||
title.background = "Title.png";
|
title.background = "Title.png";
|
||||||
|
|
||||||
Gameflow:addLevel(title);
|
Gameflow:addLevel(title);
|
||||||
|
@ -155,4 +151,56 @@ oldMill.storm = true;
|
||||||
oldMill.laraType = LaraType.Young;
|
oldMill.laraType = LaraType.Young;
|
||||||
oldMill.layer1 = SkyLayer.new(120, 80, 50, -4);
|
oldMill.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
Gameflow:addLevel(oldMill);
|
Gameflow:addLevel(oldMill);
|
||||||
|
|
||||||
|
-- 13th floor
|
||||||
|
rich1 = Level.new();
|
||||||
|
|
||||||
|
rich1.name = 111;
|
||||||
|
rich1.script = "rich1.lua";
|
||||||
|
rich1.soundtrack = 124;
|
||||||
|
rich1.filename = "Data\\rich1.trc";
|
||||||
|
rich1.horizon = true;
|
||||||
|
rich1.coladdhorizon = true;
|
||||||
|
rich1.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(rich1);
|
||||||
|
|
||||||
|
-- Escape with the Iris
|
||||||
|
iris = Level.new();
|
||||||
|
|
||||||
|
iris.name = 112;
|
||||||
|
iris.script = "rich2.lua";
|
||||||
|
iris.soundtrack = 129;
|
||||||
|
iris.filename = "Data\\rich2.trc";
|
||||||
|
iris.horizon = true;
|
||||||
|
iris.coladdhorizon = true;
|
||||||
|
iris.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(iris);
|
||||||
|
|
||||||
|
-- Security breach
|
||||||
|
sec = Level.new();
|
||||||
|
|
||||||
|
sec.name = 113;
|
||||||
|
sec.script = "rich3.lua";
|
||||||
|
sec.soundtrack = 129;
|
||||||
|
sec.filename = "Data\\rich3.trc";
|
||||||
|
sec.horizon = true;
|
||||||
|
sec.coladdhorizon = true;
|
||||||
|
sec.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(sec);
|
||||||
|
|
||||||
|
-- Red alert!
|
||||||
|
redAlert = Level.new();
|
||||||
|
|
||||||
|
redAlert.name = 114;
|
||||||
|
redAlert.script = "rich4.lua";
|
||||||
|
redAlert.soundtrack = 129;
|
||||||
|
redAlert.filename = "Data\\rich4.trc";
|
||||||
|
redAlert.horizon = true;
|
||||||
|
redAlert.coladdhorizon = true;
|
||||||
|
redAlert.layer1 = SkyLayer.new(120, 80, 50, -4);
|
||||||
|
|
||||||
|
Gameflow:addLevel(redAlert);
|
52
TR5Main/Shaders/FinalPass.fx
Normal file
52
TR5Main/Shaders/FinalPass.fx
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
bool CinematicBars;
|
||||||
|
float FadeFactor;
|
||||||
|
|
||||||
|
texture Texture;
|
||||||
|
sampler2D TextureSampler = sampler_state {
|
||||||
|
Texture = (Texture);
|
||||||
|
MinFilter = Linear;
|
||||||
|
MagFilter = Linear;
|
||||||
|
AddressU = Wrap;
|
||||||
|
AddressV = Wrap;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VertexShaderInput
|
||||||
|
{
|
||||||
|
float3 Position : POSITION0;
|
||||||
|
float2 TextureCoordinate : TEXCOORD0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VertexShaderOutput
|
||||||
|
{
|
||||||
|
float4 Position : POSITION0;
|
||||||
|
float2 TextureCoordinate : TEXCOORD0;
|
||||||
|
float4 PositionCopy : TEXCOORD1;
|
||||||
|
};
|
||||||
|
|
||||||
|
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
|
||||||
|
{
|
||||||
|
VertexShaderOutput output;
|
||||||
|
|
||||||
|
output.Position = float4(input.Position, 1.0f);
|
||||||
|
output.TextureCoordinate = input.TextureCoordinate;
|
||||||
|
output.PositionCopy = output.Position;
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||||
|
{
|
||||||
|
if (CinematicBars && (input.PositionCopy.y < -0.8f || input.PositionCopy.y >= 0.8f))
|
||||||
|
return float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
|
return float4(tex2D(TextureSampler, input.TextureCoordinate).rgb * FadeFactor, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
technique FullScreenQuad
|
||||||
|
{
|
||||||
|
pass Pass1
|
||||||
|
{
|
||||||
|
VertexShader = compile vs_3_0 VertexShaderFunction();
|
||||||
|
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,45 +0,0 @@
|
||||||
float4x4 World;
|
|
||||||
float4x4 View;
|
|
||||||
float4x4 Projection;
|
|
||||||
|
|
||||||
texture Texture : register(t0);
|
|
||||||
sampler TextureSampler : register(s0) = sampler_state
|
|
||||||
{
|
|
||||||
Texture = <Texture>;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct VertexShaderInput
|
|
||||||
{
|
|
||||||
float4 Position : POSITION0;
|
|
||||||
float2 TexCoord : TEXCOORD0;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct VertexShaderOutput
|
|
||||||
{
|
|
||||||
float4 Position : POSITION0;
|
|
||||||
float2 TexCoord : TEXCOORD0;
|
|
||||||
};
|
|
||||||
|
|
||||||
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
|
|
||||||
{
|
|
||||||
VertexShaderOutput output;
|
|
||||||
|
|
||||||
output.Position = float4(input.Position, 1.0f);
|
|
||||||
output.TexCoord = input.TexCoord;
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
float4 PixelShaderFunction(in float2 texCoords : TEXCOORD0) : COLOR0
|
|
||||||
{
|
|
||||||
return theSample = tex2D(TextureSampler, texCoords);
|
|
||||||
}
|
|
||||||
|
|
||||||
technique FXAA
|
|
||||||
{
|
|
||||||
pass Pass1
|
|
||||||
{
|
|
||||||
VertexShader = compile vs_3_0 VertexShaderFunction();
|
|
||||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -423,7 +423,7 @@ xcopy /Y "$(ProjectDir)Scripting\Scripts\*.lua" "$(TargetDir)\Scripts"</Command>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Shaders\FullScreenQuad.fx">
|
<None Include="Shaders\FinalPass.fx">
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
|
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
|
||||||
<FileType>Document</FileType>
|
<FileType>Document</FileType>
|
||||||
|
|
|
@ -520,7 +520,6 @@
|
||||||
<None Include="Shaders\CombineFinal.fx" />
|
<None Include="Shaders\CombineFinal.fx" />
|
||||||
<None Include="Shaders\Fxaa3_11.fxh" />
|
<None Include="Shaders\Fxaa3_11.fxh" />
|
||||||
<None Include="Shaders\FXAA.fx" />
|
<None Include="Shaders\FXAA.fx" />
|
||||||
<None Include="Shaders\FullScreenQuad.fx" />
|
|
||||||
<None Include="Shaders\ReconstructZBuffer.fx" />
|
<None Include="Shaders\ReconstructZBuffer.fx" />
|
||||||
<None Include="Shaders\Sprites.fx" />
|
<None Include="Shaders\Sprites.fx" />
|
||||||
<None Include="Shaders\Rain.fx" />
|
<None Include="Shaders\Rain.fx" />
|
||||||
|
@ -530,5 +529,6 @@
|
||||||
<None Include="Scripting\Scripts\English.lua" />
|
<None Include="Scripting\Scripts\English.lua" />
|
||||||
<None Include="Scripting\Scripts\Gameflow.lua" />
|
<None Include="Scripting\Scripts\Gameflow.lua" />
|
||||||
<None Include="Scripting\Scripts\Andrea2.lua" />
|
<None Include="Scripting\Scripts\Andrea2.lua" />
|
||||||
|
<None Include="Shaders\FinalPass.fx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue