Skip to content

Commit

Permalink
Fire Effect implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
choi303 committed Aug 15, 2021
1 parent 0d4a4b4 commit d865231
Show file tree
Hide file tree
Showing 22 changed files with 729 additions and 29 deletions.
49 changes: 49 additions & 0 deletions Citrus/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,30 @@ void App::SetSavedValues()
Particle::SetPosY(std::stof(fxMenuSettings.GetInfo(11)));
Particle::SetPosZ(std::stof(fxMenuSettings.GetInfo(12)));
fxMenuSettings.CloseFile();

//set fire menu saved values
fireMenuSettings.OpenFileRead("fire_menu_settings.txt");
Fire::SetPosX(std::stof(fireMenuSettings.GetInfo(0)));
Fire::SetPosY(std::stof(fireMenuSettings.GetInfo(1)));
Fire::SetPosZ(std::stof(fireMenuSettings.GetInfo(2)));
Fire::SetScaleX(std::stof(fireMenuSettings.GetInfo(3)));
Fire::SetScaleY(std::stof(fireMenuSettings.GetInfo(4)));
Fire::SetScaleZ(std::stof(fireMenuSettings.GetInfo(5)));
Fire::SetDistortion1X(std::stof(fireMenuSettings.GetInfo(6)));
Fire::SetDistortion1Y(std::stof(fireMenuSettings.GetInfo(7)));
Fire::SetDistortion2X(std::stof(fireMenuSettings.GetInfo(8)));
Fire::SetDistortion2Y(std::stof(fireMenuSettings.GetInfo(9)));
Fire::SetDistortion3X(std::stof(fireMenuSettings.GetInfo(10)));
Fire::SetDistortion3Y(std::stof(fireMenuSettings.GetInfo(11)));
Fire::SetScalesX(std::stof(fireMenuSettings.GetInfo(12)));
Fire::SetScalesY(std::stof(fireMenuSettings.GetInfo(13)));
Fire::SetScalesZ(std::stof(fireMenuSettings.GetInfo(14)));
Fire::SetSSpeedX(std::stof(fireMenuSettings.GetInfo(15)));
Fire::SetSSpeedY(std::stof(fireMenuSettings.GetInfo(16)));
Fire::SetSSpeedZ(std::stof(fireMenuSettings.GetInfo(17)));
Fire::SetDistortionScale(std::stof(fireMenuSettings.GetInfo(18)));
Fire::SetDistortionBias(std::stof(fireMenuSettings.GetInfo(19)));
fireMenuSettings.CloseFile();
}

void App::SaveValues()
Expand Down Expand Up @@ -352,6 +376,31 @@ void App::SaveValues()
pFxMenuSavedItems.push_back(std::to_string(*Particle::GetPosZ()));
fxMenuSettings.AddInfo(pFxMenuSavedItems);
fxMenuSettings.CloseFile();

//open fire menu txt, stores fire menu settings
fireMenuSettings.OpenFileWrite("fire_menu_settings.txt");
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetPosX()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetPosY()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetPosZ()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetScaleX()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetScaleY()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetScaleZ()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortion1X()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortion1Y()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortion2X()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortion2Y()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortion3X()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortion3Y()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetScalesX()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetScalesY()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetScalesZ()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetSSpeedX()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetSSpeedY()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetSSpeedZ()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortionScale()));
pFireMenuSavedItems.push_back(std::to_string(*Fire::GetDistortionBias()));
fireMenuSettings.AddInfo(pFireMenuSavedItems);
fireMenuSettings.CloseFile();
}

void App::FPSCounter()
Expand Down
2 changes: 2 additions & 0 deletions Citrus/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ class App : WndProc
mutable std::vector<std::string> pDevMenuSavedItems;
mutable SaveSystem fxMenuSettings;
mutable std::vector<std::string> pFxMenuSavedItems;
mutable SaveSystem fireMenuSettings;
mutable std::vector<std::string> pFireMenuSavedItems;
};

12 changes: 12 additions & 0 deletions Citrus/Citrus.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<ClCompile Include="DepthBuffer.cpp" />
<ClCompile Include="DepthStencil.cpp" />
<ClCompile Include="DirectionalLight.cpp" />
<ClCompile Include="Fire.cpp" />
<ClCompile Include="Fog.cpp" />
<ClCompile Include="FSQuad.cpp" />
<ClCompile Include="GameObject.cpp" />
Expand Down Expand Up @@ -60,6 +61,7 @@
<ClInclude Include="DepthStencil.h" />
<ClInclude Include="DirectionalLight.h" />
<ClInclude Include="Error.h" />
<ClInclude Include="Fire.h" />
<ClInclude Include="Fog.h" />
<ClInclude Include="FSQuad.h" />
<ClInclude Include="GameObject.h" />
Expand Down Expand Up @@ -134,6 +136,11 @@
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="PSFire.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile>
<FxCompile Include="PSFog.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
Expand Down Expand Up @@ -192,6 +199,11 @@
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="VSFire.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile>
<FxCompile Include="VSFog.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
Expand Down
12 changes: 12 additions & 0 deletions Citrus/Citrus.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
<ClCompile Include="Particle.cpp">
<Filter>Graphics\DirectX 11\Source Files</Filter>
</ClCompile>
<ClCompile Include="Fire.cpp">
<Filter>Graphics\DirectX 11\Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="App.h">
Expand Down Expand Up @@ -284,6 +287,9 @@
<ClInclude Include="Particle.h">
<Filter>Graphics\DirectX 11\Header Files</Filter>
</ClInclude>
<ClInclude Include="Fire.h">
<Filter>Graphics\DirectX 11\Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<FxCompile Include="ColorPixel.hlsl">
Expand Down Expand Up @@ -370,6 +376,12 @@
<FxCompile Include="PSParticle.hlsl">
<Filter>Graphics\DirectX 11\Shaders</Filter>
</FxCompile>
<FxCompile Include="VSFire.hlsl">
<Filter>Graphics\DirectX 11\Shaders</Filter>
</FxCompile>
<FxCompile Include="PSFire.hlsl">
<Filter>Graphics\DirectX 11\Shaders</Filter>
</FxCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Citrus.rc">
Expand Down
1 change: 0 additions & 1 deletion Citrus/FSQuad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ void FSQuad::draw(ID3D11DeviceContext* pContext, Camera3D cam)
ssaoCBuffer->data.fallOff = fallOff;
ssaoCBuffer->data.base = base;
ssaoCBuffer->data.radius = radius;
ssaoCBuffer->data.proj = cam.GetProjectionMatrix();
ssaoCBuffer->MapData();
ssaoCBuffer->PSBind(pContext, 2, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion Citrus/FSQuad.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct SSAOBuffer
float area;
float fallOff;
float radius;
XMMATRIX proj;
float pad[3];
};

class FSQuad
Expand Down
Loading

0 comments on commit d865231

Please sign in to comment.