Commit 8332eb95 authored by chili's avatar chili
Browse files

lighting needs serious work

parent 564fa11b
#include "App.h" #include "App.h"
#include "Melon.h"
#include "Pyramid.h"
#include "Box.h" #include "Box.h"
#include "Sheet.h"
#include "SkinnedBox.h"
#include <memory> #include <memory>
#include <algorithm> #include <algorithm>
#include "ChiliMath.h" #include "ChiliMath.h"
...@@ -17,7 +13,8 @@ GDIPlusManager gdipm; ...@@ -17,7 +13,8 @@ GDIPlusManager gdipm;
App::App() App::App()
: :
wnd( 800,600,"The Donkey Fart Box" ) wnd( 800,600,"The Donkey Fart Box" ),
light( wnd.Gfx() )
{ {
class Factory class Factory
{ {
...@@ -28,37 +25,10 @@ App::App() ...@@ -28,37 +25,10 @@ App::App()
{} {}
std::unique_ptr<Drawable> operator()() std::unique_ptr<Drawable> operator()()
{ {
switch( typedist( rng ) ) return std::make_unique<Box>(
{ gfx,rng,adist,ddist,
case 0: odist,rdist,bdist
return std::make_unique<Pyramid>( );
gfx,rng,adist,ddist,
odist,rdist
);
case 1:
return std::make_unique<Box>(
gfx,rng,adist,ddist,
odist,rdist,bdist
);
case 2:
return std::make_unique<Melon>(
gfx,rng,adist,ddist,
odist,rdist,longdist,latdist
);
case 3:
return std::make_unique<Sheet>(
gfx,rng,adist,ddist,
odist,rdist
);
case 4:
return std::make_unique<SkinnedBox>(
gfx,rng,adist,ddist,
odist,rdist
);
default:
assert( false && "bad drawable type in factory" );
return {};
}
} }
private: private:
Graphics& gfx; Graphics& gfx;
...@@ -68,9 +38,6 @@ App::App() ...@@ -68,9 +38,6 @@ App::App()
std::uniform_real_distribution<float> odist{ 0.0f,PI * 0.08f }; std::uniform_real_distribution<float> odist{ 0.0f,PI * 0.08f };
std::uniform_real_distribution<float> rdist{ 6.0f,20.0f }; std::uniform_real_distribution<float> rdist{ 6.0f,20.0f };
std::uniform_real_distribution<float> bdist{ 0.4f,3.0f }; std::uniform_real_distribution<float> bdist{ 0.4f,3.0f };
std::uniform_int_distribution<int> latdist{ 5,20 };
std::uniform_int_distribution<int> longdist{ 10,40 };
std::uniform_int_distribution<int> typedist{ 0,4 };
}; };
drawables.reserve( nDrawables ); drawables.reserve( nDrawables );
...@@ -84,12 +51,14 @@ void App::DoFrame() ...@@ -84,12 +51,14 @@ void App::DoFrame()
const auto dt = timer.Mark() * speed_factor; const auto dt = timer.Mark() * speed_factor;
wnd.Gfx().BeginFrame( 0.07f,0.0f,0.12f ); wnd.Gfx().BeginFrame( 0.07f,0.0f,0.12f );
wnd.Gfx().SetCamera( cam.GetMatrix() ); wnd.Gfx().SetCamera( cam.GetMatrix() );
light.Bind( wnd.Gfx() );
for( auto& d : drawables ) for( auto& d : drawables )
{ {
d->Update( wnd.kbd.KeyIsPressed( VK_SPACE ) ? 0.0f : dt ); d->Update( wnd.kbd.KeyIsPressed( VK_SPACE ) ? 0.0f : dt );
d->Draw( wnd.Gfx() ); d->Draw( wnd.Gfx() );
} }
light.Draw( wnd.Gfx() );
// imgui window to control simulation speed // imgui window to control simulation speed
if( ImGui::Begin( "Simulation Speed" ) ) if( ImGui::Begin( "Simulation Speed" ) )
...@@ -99,8 +68,9 @@ void App::DoFrame() ...@@ -99,8 +68,9 @@ void App::DoFrame()
ImGui::Text( "Status: %s",wnd.kbd.KeyIsPressed( VK_SPACE ) ? "PAUSED" : "RUNNING (hold spacebar to pause)" ); ImGui::Text( "Status: %s",wnd.kbd.KeyIsPressed( VK_SPACE ) ? "PAUSED" : "RUNNING (hold spacebar to pause)" );
} }
ImGui::End(); ImGui::End();
// imgui window to control camera // imgui windows to control camera and light
cam.SpawnControlWindow(); cam.SpawnControlWindow();
light.SpawnControlWindow();
// present // present
wnd.Gfx().EndFrame(); wnd.Gfx().EndFrame();
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "ChiliTimer.h" #include "ChiliTimer.h"
#include "ImguiManager.h" #include "ImguiManager.h"
#include "Camera.h" #include "Camera.h"
#include "PointLight.h"
class App class App
{ {
...@@ -20,5 +21,6 @@ private: ...@@ -20,5 +21,6 @@ private:
std::vector<std::unique_ptr<class Drawable>> drawables; std::vector<std::unique_ptr<class Drawable>> drawables;
float speed_factor = 1.0f; float speed_factor = 1.0f;
Camera cam; Camera cam;
PointLight light;
static constexpr size_t nDrawables = 180; static constexpr size_t nDrawables = 180;
}; };
\ No newline at end of file
...@@ -30,47 +30,31 @@ Box::Box( Graphics& gfx, ...@@ -30,47 +30,31 @@ Box::Box( Graphics& gfx,
struct Vertex struct Vertex
{ {
dx::XMFLOAT3 pos; dx::XMFLOAT3 pos;
dx::XMFLOAT3 n;
}; };
const auto model = Cube::Make<Vertex>(); auto model = Cube::MakeIndependent<Vertex>();
model.SetNormalsIndependentFlat();
AddStaticBind( std::make_unique<VertexBuffer>( gfx,model.vertices ) ); AddStaticBind( std::make_unique<VertexBuffer>( gfx,model.vertices ) );
auto pvs = std::make_unique<VertexShader>( gfx,L"ColorIndexVS.cso" ); auto pvs = std::make_unique<VertexShader>( gfx,L"PhongVS.cso" );
auto pvsbc = pvs->GetBytecode(); auto pvsbc = pvs->GetBytecode();
AddStaticBind( std::move( pvs ) ); AddStaticBind( std::move( pvs ) );
AddStaticBind( std::make_unique<PixelShader>( gfx,L"ColorIndexPS.cso" ) ); AddStaticBind( std::make_unique<PixelShader>( gfx,L"PhongPS.cso" ) );
AddStaticIndexBuffer( std::make_unique<IndexBuffer>( gfx,model.indices ) ); AddStaticIndexBuffer( std::make_unique<IndexBuffer>( gfx,model.indices ) );
struct PixelShaderConstants struct PSLightConstants
{
struct
{
float r;
float g;
float b;
float a;
} face_colors[8];
};
const PixelShaderConstants cb2 =
{ {
{ dx::XMVECTOR pos;
{ 1.0f,1.0f,1.0f },
{ 1.0f,0.0f,0.0f },
{ 0.0f,1.0f,0.0f },
{ 1.0f,1.0f,0.0f },
{ 0.0f,0.0f,1.0f },
{ 1.0f,0.0f,1.0f },
{ 0.0f,1.0f,1.0f },
{ 0.0f,0.0f,0.0f },
}
}; };
AddStaticBind( std::make_unique<PixelConstantBuffer<PixelShaderConstants>>( gfx,cb2 ) ); AddStaticBind( std::make_unique<PixelConstantBuffer<PSLightConstants>>( gfx ) );
const std::vector<D3D11_INPUT_ELEMENT_DESC> ied = const std::vector<D3D11_INPUT_ELEMENT_DESC> ied =
{ {
{ "Position",0,DXGI_FORMAT_R32G32B32_FLOAT,0,0,D3D11_INPUT_PER_VERTEX_DATA,0 }, { "Position",0,DXGI_FORMAT_R32G32B32_FLOAT,0,0,D3D11_INPUT_PER_VERTEX_DATA,0 },
{ "Normal",0,DXGI_FORMAT_R32G32B32_FLOAT,0,12,D3D11_INPUT_PER_VERTEX_DATA,0 },
}; };
AddStaticBind( std::make_unique<InputLayout>( gfx,ied,pvsbc ) ); AddStaticBind( std::make_unique<InputLayout>( gfx,ied,pvsbc ) );
......
cbuffer CBuf
{
float4 face_colors[8];
};
float4 main( uint tid : SV_PrimitiveID ) : SV_Target
{
return face_colors[(tid/2) % 8];
}
\ No newline at end of file
...@@ -83,4 +83,46 @@ public: ...@@ -83,4 +83,46 @@ public:
} }
}; };
} }
template<class V>
static IndexedTriangleList<V> MakeIndependent()
{
constexpr float side = 1.0f / 2.0f;
std::vector<V> vertices( 24 );
vertices[0].pos = { -side,-side,-side };// 0 near side
vertices[1].pos = { side,-side,-side };// 1
vertices[2].pos = { -side,side,-side };// 2
vertices[3].pos = { side,side,-side };// 3
vertices[4].pos = { -side,-side,side };// 4 far side
vertices[5].pos = { side,-side,side };// 5
vertices[6].pos = { -side,side,side };// 6
vertices[7].pos = { side,side,side };// 7
vertices[8].pos = { -side,-side,-side };// 8 left side
vertices[9].pos = { -side,side,-side };// 9
vertices[10].pos = { -side,-side,side };// 10
vertices[11].pos = { -side,side,side };// 11
vertices[12].pos = { side,-side,-side };// 12 right side
vertices[13].pos = { side,side,-side };// 13
vertices[14].pos = { side,-side,side };// 14
vertices[15].pos = { side,side,side };// 15
vertices[16].pos = { -side,-side,-side };// 16 bottom side
vertices[17].pos = { side,-side,-side };// 17
vertices[18].pos = { -side,-side,side };// 18
vertices[19].pos = { side,-side,side };// 19
vertices[20].pos = { -side,side,-side };// 20 top side
vertices[21].pos = { side,side,-side };// 21
vertices[22].pos = { -side,side,side };// 22
vertices[23].pos = { side,side,side };// 23
return{
std::move( vertices ),{
0,2, 1, 2,3,1,
4,5, 7, 4,7,6,
8,10, 9, 10,11,9,
12,13,15, 12,15,14,
16,17,18, 18,17,19,
20,23,21, 20,22,23
}
};
}
}; };
\ No newline at end of file
...@@ -26,6 +26,27 @@ public: ...@@ -26,6 +26,27 @@ public:
); );
} }
} }
// asserts face-independent vertices w/ normals cleared to zero
void SetNormalsIndependentFlat() noexcept(!IS_DEBUG)
{
using namespace DirectX;
assert( indices.size() % 3 == 0 && indices.size() > 0 );
for( size_t i = 0; i < indices.size(); i += 3 )
{
auto& v0 = vertices[indices[i]];
auto& v1 = vertices[indices[i + 1]];
auto& v2 = vertices[indices[i + 2]];
const auto p0 = XMLoadFloat3( &v0.pos );
const auto p1 = XMLoadFloat3( &v1.pos );
const auto p2 = XMLoadFloat3( &v2.pos );
const auto n = XMVector3Normalize( XMVector3Cross( (p1 - p0),(p2 - p0) ) );
XMStoreFloat3( &v0.n,n );
XMStoreFloat3( &v1.n,n );
XMStoreFloat3( &v2.n,n );
}
}
public: public:
std::vector<T> vertices; std::vector<T> vertices;
......
#include "Melon.h"
#include "BindableBase.h"
#include "GraphicsThrowMacros.h"
#include "Sphere.h"
Melon::Melon( Graphics& gfx,
std::mt19937& rng,
std::uniform_real_distribution<float>& adist,
std::uniform_real_distribution<float>& ddist,
std::uniform_real_distribution<float>& odist,
std::uniform_real_distribution<float>& rdist,
std::uniform_int_distribution<int>& longdist,
std::uniform_int_distribution<int>& latdist )
:
r( rdist( rng ) ),
droll( ddist( rng ) ),
dpitch( ddist( rng ) ),
dyaw( ddist( rng ) ),
dphi( odist( rng ) ),
dtheta( odist( rng ) ),
dchi( odist( rng ) ),
chi( adist( rng ) ),
theta( adist( rng ) ),
phi( adist( rng ) )
{
namespace dx = DirectX;
if( !IsStaticInitialized() )
{
auto pvs = std::make_unique<VertexShader>( gfx,L"ColorIndexVS.cso" );
auto pvsbc = pvs->GetBytecode();
AddStaticBind( std::move( pvs ) );
AddStaticBind( std::make_unique<PixelShader>( gfx,L"ColorIndexPS.cso" ) );
struct PixelShaderConstants
{
struct
{
float r;
float g;
float b;
float a;
} face_colors[8];
};
const PixelShaderConstants cb2 =
{
{
{ 1.0f,1.0f,1.0f },
{ 1.0f,0.0f,0.0f },
{ 0.0f,1.0f,0.0f },
{ 1.0f,1.0f,0.0f },
{ 0.0f,0.0f,1.0f },
{ 1.0f,0.0f,1.0f },
{ 0.0f,1.0f,1.0f },
{ 0.0f,0.0f,0.0f },
}
};
AddStaticBind( std::make_unique<PixelConstantBuffer<PixelShaderConstants>>( gfx,cb2 ) );
const std::vector<D3D11_INPUT_ELEMENT_DESC> ied =
{
{ "Position",0,DXGI_FORMAT_R32G32B32_FLOAT,0,0,D3D11_INPUT_PER_VERTEX_DATA,0 },
};
AddStaticBind( std::make_unique<InputLayout>( gfx,ied,pvsbc ) );
AddStaticBind( std::make_unique<Topology>( gfx,D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST ) );
}
struct Vertex
{
dx::XMFLOAT3 pos;
};
auto model = Sphere::MakeTesselated<Vertex>( latdist( rng ),longdist( rng ) );
// deform vertices of model by linear transformation
model.Transform( dx::XMMatrixScaling( 1.0f,1.0f,1.2f ) );
AddBind( std::make_unique<VertexBuffer>( gfx,model.vertices ) );
AddIndexBuffer( std::make_unique<IndexBuffer>( gfx,model.indices ) );
AddBind( std::make_unique<TransformCbuf>( gfx,*this ) );
}
void Melon::Update( float dt ) noexcept
{
roll += droll * dt;
pitch += dpitch * dt;
yaw += dyaw * dt;
theta += dtheta * dt;
phi += dphi * dt;
chi += dchi * dt;
}
DirectX::XMMATRIX Melon::GetTransformXM() const noexcept
{
namespace dx = DirectX;
return dx::XMMatrixRotationRollPitchYaw( pitch,yaw,roll ) *
dx::XMMatrixTranslation( r,0.0f,0.0f ) *
dx::XMMatrixRotationRollPitchYaw( theta,phi,chi );
}
#pragma once
#include "DrawableBase.h"
class Melon : public DrawableBase<Melon>
{
public:
Melon( Graphics& gfx,std::mt19937& rng,
std::uniform_real_distribution<float>& adist,
std::uniform_real_distribution<float>& ddist,
std::uniform_real_distribution<float>& odist,
std::uniform_real_distribution<float>& rdist,
std::uniform_int_distribution<int>& longdist,
std::uniform_int_distribution<int>& latdist );
void Update( float dt ) noexcept override;
DirectX::XMMATRIX GetTransformXM() const noexcept override;
private:
// positional
float r;
float roll = 0.0f;
float pitch = 0.0f;
float yaw = 0.0f;
float theta;
float phi;
float chi;
// speed (delta/s)
float droll;
float dpitch;
float dyaw;
float dtheta;
float dphi;
float dchi;
};
\ No newline at end of file
cbuffer LightCBuf
{
float3 lightPos;
};
static const float3 materialColor = { 0.7f,0.7f,0.9f };
static const float3 ambient = { 0.15f,0.15f,0.15f };
static const float3 diffuseColor = { 1.0f,1.0f,1.0f };
static const float diffuseIntensity = 1.0f;
static const float attConst = 1.0f;
static const float attLin = 1.0f;
static const float attQuad = 1.0f;
float4 main( float3 worldPos : Position,float3 n : Normal ) : SV_Target
{
// fragment to light vector data
const float3 vToL = lightPos - worldPos;
const float distToL = length( vToL );
const float3 dirToL = vToL / distToL;
// diffuse attenuation
const float att = attConst + attLin * distToL + attQuad * (distToL * distToL);
// diffuse intensity
const float3 diffuse = diffuseColor * diffuseIntensity * att * max( 0.0f,dot( dirToL,n ) );
// final color
return float4(saturate( diffuse + ambient ),1.0f);
}
\ No newline at end of file
cbuffer CBuf
{
matrix model;
matrix modelViewProj;
};
struct VSOut
{
float3 worldPos : Position;
float3 normal : Normal;
float4 pos : SV_Position;
};
VSOut main( float3 pos : Position,float3 n : Normal )
{
VSOut vso;
vso.worldPos = (float3)mul( float4(pos,1.0f),model );
vso.normal = mul( n,(float3x3)model );
vso.pos = mul( float4(pos,1.0f),modelViewProj );
return vso;
}
\ No newline at end of file
#include "PointLight.h"
#include "imgui/imgui.h"
PointLight::PointLight( Graphics& gfx,float radius )
:
mesh( gfx,radius ),
cbuf( gfx )
{}
void PointLight::SpawnControlWindow() noexcept
{
if( ImGui::Begin( "Light" ) )
{
ImGui::Text( "Position" );
ImGui::SliderFloat( "X",&pos.x,-60.0f,60.0f,"%.1f" );
ImGui::SliderFloat( "Y",&pos.y,-60.0f,60.0f,"%.1f" );
ImGui::SliderFloat( "Z",&pos.z,-60.0f,60.0f,"%.1f" );
if( ImGui::Button( "Reset" ) )
{
Reset();
}
}
ImGui::End();
}
void PointLight::Reset() noexcept
{
pos = { 0.0f,0.0f,0.0f };
}
void PointLight::Draw( Graphics& gfx ) const noexcept(!IS_DEBUG)
{
mesh.SetPos( pos );
mesh.Draw( gfx );
}
void PointLight::Bind( Graphics& gfx ) const noexcept
{
cbuf.Update( gfx,PointLightCBuf{ pos } );
}
#pragma once
#include "Graphics.h"
#include "SolidSphere.h"
#include "ConstantBuffers.h"
class PointLight
{
public:
PointLight( Graphics& gfx,float radius = 0.5f );
void SpawnControlWindow() noexcept;
void Reset() noexcept;
void Draw( Graphics& gfx ) const noexcept(!IS_DEBUG);
void Bind( Graphics& gfx ) const noexcept;
private:
struct PointLightCBuf
{
DirectX::XMFLOAT3 pos;
float padding;
};
private:
DirectX::XMFLOAT3 pos = { 0.0f,0.0f,0.0f };;
mutable SolidSphere mesh;
mutable PixelConstantBuffer<PointLightCBuf> cbuf;
};
\ No newline at end of file
cbuffer CBuf
{
float4 color;
};
float4 main() : SV_Target
{
return color;
}
\ No newline at end of file
#include "SolidSphere.h"
#include "BindableBase.h"
#include "GraphicsThrowMacros.h"
#include "Sphere.h"
SolidSphere::SolidSphere( Graphics& gfx,float radius )
{
namespace dx = DirectX;
if( !IsStaticInitialized() )
{
struct Vertex
{
dx::XMFLOAT3 pos;
};
auto model = Sphere::Make<Vertex>();
model.Transform( dx::XMMatrixScaling( radius,radius,radius ) );
AddBind( std::make_unique<VertexBuffer>( gfx,model.vertices ) );
AddIndexBuffer( std::make_unique<IndexBuffer>( gfx,model.indices ) );
auto pvs = std::make_unique<VertexShader>( gfx,L"SolidVS.cso" );
auto pvsbc = pvs->GetBytecode();
AddStaticBind( std::move( pvs ) );
AddStaticBind( std::make_unique<PixelShader>( gfx,L"SolidPS.cso" ) );
struct PSColorConstant
{
dx::XMFLOAT3 color = { 1.0f,1.0f,1.0f };
float padding;
} colorConst;
AddStaticBind( std::make_unique<PixelConstantBuffer<PSColorConstant>>( gfx,colorConst ) );
const std::vector<D3D11_INPUT_ELEMENT_DESC> ied =
{
{ "Position",0,DXGI_FORMAT_R32G32B32_FLOAT,0,0,D3D11_INPUT_PER_VERTEX_DATA,0 },
};
AddStaticBind( std::make_unique<InputLayout>( gfx,ied,pvsbc ) );
AddStaticBind( std::make_unique<Topology>( gfx,D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST ) );
}
else
{
SetIndexFromStatic();
}
AddBind( std::make_unique<TransformCbuf>( gfx,*this ) );
}
void SolidSphere::Update( float dt ) noexcept {}
void SolidSphere::SetPos( DirectX::XMFLOAT3 pos ) noexcept
{
this->pos = pos;
}
DirectX::XMMATRIX SolidSphere::GetTransformXM() const noexcept
{
return DirectX::XMMatrixTranslation( pos.x,pos.y,pos.z );
}
#pragma once
#include "DrawableBase.h"
class SolidSphere : public DrawableBase<SolidSphere>
{
public:
SolidSphere( Graphics& gfx,float radius );
void Update( float dt ) noexcept override;
void SetPos( DirectX::XMFLOAT3 pos ) noexcept;
DirectX::XMMATRIX GetTransformXM() const noexcept override;
private:
DirectX::XMFLOAT3 pos = { 1.0f,1.0f,1.0f };
};
\ No newline at end of file
cbuffer CBuf cbuffer CBuf
{ {
matrix transform; matrix model;
matrix modelViewProj;
}; };
float4 main( float3 pos : Position ) : SV_Position float4 main( float3 pos : Position ) : SV_Position
{ {
return mul( float4(pos,1.0f),transform ); return mul( float4(pos,1.0f),modelViewProj );
} }
\ No newline at end of file
...@@ -6,20 +6,24 @@ TransformCbuf::TransformCbuf( Graphics& gfx,const Drawable& parent ) ...@@ -6,20 +6,24 @@ TransformCbuf::TransformCbuf( Graphics& gfx,const Drawable& parent )
{ {
if( !pVcbuf ) if( !pVcbuf )
{ {
pVcbuf = std::make_unique<VertexConstantBuffer<DirectX::XMMATRIX>>( gfx ); pVcbuf = std::make_unique<VertexConstantBuffer<Transforms>>( gfx );
} }
} }
void TransformCbuf::Bind( Graphics& gfx ) noexcept void TransformCbuf::Bind( Graphics& gfx ) noexcept
{ {
pVcbuf->Update( gfx, const auto model = parent.GetTransformXM();
const Transforms tf =
{
DirectX::XMMatrixTranspose( model ),
DirectX::XMMatrixTranspose( DirectX::XMMatrixTranspose(
parent.GetTransformXM() * model *
gfx.GetCamera() * gfx.GetCamera() *
gfx.GetProjection() gfx.GetProjection()
) )
); };
pVcbuf->Update( gfx,tf );
pVcbuf->Bind( gfx ); pVcbuf->Bind( gfx );
} }
std::unique_ptr<VertexConstantBuffer<DirectX::XMMATRIX>> TransformCbuf::pVcbuf; std::unique_ptr<VertexConstantBuffer<TransformCbuf::Transforms>> TransformCbuf::pVcbuf;
\ No newline at end of file \ No newline at end of file
...@@ -5,10 +5,16 @@ ...@@ -5,10 +5,16 @@
class TransformCbuf : public Bindable class TransformCbuf : public Bindable
{ {
private:
struct Transforms
{
DirectX::XMMATRIX modelViewProj;
DirectX::XMMATRIX model;
};
public: public:
TransformCbuf( Graphics& gfx,const Drawable& parent ); TransformCbuf( Graphics& gfx,const Drawable& parent );
void Bind( Graphics& gfx ) noexcept override; void Bind( Graphics& gfx ) noexcept override;
private: private:
static std::unique_ptr<VertexConstantBuffer<DirectX::XMMATRIX>> pVcbuf; static std::unique_ptr<VertexConstantBuffer<Transforms>> pVcbuf;
const Drawable& parent; const Drawable& parent;
}; };
\ No newline at end of file
...@@ -168,7 +168,8 @@ ...@@ -168,7 +168,8 @@
<ClCompile Include="IndexBuffer.cpp" /> <ClCompile Include="IndexBuffer.cpp" />
<ClCompile Include="InputLayout.cpp" /> <ClCompile Include="InputLayout.cpp" />
<ClCompile Include="Keyboard.cpp" /> <ClCompile Include="Keyboard.cpp" />
<ClCompile Include="Melon.cpp" /> <ClCompile Include="PointLight.cpp" />
<ClCompile Include="SolidSphere.cpp" />
<ClCompile Include="Mouse.cpp" /> <ClCompile Include="Mouse.cpp" />
<ClCompile Include="PixelShader.cpp" /> <ClCompile Include="PixelShader.cpp" />
<ClCompile Include="Pyramid.cpp" /> <ClCompile Include="Pyramid.cpp" />
...@@ -218,7 +219,8 @@ ...@@ -218,7 +219,8 @@
<ClInclude Include="IndexedTriangleList.h" /> <ClInclude Include="IndexedTriangleList.h" />
<ClInclude Include="InputLayout.h" /> <ClInclude Include="InputLayout.h" />
<ClInclude Include="Keyboard.h" /> <ClInclude Include="Keyboard.h" />
<ClInclude Include="Melon.h" /> <ClInclude Include="PointLight.h" />
<ClInclude Include="SolidSphere.h" />
<ClInclude Include="Mouse.h" /> <ClInclude Include="Mouse.h" />
<ClInclude Include="PixelShader.h" /> <ClInclude Include="PixelShader.h" />
<ClInclude Include="Plane.h" /> <ClInclude Include="Plane.h" />
...@@ -279,7 +281,7 @@ ...@@ -279,7 +281,7 @@
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile> </FxCompile>
<FxCompile Include="ColorIndexPS.hlsl"> <FxCompile Include="SolidPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType> <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel> <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType> <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
...@@ -293,7 +295,7 @@ ...@@ -293,7 +295,7 @@
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile> </FxCompile>
<FxCompile Include="ColorIndexVS.hlsl"> <FxCompile Include="SolidVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType> <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel> <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType> <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
...@@ -307,6 +309,26 @@ ...@@ -307,6 +309,26 @@
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile> </FxCompile>
<FxCompile Include="PhongPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile>
<FxCompile Include="PhongVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
</FxCompile>
<FxCompile Include="TexturePS.hlsl"> <FxCompile Include="TexturePS.hlsl">
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput> <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename).cso</ObjectFileOutput>
......
...@@ -108,9 +108,6 @@ ...@@ -108,9 +108,6 @@
<ClCompile Include="Pyramid.cpp"> <ClCompile Include="Pyramid.cpp">
<Filter>Source Files\Drawable</Filter> <Filter>Source Files\Drawable</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Melon.cpp">
<Filter>Source Files\Drawable</Filter>
</ClCompile>
<ClCompile Include="Surface.cpp"> <ClCompile Include="Surface.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
...@@ -153,6 +150,12 @@ ...@@ -153,6 +150,12 @@
<ClCompile Include="Camera.cpp"> <ClCompile Include="Camera.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="SolidSphere.cpp">
<Filter>Source Files\Drawable</Filter>
</ClCompile>
<ClCompile Include="PointLight.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="WindowsMessageMap.h"> <ClInclude Include="WindowsMessageMap.h">
...@@ -257,9 +260,6 @@ ...@@ -257,9 +260,6 @@
<ClInclude Include="Prism.h"> <ClInclude Include="Prism.h">
<Filter>Header Files\Geometry</Filter> <Filter>Header Files\Geometry</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Melon.h">
<Filter>Header Files\Drawable</Filter>
</ClInclude>
<ClInclude Include="Pyramid.h"> <ClInclude Include="Pyramid.h">
<Filter>Header Files\Drawable</Filter> <Filter>Header Files\Drawable</Filter>
</ClInclude> </ClInclude>
...@@ -311,6 +311,12 @@ ...@@ -311,6 +311,12 @@
<ClInclude Include="Camera.h"> <ClInclude Include="Camera.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="SolidSphere.h">
<Filter>Header Files\Drawable</Filter>
</ClInclude>
<ClInclude Include="PointLight.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="hw3d.rc"> <ResourceCompile Include="hw3d.rc">
...@@ -340,16 +346,22 @@ ...@@ -340,16 +346,22 @@
<FxCompile Include="ColorBlendVS.hlsl"> <FxCompile Include="ColorBlendVS.hlsl">
<Filter>Shader</Filter> <Filter>Shader</Filter>
</FxCompile> </FxCompile>
<FxCompile Include="ColorIndexPS.hlsl"> <FxCompile Include="TexturePS.hlsl">
<Filter>Shader</Filter> <Filter>Shader</Filter>
</FxCompile> </FxCompile>
<FxCompile Include="ColorIndexVS.hlsl"> <FxCompile Include="TextureVS.hlsl">
<Filter>Shader</Filter> <Filter>Shader</Filter>
</FxCompile> </FxCompile>
<FxCompile Include="TexturePS.hlsl"> <FxCompile Include="PhongVS.hlsl">
<Filter>Shader</Filter> <Filter>Shader</Filter>
</FxCompile> </FxCompile>
<FxCompile Include="TextureVS.hlsl"> <FxCompile Include="PhongPS.hlsl">
<Filter>Shader</Filter>
</FxCompile>
<FxCompile Include="SolidPS.hlsl">
<Filter>Shader</Filter>
</FxCompile>
<FxCompile Include="SolidVS.hlsl">
<Filter>Shader</Filter> <Filter>Shader</Filter>
</FxCompile> </FxCompile>
</ItemGroup> </ItemGroup>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment