Added follow cam

Added "Controlled" mesh classes
Added Global Lighting Class
Added Gamepad controls
Split terrain nodes into Height and Perlin classes
Fixed Splitmesh node stuff
This commit is contained in:
iDunnoDev
2022-05-09 17:50:22 +01:00
committed by iDunnoDev
parent bc906064e5
commit f6bba67897
58 changed files with 1743 additions and 351 deletions

67
Graphics2/SkyNode.h Normal file
View File

@ -0,0 +1,67 @@
#pragma once
#include "DirectXFramework.h"
#include "DDSTextureLoader.h"
#include "SharedMethods.h"
#include "SceneNode.h"
typedef struct SkyVertex
{
XMFLOAT3 Position;
} SkyVertex;
struct SCBUFFER
{
XMMATRIX completeTransformation;
};
class SkyNode : public SceneNode
{
public:
SkyNode(wstring name, wstring skyCubeTextureName, float skyRadius);
~SkyNode();
bool Initialise(void);
void Render(void);
void Shutdown(void);
private:
float _skyRadius;
UINT _indicesCount;
UINT _vertexCount;
vector<SkyVertex> _skyDomeVerts;
vector<int> _indices;
ComPtr<ID3D11Device> _device;
ComPtr<ID3D11DeviceContext> _deviceContext;
ComPtr<ID3D11Buffer> _vertexBuffer;
ComPtr<ID3D11Buffer> _indexBuffer;
ComPtr<ID3DBlob> _vertexShaderByteCode = nullptr;
ComPtr<ID3DBlob> _pixelShaderByteCode = nullptr;
ComPtr<ID3D11VertexShader> _vertexShader;
ComPtr<ID3D11PixelShader> _pixelShader;
ComPtr<ID3D11InputLayout> _layout;
ComPtr<ID3D11Buffer> _constantBuffer;
ComPtr<ID3D11RasterizerState> _defaultRasteriserState;
ComPtr<ID3D11RasterizerState> _noCullRasteriserState;
ComPtr<ID3D11DepthStencilState> _stencilState;
ComPtr<ID3D11ShaderResourceView> _skyCubeTexture;
wstring _skyCubeTextureName;
void CreateSphere(float radius, size_t tessellation);
void GenerateBuffers();
void BuildShaders();
void BuildVertexLayout();
void BuildConstantBuffer();
void BuildRendererStates();
void BuildDepthStencilState();
void LoadSkyboxTexture();
};