template project, first version

This commit is contained in:
rachelchu
2017-10-11 15:01:05 +02:00
commit 8e902224cf
794 changed files with 326190 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
//--------------------------------------------------------------------------------------
// File: AlignedNew.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <malloc.h>
#include <exception>
namespace DirectX
{
// Derive from this to customize operator new and delete for
// types that have special heap alignment requirements.
//
// Example usage:
//
// __declspec(align(16)) struct MyAlignedType : public AlignedNew<MyAlignedType>
template<typename TDerived>
struct AlignedNew
{
// Allocate aligned memory.
static void* operator new (size_t size)
{
const size_t alignment = __alignof(TDerived);
static_assert(alignment > 8, "AlignedNew is only useful for types with > 8 byte alignment. Did you forget a __declspec(align) on TDerived?");
void* ptr = _aligned_malloc(size, alignment);
if (!ptr)
throw std::bad_alloc();
return ptr;
}
// Free aligned memory.
static void operator delete (void* ptr)
{
_aligned_free(ptr);
}
// Array overloads.
static void* operator new[] (size_t size)
{
return operator new(size);
}
static void operator delete[] (void* ptr)
{
operator delete(ptr);
}
};
}

View File

@@ -0,0 +1,447 @@
//--------------------------------------------------------------------------------------
// File: AlphaTestEffect.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
using namespace DirectX;
// Constant buffer layout. Must match the shader!
struct AlphaTestEffectConstants
{
XMVECTOR diffuseColor;
XMVECTOR alphaTest;
XMVECTOR fogColor;
XMVECTOR fogVector;
XMMATRIX worldViewProj;
};
static_assert( ( sizeof(AlphaTestEffectConstants) % 16 ) == 0, "CB size not padded correctly" );
// Traits type describes our characteristics to the EffectBase template.
struct AlphaTestEffectTraits
{
typedef AlphaTestEffectConstants ConstantBufferType;
static const int VertexShaderCount = 4;
static const int PixelShaderCount = 4;
static const int ShaderPermutationCount = 8;
};
// Internal AlphaTestEffect implementation class.
class AlphaTestEffect::Impl : public EffectBase<AlphaTestEffectTraits>
{
public:
Impl(_In_ ID3D11Device* device);
D3D11_COMPARISON_FUNC alphaFunction;
int referenceAlpha;
bool vertexColorEnabled;
EffectColor color;
int GetCurrentShaderPermutation() const;
void Apply(_In_ ID3D11DeviceContext* deviceContext);
};
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOneAlphaTestEffect_VSAlphaTest.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_VSAlphaTestNoFog.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_VSAlphaTestVc.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_VSAlphaTestVcNoFog.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_PSAlphaTestLtGt.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_PSAlphaTestLtGtNoFog.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_PSAlphaTestEqNe.inc"
#include "Shaders/Compiled/XboxOneAlphaTestEffect_PSAlphaTestEqNeNoFog.inc"
#else
#include "Shaders/Compiled/AlphaTestEffect_VSAlphaTest.inc"
#include "Shaders/Compiled/AlphaTestEffect_VSAlphaTestNoFog.inc"
#include "Shaders/Compiled/AlphaTestEffect_VSAlphaTestVc.inc"
#include "Shaders/Compiled/AlphaTestEffect_VSAlphaTestVcNoFog.inc"
#include "Shaders/Compiled/AlphaTestEffect_PSAlphaTestLtGt.inc"
#include "Shaders/Compiled/AlphaTestEffect_PSAlphaTestLtGtNoFog.inc"
#include "Shaders/Compiled/AlphaTestEffect_PSAlphaTestEqNe.inc"
#include "Shaders/Compiled/AlphaTestEffect_PSAlphaTestEqNeNoFog.inc"
#endif
}
template<>
const ShaderBytecode EffectBase<AlphaTestEffectTraits>::VertexShaderBytecode[] =
{
{ AlphaTestEffect_VSAlphaTest, sizeof(AlphaTestEffect_VSAlphaTest) },
{ AlphaTestEffect_VSAlphaTestNoFog, sizeof(AlphaTestEffect_VSAlphaTestNoFog) },
{ AlphaTestEffect_VSAlphaTestVc, sizeof(AlphaTestEffect_VSAlphaTestVc) },
{ AlphaTestEffect_VSAlphaTestVcNoFog, sizeof(AlphaTestEffect_VSAlphaTestVcNoFog) },
};
template<>
const int EffectBase<AlphaTestEffectTraits>::VertexShaderIndices[] =
{
0, // lt/gt
1, // lt/gt, no fog
2, // lt/gt, vertex color
3, // lt/gt, vertex color, no fog
0, // eq/ne
1, // eq/ne, no fog
2, // eq/ne, vertex color
3, // eq/ne, vertex color, no fog
};
template<>
const ShaderBytecode EffectBase<AlphaTestEffectTraits>::PixelShaderBytecode[] =
{
{ AlphaTestEffect_PSAlphaTestLtGt, sizeof(AlphaTestEffect_PSAlphaTestLtGt) },
{ AlphaTestEffect_PSAlphaTestLtGtNoFog, sizeof(AlphaTestEffect_PSAlphaTestLtGtNoFog) },
{ AlphaTestEffect_PSAlphaTestEqNe, sizeof(AlphaTestEffect_PSAlphaTestEqNe) },
{ AlphaTestEffect_PSAlphaTestEqNeNoFog, sizeof(AlphaTestEffect_PSAlphaTestEqNeNoFog) },
};
template<>
const int EffectBase<AlphaTestEffectTraits>::PixelShaderIndices[] =
{
0, // lt/gt
1, // lt/gt, no fog
0, // lt/gt, vertex color
1, // lt/gt, vertex color, no fog
2, // eq/ne
3, // eq/ne, no fog
2, // eq/ne, vertex color
3, // eq/ne, vertex color, no fog
};
// Global pool of per-device AlphaTestEffect resources.
template<>
SharedResourcePool<ID3D11Device*, EffectBase<AlphaTestEffectTraits>::DeviceResources> EffectBase<AlphaTestEffectTraits>::deviceResourcesPool;
// Constructor.
AlphaTestEffect::Impl::Impl(_In_ ID3D11Device* device)
: EffectBase(device),
alphaFunction(D3D11_COMPARISON_GREATER),
referenceAlpha(0),
vertexColorEnabled(false)
{
static_assert( _countof(EffectBase<AlphaTestEffectTraits>::VertexShaderIndices) == AlphaTestEffectTraits::ShaderPermutationCount, "array/max mismatch" );
static_assert( _countof(EffectBase<AlphaTestEffectTraits>::VertexShaderBytecode) == AlphaTestEffectTraits::VertexShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<AlphaTestEffectTraits>::PixelShaderBytecode) == AlphaTestEffectTraits::PixelShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<AlphaTestEffectTraits>::PixelShaderIndices) == AlphaTestEffectTraits::ShaderPermutationCount, "array/max mismatch" );
}
int AlphaTestEffect::Impl::GetCurrentShaderPermutation() const
{
int permutation = 0;
// Use optimized shaders if fog is disabled.
if (!fog.enabled)
{
permutation += 1;
}
// Support vertex coloring?
if (vertexColorEnabled)
{
permutation += 2;
}
// Which alpha compare mode?
if (alphaFunction == D3D11_COMPARISON_EQUAL ||
alphaFunction == D3D11_COMPARISON_NOT_EQUAL)
{
permutation += 4;
}
return permutation;
}
// Sets our state onto the D3D device.
void AlphaTestEffect::Impl::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
// Compute derived parameter values.
matrices.SetConstants(dirtyFlags, constants.worldViewProj);
fog.SetConstants(dirtyFlags, matrices.worldView, constants.fogVector);
color.SetConstants(dirtyFlags, constants.diffuseColor);
// Recompute the alpha test settings?
if (dirtyFlags & EffectDirtyFlags::AlphaTest)
{
// Convert reference alpha from 8 bit integer to 0-1 float format.
float reference = (float)referenceAlpha / 255.0f;
// Comparison tolerance of half the 8 bit integer precision.
const float threshold = 0.5f / 255.0f;
// What to do if the alpha comparison passes or fails. Positive accepts the pixel, negative clips it.
static const XMVECTORF32 selectIfTrue = { { { 1, -1 } } };
static const XMVECTORF32 selectIfFalse = { { { -1, 1 } } };
static const XMVECTORF32 selectNever = { { { -1, -1 } } };
static const XMVECTORF32 selectAlways = { { { 1, 1 } } };
float compareTo;
XMVECTOR resultSelector;
switch (alphaFunction)
{
case D3D11_COMPARISON_LESS:
// Shader will evaluate: clip((a < x) ? z : w)
compareTo = reference - threshold;
resultSelector = selectIfTrue;
break;
case D3D11_COMPARISON_LESS_EQUAL:
// Shader will evaluate: clip((a < x) ? z : w)
compareTo = reference + threshold;
resultSelector = selectIfTrue;
break;
case D3D11_COMPARISON_GREATER_EQUAL:
// Shader will evaluate: clip((a < x) ? z : w)
compareTo = reference - threshold;
resultSelector = selectIfFalse;
break;
case D3D11_COMPARISON_GREATER:
// Shader will evaluate: clip((a < x) ? z : w)
compareTo = reference + threshold;
resultSelector = selectIfFalse;
break;
case D3D11_COMPARISON_EQUAL:
// Shader will evaluate: clip((abs(a - x) < y) ? z : w)
compareTo = reference;
resultSelector = selectIfTrue;
break;
case D3D11_COMPARISON_NOT_EQUAL:
// Shader will evaluate: clip((abs(a - x) < y) ? z : w)
compareTo = reference;
resultSelector = selectIfFalse;
break;
case D3D11_COMPARISON_NEVER:
// Shader will evaluate: clip((a < x) ? z : w)
compareTo = 0;
resultSelector = selectNever;
break;
case D3D11_COMPARISON_ALWAYS:
// Shader will evaluate: clip((a < x) ? z : w)
compareTo = 0;
resultSelector = selectAlways;
break;
default:
throw std::exception("Unknown alpha test function");
}
// x = compareTo, y = threshold, zw = resultSelector.
constants.alphaTest = XMVectorPermute<0, 1, 4, 5>(XMVectorSet(compareTo, threshold, 0, 0), resultSelector);
dirtyFlags &= ~EffectDirtyFlags::AlphaTest;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Set the texture.
ID3D11ShaderResourceView* textures[1] = { texture.Get() };
deviceContext->PSSetShaderResources(0, 1, textures);
// Set shaders and constant buffers.
ApplyShaders(deviceContext, GetCurrentShaderPermutation());
}
// Public constructor.
AlphaTestEffect::AlphaTestEffect(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
AlphaTestEffect::AlphaTestEffect(AlphaTestEffect&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
AlphaTestEffect& AlphaTestEffect::operator= (AlphaTestEffect&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
AlphaTestEffect::~AlphaTestEffect()
{
}
// IEffect methods.
void AlphaTestEffect::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
pImpl->Apply(deviceContext);
}
void AlphaTestEffect::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
pImpl->GetVertexShaderBytecode(pImpl->GetCurrentShaderPermutation(), pShaderByteCode, pByteCodeLength);
}
// Camera settings.
void XM_CALLCONV AlphaTestEffect::SetWorld(FXMMATRIX value)
{
pImpl->matrices.world = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV AlphaTestEffect::SetView(FXMMATRIX value)
{
pImpl->matrices.view = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV AlphaTestEffect::SetProjection(FXMMATRIX value)
{
pImpl->matrices.projection = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj;
}
void XM_CALLCONV AlphaTestEffect::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
pImpl->matrices.world = world;
pImpl->matrices.view = view;
pImpl->matrices.projection = projection;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
// Material settings
void XM_CALLCONV AlphaTestEffect::SetDiffuseColor(FXMVECTOR value)
{
pImpl->color.diffuseColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void AlphaTestEffect::SetAlpha(float value)
{
pImpl->color.alpha = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV AlphaTestEffect::SetColorAndAlpha(FXMVECTOR value)
{
pImpl->color.diffuseColor = value;
pImpl->color.alpha = XMVectorGetW(value);
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
// Fog settings.
void AlphaTestEffect::SetFogEnabled(bool value)
{
pImpl->fog.enabled = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogEnable;
}
void AlphaTestEffect::SetFogStart(float value)
{
pImpl->fog.start = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void AlphaTestEffect::SetFogEnd(float value)
{
pImpl->fog.end = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void XM_CALLCONV AlphaTestEffect::SetFogColor(FXMVECTOR value)
{
pImpl->constants.fogColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Vertex color setting.
void AlphaTestEffect::SetVertexColorEnabled(bool value)
{
pImpl->vertexColorEnabled = value;
}
// Texture settings.
void AlphaTestEffect::SetTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
}
void AlphaTestEffect::SetAlphaFunction(D3D11_COMPARISON_FUNC value)
{
pImpl->alphaFunction = value;
pImpl->dirtyFlags |= EffectDirtyFlags::AlphaTest;
}
void AlphaTestEffect::SetReferenceAlpha(int value)
{
pImpl->referenceAlpha = value;
pImpl->dirtyFlags |= EffectDirtyFlags::AlphaTest;
}

View File

@@ -0,0 +1,733 @@
//--------------------------------------------------------------------------------------
// File: BasicEffect.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
using namespace DirectX;
// Constant buffer layout. Must match the shader!
struct BasicEffectConstants
{
XMVECTOR diffuseColor;
XMVECTOR emissiveColor;
XMVECTOR specularColorAndPower;
XMVECTOR lightDirection[IEffectLights::MaxDirectionalLights];
XMVECTOR lightDiffuseColor[IEffectLights::MaxDirectionalLights];
XMVECTOR lightSpecularColor[IEffectLights::MaxDirectionalLights];
XMVECTOR eyePosition;
XMVECTOR fogColor;
XMVECTOR fogVector;
XMMATRIX world;
XMVECTOR worldInverseTranspose[3];
XMMATRIX worldViewProj;
};
static_assert( ( sizeof(BasicEffectConstants) % 16 ) == 0, "CB size not padded correctly" );
// Traits type describes our characteristics to the EffectBase template.
struct BasicEffectTraits
{
typedef BasicEffectConstants ConstantBufferType;
static const int VertexShaderCount = 32;
static const int PixelShaderCount = 10;
static const int ShaderPermutationCount = 56;
};
// Internal BasicEffect implementation class.
class BasicEffect::Impl : public EffectBase<BasicEffectTraits>
{
public:
Impl(_In_ ID3D11Device* device);
bool lightingEnabled;
bool preferPerPixelLighting;
bool vertexColorEnabled;
bool textureEnabled;
bool biasedVertexNormals;
EffectLights lights;
int GetCurrentShaderPermutation() const;
void Apply(_In_ ID3D11DeviceContext* deviceContext);
};
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasic.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVcNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicTx.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicTxNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicTxVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicTxVcNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLighting.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingTx.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingTxVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLight.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightTx.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightTxVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLighting.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingTx.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingTxVc.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingVcBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingTxBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicVertexLightingTxVcBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightVcBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightTxBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicOneLightTxVcBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingVcBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingTxBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_VSBasicPixelLightingTxVcBn.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasic.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicTx.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicTxNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicVertexLighting.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicVertexLightingNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicVertexLightingTx.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicVertexLightingTxNoFog.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicPixelLighting.inc"
#include "Shaders/Compiled/XboxOneBasicEffect_PSBasicPixelLightingTx.inc"
#else
#include "Shaders/Compiled/BasicEffect_VSBasic.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicNoFog.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVcNoFog.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicTx.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicTxNoFog.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicTxVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicTxVcNoFog.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLighting.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingTx.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingTxVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLight.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightTx.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightTxVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLighting.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingTx.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingTxVc.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingVcBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingTxBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicVertexLightingTxVcBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightVcBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightTxBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicOneLightTxVcBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingVcBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingTxBn.inc"
#include "Shaders/Compiled/BasicEffect_VSBasicPixelLightingTxVcBn.inc"
#include "Shaders/Compiled/BasicEffect_PSBasic.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicNoFog.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicTx.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicTxNoFog.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicVertexLighting.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicVertexLightingNoFog.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicVertexLightingTx.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicVertexLightingTxNoFog.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicPixelLighting.inc"
#include "Shaders/Compiled/BasicEffect_PSBasicPixelLightingTx.inc"
#endif
}
template<>
const ShaderBytecode EffectBase<BasicEffectTraits>::VertexShaderBytecode[] =
{
{ BasicEffect_VSBasic, sizeof(BasicEffect_VSBasic) },
{ BasicEffect_VSBasicNoFog, sizeof(BasicEffect_VSBasicNoFog) },
{ BasicEffect_VSBasicVc, sizeof(BasicEffect_VSBasicVc) },
{ BasicEffect_VSBasicVcNoFog, sizeof(BasicEffect_VSBasicVcNoFog) },
{ BasicEffect_VSBasicTx, sizeof(BasicEffect_VSBasicTx) },
{ BasicEffect_VSBasicTxNoFog, sizeof(BasicEffect_VSBasicTxNoFog) },
{ BasicEffect_VSBasicTxVc, sizeof(BasicEffect_VSBasicTxVc) },
{ BasicEffect_VSBasicTxVcNoFog, sizeof(BasicEffect_VSBasicTxVcNoFog) },
{ BasicEffect_VSBasicVertexLighting, sizeof(BasicEffect_VSBasicVertexLighting) },
{ BasicEffect_VSBasicVertexLightingVc, sizeof(BasicEffect_VSBasicVertexLightingVc) },
{ BasicEffect_VSBasicVertexLightingTx, sizeof(BasicEffect_VSBasicVertexLightingTx) },
{ BasicEffect_VSBasicVertexLightingTxVc, sizeof(BasicEffect_VSBasicVertexLightingTxVc) },
{ BasicEffect_VSBasicOneLight, sizeof(BasicEffect_VSBasicOneLight) },
{ BasicEffect_VSBasicOneLightVc, sizeof(BasicEffect_VSBasicOneLightVc) },
{ BasicEffect_VSBasicOneLightTx, sizeof(BasicEffect_VSBasicOneLightTx) },
{ BasicEffect_VSBasicOneLightTxVc, sizeof(BasicEffect_VSBasicOneLightTxVc) },
{ BasicEffect_VSBasicPixelLighting, sizeof(BasicEffect_VSBasicPixelLighting) },
{ BasicEffect_VSBasicPixelLightingVc, sizeof(BasicEffect_VSBasicPixelLightingVc) },
{ BasicEffect_VSBasicPixelLightingTx, sizeof(BasicEffect_VSBasicPixelLightingTx) },
{ BasicEffect_VSBasicPixelLightingTxVc, sizeof(BasicEffect_VSBasicPixelLightingTxVc) },
{ BasicEffect_VSBasicVertexLightingBn, sizeof(BasicEffect_VSBasicVertexLightingBn) },
{ BasicEffect_VSBasicVertexLightingVcBn, sizeof(BasicEffect_VSBasicVertexLightingVcBn) },
{ BasicEffect_VSBasicVertexLightingTxBn, sizeof(BasicEffect_VSBasicVertexLightingTxBn) },
{ BasicEffect_VSBasicVertexLightingTxVcBn, sizeof(BasicEffect_VSBasicVertexLightingTxVcBn) },
{ BasicEffect_VSBasicOneLightBn, sizeof(BasicEffect_VSBasicOneLightBn) },
{ BasicEffect_VSBasicOneLightVcBn, sizeof(BasicEffect_VSBasicOneLightVcBn) },
{ BasicEffect_VSBasicOneLightTxBn, sizeof(BasicEffect_VSBasicOneLightTxBn) },
{ BasicEffect_VSBasicOneLightTxVcBn, sizeof(BasicEffect_VSBasicOneLightTxVcBn) },
{ BasicEffect_VSBasicPixelLightingBn, sizeof(BasicEffect_VSBasicPixelLightingBn) },
{ BasicEffect_VSBasicPixelLightingVcBn, sizeof(BasicEffect_VSBasicPixelLightingVcBn) },
{ BasicEffect_VSBasicPixelLightingTxBn, sizeof(BasicEffect_VSBasicPixelLightingTxBn) },
{ BasicEffect_VSBasicPixelLightingTxVcBn, sizeof(BasicEffect_VSBasicPixelLightingTxVcBn) },
};
template<>
const int EffectBase<BasicEffectTraits>::VertexShaderIndices[] =
{
0, // basic
1, // no fog
2, // vertex color
3, // vertex color, no fog
4, // texture
5, // texture, no fog
6, // texture + vertex color
7, // texture + vertex color, no fog
8, // vertex lighting
8, // vertex lighting, no fog
9, // vertex lighting + vertex color
9, // vertex lighting + vertex color, no fog
10, // vertex lighting + texture
10, // vertex lighting + texture, no fog
11, // vertex lighting + texture + vertex color
11, // vertex lighting + texture + vertex color, no fog
12, // one light
12, // one light, no fog
13, // one light + vertex color
13, // one light + vertex color, no fog
14, // one light + texture
14, // one light + texture, no fog
15, // one light + texture + vertex color
15, // one light + texture + vertex color, no fog
16, // pixel lighting
16, // pixel lighting, no fog
17, // pixel lighting + vertex color
17, // pixel lighting + vertex color, no fog
18, // pixel lighting + texture
18, // pixel lighting + texture, no fog
19, // pixel lighting + texture + vertex color
19, // pixel lighting + texture + vertex color, no fog
20, // vertex lighting (biased vertex normals)
20, // vertex lighting (biased vertex normals), no fog
21, // vertex lighting (biased vertex normals) + vertex color
21, // vertex lighting (biased vertex normals) + vertex color, no fog
22, // vertex lighting (biased vertex normals) + texture
22, // vertex lighting (biased vertex normals) + texture, no fog
23, // vertex lighting (biased vertex normals) + texture + vertex color
23, // vertex lighting (biased vertex normals) + texture + vertex color, no fog
24, // one light (biased vertex normals)
24, // one light (biased vertex normals), no fog
25, // one light (biased vertex normals) + vertex color
25, // one light (biased vertex normals) + vertex color, no fog
26, // one light (biased vertex normals) + texture
26, // one light (biased vertex normals) + texture, no fog
27, // one light (biased vertex normals) + texture + vertex color
27, // one light (biased vertex normals) + texture + vertex color, no fog
28, // pixel lighting (biased vertex normals)
28, // pixel lighting (biased vertex normals), no fog
29, // pixel lighting (biased vertex normals) + vertex color
29, // pixel lighting (biased vertex normals) + vertex color, no fog
30, // pixel lighting (biased vertex normals) + texture
30, // pixel lighting (biased vertex normals) + texture, no fog
31, // pixel lighting (biased vertex normals) + texture + vertex color
31, // pixel lighting (biased vertex normals) + texture + vertex color, no fog
};
template<>
const ShaderBytecode EffectBase<BasicEffectTraits>::PixelShaderBytecode[] =
{
{ BasicEffect_PSBasic, sizeof(BasicEffect_PSBasic) },
{ BasicEffect_PSBasicNoFog, sizeof(BasicEffect_PSBasicNoFog) },
{ BasicEffect_PSBasicTx, sizeof(BasicEffect_PSBasicTx) },
{ BasicEffect_PSBasicTxNoFog, sizeof(BasicEffect_PSBasicTxNoFog) },
{ BasicEffect_PSBasicVertexLighting, sizeof(BasicEffect_PSBasicVertexLighting) },
{ BasicEffect_PSBasicVertexLightingNoFog, sizeof(BasicEffect_PSBasicVertexLightingNoFog) },
{ BasicEffect_PSBasicVertexLightingTx, sizeof(BasicEffect_PSBasicVertexLightingTx) },
{ BasicEffect_PSBasicVertexLightingTxNoFog, sizeof(BasicEffect_PSBasicVertexLightingTxNoFog) },
{ BasicEffect_PSBasicPixelLighting, sizeof(BasicEffect_PSBasicPixelLighting) },
{ BasicEffect_PSBasicPixelLightingTx, sizeof(BasicEffect_PSBasicPixelLightingTx) },
};
template<>
const int EffectBase<BasicEffectTraits>::PixelShaderIndices[] =
{
0, // basic
1, // no fog
0, // vertex color
1, // vertex color, no fog
2, // texture
3, // texture, no fog
2, // texture + vertex color
3, // texture + vertex color, no fog
4, // vertex lighting
5, // vertex lighting, no fog
4, // vertex lighting + vertex color
5, // vertex lighting + vertex color, no fog
6, // vertex lighting + texture
7, // vertex lighting + texture, no fog
6, // vertex lighting + texture + vertex color
7, // vertex lighting + texture + vertex color, no fog
4, // one light
5, // one light, no fog
4, // one light + vertex color
5, // one light + vertex color, no fog
6, // one light + texture
7, // one light + texture, no fog
6, // one light + texture + vertex color
7, // one light + texture + vertex color, no fog
8, // pixel lighting
8, // pixel lighting, no fog
8, // pixel lighting + vertex color
8, // pixel lighting + vertex color, no fog
9, // pixel lighting + texture
9, // pixel lighting + texture, no fog
9, // pixel lighting + texture + vertex color
9, // pixel lighting + texture + vertex color, no fog
4, // vertex lighting (biased vertex normals)
5, // vertex lighting (biased vertex normals), no fog
4, // vertex lighting (biased vertex normals) + vertex color
5, // vertex lighting (biased vertex normals) + vertex color, no fog
6, // vertex lighting (biased vertex normals) + texture
7, // vertex lighting (biased vertex normals) + texture, no fog
6, // vertex lighting (biased vertex normals) + texture + vertex color
7, // vertex lighting (biased vertex normals) + texture + vertex color, no fog
4, // one light (biased vertex normals)
5, // one light (biased vertex normals), no fog
4, // one light (biased vertex normals) + vertex color
5, // one light (biased vertex normals) + vertex color, no fog
6, // one light (biased vertex normals) + texture
7, // one light (biased vertex normals) + texture, no fog
6, // one light (biased vertex normals) + texture + vertex color
7, // one light (biased vertex normals) + texture + vertex color, no fog
8, // pixel lighting (biased vertex normals)
8, // pixel lighting (biased vertex normals), no fog
8, // pixel lighting (biased vertex normals) + vertex color
8, // pixel lighting (biased vertex normals) + vertex color, no fog
9, // pixel lighting (biased vertex normals) + texture
9, // pixel lighting (biased vertex normals) + texture, no fog
9, // pixel lighting (biased vertex normals) + texture + vertex color
9, // pixel lighting (biased vertex normals) + texture + vertex color, no fog
};
// Global pool of per-device BasicEffect resources.
SharedResourcePool<ID3D11Device*, EffectBase<BasicEffectTraits>::DeviceResources> EffectBase<BasicEffectTraits>::deviceResourcesPool;
// Constructor.
BasicEffect::Impl::Impl(_In_ ID3D11Device* device)
: EffectBase(device),
lightingEnabled(false),
preferPerPixelLighting(false),
vertexColorEnabled(false),
textureEnabled(false),
biasedVertexNormals(false)
{
static_assert(_countof(EffectBase<BasicEffectTraits>::VertexShaderIndices) == BasicEffectTraits::ShaderPermutationCount, "array/max mismatch");
static_assert(_countof(EffectBase<BasicEffectTraits>::VertexShaderBytecode) == BasicEffectTraits::VertexShaderCount, "array/max mismatch");
static_assert(_countof(EffectBase<BasicEffectTraits>::PixelShaderBytecode) == BasicEffectTraits::PixelShaderCount, "array/max mismatch");
static_assert(_countof(EffectBase<BasicEffectTraits>::PixelShaderIndices) == BasicEffectTraits::ShaderPermutationCount, "array/max mismatch");
lights.InitializeConstants(constants.specularColorAndPower, constants.lightDirection, constants.lightDiffuseColor, constants.lightSpecularColor);
}
int BasicEffect::Impl::GetCurrentShaderPermutation() const
{
int permutation = 0;
// Use optimized shaders if fog is disabled.
if (!fog.enabled)
{
permutation += 1;
}
// Support vertex coloring?
if (vertexColorEnabled)
{
permutation += 2;
}
// Support texturing?
if (textureEnabled)
{
permutation += 4;
}
if (lightingEnabled)
{
if (preferPerPixelLighting)
{
// Do lighting in the pixel shader.
permutation += 24;
}
else if (!lights.lightEnabled[1] && !lights.lightEnabled[2])
{
// Use the only-bother-with-the-first-light shader optimization.
permutation += 16;
}
else
{
// Compute all three lights in the vertex shader.
permutation += 8;
}
if (biasedVertexNormals)
{
// Compressed normals need to be scaled and biased in the vertex shader.
permutation += 24;
}
}
return permutation;
}
// Sets our state onto the D3D device.
void BasicEffect::Impl::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
// Compute derived parameter values.
matrices.SetConstants(dirtyFlags, constants.worldViewProj);
fog.SetConstants(dirtyFlags, matrices.worldView, constants.fogVector);
lights.SetConstants(dirtyFlags, matrices, constants.world, constants.worldInverseTranspose, constants.eyePosition, constants.diffuseColor, constants.emissiveColor, lightingEnabled);
// Set the texture.
if (textureEnabled)
{
ID3D11ShaderResourceView* textures[1] = { texture.Get() };
deviceContext->PSSetShaderResources(0, 1, textures);
}
// Set shaders and constant buffers.
ApplyShaders(deviceContext, GetCurrentShaderPermutation());
}
// Public constructor.
BasicEffect::BasicEffect(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
BasicEffect::BasicEffect(BasicEffect&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
BasicEffect& BasicEffect::operator= (BasicEffect&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
BasicEffect::~BasicEffect()
{
}
// IEffect methods.
void BasicEffect::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
pImpl->Apply(deviceContext);
}
void BasicEffect::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
pImpl->GetVertexShaderBytecode(pImpl->GetCurrentShaderPermutation(), pShaderByteCode, pByteCodeLength);
}
// Camera settings.
void XM_CALLCONV BasicEffect::SetWorld(FXMMATRIX value)
{
pImpl->matrices.world = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV BasicEffect::SetView(FXMMATRIX value)
{
pImpl->matrices.view = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV BasicEffect::SetProjection(FXMMATRIX value)
{
pImpl->matrices.projection = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj;
}
void XM_CALLCONV BasicEffect::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
pImpl->matrices.world = world;
pImpl->matrices.view = view;
pImpl->matrices.projection = projection;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
// Material settings.
void XM_CALLCONV BasicEffect::SetDiffuseColor(FXMVECTOR value)
{
pImpl->lights.diffuseColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV BasicEffect::SetEmissiveColor(FXMVECTOR value)
{
pImpl->lights.emissiveColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV BasicEffect::SetSpecularColor(FXMVECTOR value)
{
// Set xyz to new value, but preserve existing w (specular power).
pImpl->constants.specularColorAndPower = XMVectorSelect(pImpl->constants.specularColorAndPower, value, g_XMSelect1110);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void BasicEffect::SetSpecularPower(float value)
{
// Set w to new value, but preserve existing xyz (specular color).
pImpl->constants.specularColorAndPower = XMVectorSetW(pImpl->constants.specularColorAndPower, value);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void BasicEffect::DisableSpecular()
{
// Set specular color to black, power to 1
// Note: Don't use a power of 0 or the shader will generate strange highlights on non-specular materials
pImpl->constants.specularColorAndPower = g_XMIdentityR3;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void BasicEffect::SetAlpha(float value)
{
pImpl->lights.alpha = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV BasicEffect::SetColorAndAlpha(FXMVECTOR value)
{
pImpl->lights.diffuseColor = value;
pImpl->lights.alpha = XMVectorGetW(value);
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
// Light settings.
void BasicEffect::SetLightingEnabled(bool value)
{
pImpl->lightingEnabled = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void BasicEffect::SetPerPixelLighting(bool value)
{
pImpl->preferPerPixelLighting = value;
}
void XM_CALLCONV BasicEffect::SetAmbientLightColor(FXMVECTOR value)
{
pImpl->lights.ambientLightColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void BasicEffect::SetLightEnabled(int whichLight, bool value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightEnabled(whichLight, value, pImpl->constants.lightDiffuseColor, pImpl->constants.lightSpecularColor);
}
void XM_CALLCONV BasicEffect::SetLightDirection(int whichLight, FXMVECTOR value)
{
EffectLights::ValidateLightIndex(whichLight);
pImpl->constants.lightDirection[whichLight] = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void XM_CALLCONV BasicEffect::SetLightDiffuseColor(int whichLight, FXMVECTOR value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightDiffuseColor(whichLight, value, pImpl->constants.lightDiffuseColor);
}
void XM_CALLCONV BasicEffect::SetLightSpecularColor(int whichLight, FXMVECTOR value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightSpecularColor(whichLight, value, pImpl->constants.lightSpecularColor);
}
void BasicEffect::EnableDefaultLighting()
{
EffectLights::EnableDefaultLighting(this);
}
// Fog settings.
void BasicEffect::SetFogEnabled(bool value)
{
pImpl->fog.enabled = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogEnable;
}
void BasicEffect::SetFogStart(float value)
{
pImpl->fog.start = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void BasicEffect::SetFogEnd(float value)
{
pImpl->fog.end = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void XM_CALLCONV BasicEffect::SetFogColor(FXMVECTOR value)
{
pImpl->constants.fogColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Vertex color setting.
void BasicEffect::SetVertexColorEnabled(bool value)
{
pImpl->vertexColorEnabled = value;
}
// Texture settings.
void BasicEffect::SetTextureEnabled(bool value)
{
pImpl->textureEnabled = value;
}
void BasicEffect::SetTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
}
// Normal compression settings.
void BasicEffect::SetBiasedVertexNormals(bool value)
{
pImpl->biasedVertexNormals = value;
}

View File

@@ -0,0 +1,596 @@
//--------------------------------------------------------------------------------------
// File: BasicPostProcess.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "PostProcess.h"
#include "AlignedNew.h"
#include "CommonStates.h"
#include "ConstantBuffer.h"
#include "DemandCreate.h"
#include "DirectXHelpers.h"
#include "SharedResourcePool.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
namespace
{
const int c_MaxSamples = 16;
const int Dirty_ConstantBuffer = 0x01;
const int Dirty_Parameters = 0x02;
// Constant buffer layout. Must match the shader!
__declspec(align(16)) struct PostProcessConstants
{
XMVECTOR sampleOffsets[c_MaxSamples];
XMVECTOR sampleWeights[c_MaxSamples];
};
static_assert((sizeof(PostProcessConstants) % 16) == 0, "CB size not padded correctly");
// 2-parameter Gaussian distribution given standard deviation (rho)
inline float GaussianDistribution(float x, float y, float rho)
{
return expf(-(x * x + y * y) / (2 * rho * rho)) / sqrtf(2 * XM_PI * rho * rho);
}
}
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOnePostProcess_VSQuad.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSCopy.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSMonochrome.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSSepia.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSDownScale2x2.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSDownScale4x4.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSGaussianBlur5x5.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSBloomExtract.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSBloomBlur.inc"
#else
#include "Shaders/Compiled/PostProcess_VSQuad.inc"
#include "Shaders/Compiled/PostProcess_PSCopy.inc"
#include "Shaders/Compiled/PostProcess_PSMonochrome.inc"
#include "Shaders/Compiled/PostProcess_PSSepia.inc"
#include "Shaders/Compiled/PostProcess_PSDownScale2x2.inc"
#include "Shaders/Compiled/PostProcess_PSDownScale4x4.inc"
#include "Shaders/Compiled/PostProcess_PSGaussianBlur5x5.inc"
#include "Shaders/Compiled/PostProcess_PSBloomExtract.inc"
#include "Shaders/Compiled/PostProcess_PSBloomBlur.inc"
#endif
}
namespace
{
struct ShaderBytecode
{
void const* code;
size_t length;
};
const ShaderBytecode pixelShaders[] =
{
{ PostProcess_PSCopy, sizeof(PostProcess_PSCopy) },
{ PostProcess_PSMonochrome, sizeof(PostProcess_PSMonochrome) },
{ PostProcess_PSSepia, sizeof(PostProcess_PSSepia) },
{ PostProcess_PSDownScale2x2, sizeof(PostProcess_PSDownScale2x2) },
{ PostProcess_PSDownScale4x4, sizeof(PostProcess_PSDownScale4x4) },
{ PostProcess_PSGaussianBlur5x5, sizeof(PostProcess_PSGaussianBlur5x5) },
{ PostProcess_PSBloomExtract, sizeof(PostProcess_PSBloomExtract) },
{ PostProcess_PSBloomBlur, sizeof(PostProcess_PSBloomBlur) },
};
static_assert(_countof(pixelShaders) == BasicPostProcess::Effect_Max, "array/max mismatch");
// Factory for lazily instantiating shaders.
class DeviceResources
{
public:
DeviceResources(_In_ ID3D11Device* device)
: stateObjects(device),
mDevice(device)
{ }
// Gets or lazily creates the vertex shader.
ID3D11VertexShader* GetVertexShader()
{
return DemandCreate(mVertexShader, mMutex, [&](ID3D11VertexShader** pResult) -> HRESULT
{
HRESULT hr = mDevice->CreateVertexShader(PostProcess_VSQuad, sizeof(PostProcess_VSQuad), nullptr, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "BasicPostProcess");
return hr;
});
}
// Gets or lazily creates the specified pixel shader.
ID3D11PixelShader* GetPixelShader(int shaderIndex)
{
assert(shaderIndex >= 0 && shaderIndex < BasicPostProcess::Effect_Max);
_Analysis_assume_(shaderIndex >= 0 && shaderIndex < BasicPostProcess::Effect_Max);
return DemandCreate(mPixelShaders[shaderIndex], mMutex, [&](ID3D11PixelShader** pResult) -> HRESULT
{
HRESULT hr = mDevice->CreatePixelShader(pixelShaders[shaderIndex].code, pixelShaders[shaderIndex].length, nullptr, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "BasicPostProcess");
return hr;
});
}
CommonStates stateObjects;
protected:
ComPtr<ID3D11Device> mDevice;
ComPtr<ID3D11VertexShader> mVertexShader;
ComPtr<ID3D11PixelShader> mPixelShaders[BasicPostProcess::Effect_Max];
std::mutex mMutex;
};
}
class BasicPostProcess::Impl : public AlignedNew<PostProcessConstants>
{
public:
Impl(_In_ ID3D11Device* device);
void Process(_In_ ID3D11DeviceContext* deviceContext, std::function<void __cdecl()>& setCustomState);
void SetConstants(bool value = true) { mUseConstants = value; mDirtyFlags = INT_MAX; }
void SetDirtyFlag() { mDirtyFlags = INT_MAX; }
// Fields.
BasicPostProcess::Effect fx;
PostProcessConstants constants;
ComPtr<ID3D11ShaderResourceView> texture;
unsigned texWidth;
unsigned texHeight;
float guassianMultiplier;
float bloomSize;
float bloomBrightness;
float bloomThreshold;
bool bloomHorizontal;
private:
bool mUseConstants;
int mDirtyFlags;
void DownScale2x2();
void DownScale4x4();
void GaussianBlur5x5(float multiplier);
void Bloom(bool horizontal, float size, float brightness);
ConstantBuffer<PostProcessConstants> mConstantBuffer;
// Per-device resources.
std::shared_ptr<DeviceResources> mDeviceResources;
static SharedResourcePool<ID3D11Device*, DeviceResources> deviceResourcesPool;
};
// Global pool of per-device BasicPostProcess resources.
SharedResourcePool<ID3D11Device*, DeviceResources> BasicPostProcess::Impl::deviceResourcesPool;
// Constructor.
BasicPostProcess::Impl::Impl(_In_ ID3D11Device* device)
: fx(BasicPostProcess::Copy),
texWidth(0),
texHeight(0),
guassianMultiplier(1.f),
bloomSize(1.f),
bloomBrightness(1.f),
bloomThreshold(0.25f),
bloomHorizontal(true),
mUseConstants(false),
mDirtyFlags(INT_MAX),
mConstantBuffer(device),
mDeviceResources(deviceResourcesPool.DemandCreate(device)),
constants{}
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::exception("BasicPostProcess requires Feature Level 10.0 or later");
}
}
// Sets our state onto the D3D device.
void BasicPostProcess::Impl::Process(_In_ ID3D11DeviceContext* deviceContext, std::function<void __cdecl()>& setCustomState)
{
// Set the texture.
ID3D11ShaderResourceView* textures[1] = { texture.Get() };
deviceContext->PSSetShaderResources(0, 1, textures);
auto sampler = mDeviceResources->stateObjects.LinearClamp();
deviceContext->PSSetSamplers(0, 1, &sampler);
// Set state objects.
deviceContext->OMSetBlendState(mDeviceResources->stateObjects.Opaque(), nullptr, 0xffffffff);
deviceContext->OMSetDepthStencilState(mDeviceResources->stateObjects.DepthNone(), 0);
deviceContext->RSSetState(mDeviceResources->stateObjects.CullNone());
// Set shaders.
auto vertexShader = mDeviceResources->GetVertexShader();
auto pixelShader = mDeviceResources->GetPixelShader(fx);
deviceContext->VSSetShader(vertexShader, nullptr, 0);
deviceContext->PSSetShader(pixelShader, nullptr, 0);
// Set constants.
if (mUseConstants)
{
if (mDirtyFlags & Dirty_Parameters)
{
mDirtyFlags &= ~Dirty_Parameters;
mDirtyFlags |= Dirty_ConstantBuffer;
switch (fx)
{
case DownScale_2x2:
DownScale2x2();
break;
case DownScale_4x4:
DownScale4x4();
break;
case GaussianBlur_5x5:
GaussianBlur5x5(guassianMultiplier);
break;
case BloomExtract:
constants.sampleWeights[0] = XMVectorReplicate(bloomThreshold);
break;
case BloomBlur:
Bloom(bloomHorizontal, bloomSize, bloomBrightness);
break;
default:
break;
}
}
#if defined(_XBOX_ONE) && defined(_TITLE)
void *grfxMemory;
mConstantBuffer.SetData(deviceContext, constants, &grfxMemory);
Microsoft::WRL::ComPtr<ID3D11DeviceContextX> deviceContextX;
ThrowIfFailed(deviceContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceContextX.GetAddressOf())));
auto buffer = mConstantBuffer.GetBuffer();
deviceContextX->PSSetPlacementConstantBuffer(0, buffer, grfxMemory);
#else
if (mDirtyFlags & Dirty_ConstantBuffer)
{
mDirtyFlags &= ~Dirty_ConstantBuffer;
mConstantBuffer.SetData(deviceContext, constants);
}
// Set the constant buffer.
auto buffer = mConstantBuffer.GetBuffer();
deviceContext->PSSetConstantBuffers(0, 1, &buffer);
#endif
}
if (setCustomState)
{
setCustomState();
}
// Draw quad.
deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
deviceContext->Draw(4, 0);
}
void BasicPostProcess::Impl::DownScale2x2()
{
mUseConstants = true;
if ( !texWidth || !texHeight)
{
throw std::exception("Call SetSourceTexture before setting post-process effect");
}
float tu = 1.0f / float(texWidth);
float tv = 1.0f / float(texHeight);
// Sample from the 4 surrounding points. Since the center point will be in the exact
// center of 4 texels, a 0.5f offset is needed to specify a texel center.
auto ptr = reinterpret_cast<XMFLOAT4*>(constants.sampleOffsets);
for (int y = 0; y < 2; ++y)
{
for (int x = 0; x < 2; ++x)
{
ptr->x = (float(x) - 0.5f) * tu;
ptr->y = (float(y) - 0.5f) * tv;
++ptr;
}
}
}
void BasicPostProcess::Impl::DownScale4x4()
{
mUseConstants = true;
if (!texWidth || !texHeight)
{
throw std::exception("Call SetSourceTexture before setting post-process effect");
}
float tu = 1.0f / float(texWidth);
float tv = 1.0f / float(texHeight);
// Sample from the 16 surrounding points. Since the center point will be in the
// exact center of 16 texels, a 1.5f offset is needed to specify a texel center.
auto ptr = reinterpret_cast<XMFLOAT4*>(constants.sampleOffsets);
for (int y = 0; y < 4; ++y)
{
for (int x = 0; x < 4; ++x)
{
ptr->x = (float(x) - 1.5f) * tu;
ptr->y = (float(y) - 1.5f) * tv;
++ptr;
}
}
}
void BasicPostProcess::Impl::GaussianBlur5x5(float multiplier)
{
mUseConstants = true;
if (!texWidth || !texHeight)
{
throw std::exception("Call SetSourceTexture before setting post-process effect");
}
float tu = 1.0f / float(texWidth);
float tv = 1.0f / float(texHeight);
float totalWeight = 0.0f;
size_t index = 0;
auto offsets = reinterpret_cast<XMFLOAT4*>(constants.sampleOffsets);
auto weights = constants.sampleWeights;
for (int x = -2; x <= 2; ++x)
{
for (int y = -2; y <= 2; ++y)
{
// Exclude pixels with a block distance greater than 2. This will
// create a kernel which approximates a 5x5 kernel using only 13
// sample points instead of 25; this is necessary since 2.0 shaders
// only support 16 texture grabs.
if (fabs(float(x)) + fabs(float(y)) > 2.0f)
continue;
// Get the unscaled Gaussian intensity for this offset
offsets[index].x = float(x) * tu;
offsets[index].y = float(y) * tv;
offsets[index].z = 0.0f;
offsets[index].w = 0.0f;
float g = GaussianDistribution(float(x), float(y), 1.0f);
weights[index] = XMVectorReplicate(g);
totalWeight += XMVectorGetX(weights[index]);
++index;
}
}
// Divide the current weight by the total weight of all the samples; Gaussian
// blur kernels add to 1.0f to ensure that the intensity of the image isn't
// changed when the blur occurs. An optional multiplier variable is used to
// add or remove image intensity during the blur.
for (size_t i = 0; i < index; ++i)
{
weights[i] /= totalWeight;
weights[i] *= multiplier;
}
}
void BasicPostProcess::Impl::Bloom(bool horizontal, float size, float brightness)
{
mUseConstants = true;
if (!texWidth || !texHeight)
{
throw std::exception("Call SetSourceTexture before setting post-process effect");
}
float tu = 0.f;
float tv = 0.f;
if (horizontal)
{
tu = 1.f / float(texWidth);
}
else
{
tv = 1.f / float(texHeight);
}
auto weights = reinterpret_cast<XMFLOAT4*>(constants.sampleWeights);
auto offsets = reinterpret_cast<XMFLOAT4*>(constants.sampleOffsets);
// Fill the center texel
float weight = brightness * GaussianDistribution(0, 0, size);
weights[0] = XMFLOAT4(weight, weight, weight, 1.0f);
offsets[0].x = offsets[0].y = offsets[0].z = offsets[0].w = 0.f;
// Fill the first half
for (int i = 1; i < 8; ++i)
{
// Get the Gaussian intensity for this offset
weight = brightness * GaussianDistribution(float(i), 0, size);
weights[i] = XMFLOAT4(weight, weight, weight, 1.0f);
offsets[i] = XMFLOAT4(float(i) * tu, float(i) * tv, 0.f, 0.f);
}
// Mirror to the second half
for (int i = 8; i < 15; i++)
{
weights[i] = weights[i - 7];
offsets[i] = XMFLOAT4(-offsets[i - 7].x, -offsets[i - 7].y, 0.f, 0.f);
}
}
// Public constructor.
BasicPostProcess::BasicPostProcess(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
BasicPostProcess::BasicPostProcess(BasicPostProcess&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
BasicPostProcess& BasicPostProcess::operator= (BasicPostProcess&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
BasicPostProcess::~BasicPostProcess()
{
}
// IPostProcess methods.
void BasicPostProcess::Process(_In_ ID3D11DeviceContext* deviceContext, _In_opt_ std::function<void __cdecl()> setCustomState)
{
pImpl->Process(deviceContext, setCustomState);
}
// Shader control.
void BasicPostProcess::SetEffect(Effect fx)
{
if (fx < 0 || fx >= Effect_Max)
throw std::out_of_range("Effect not defined");
pImpl->fx = fx;
switch (fx)
{
case Copy:
case Monochrome:
case Sepia:
// These shaders don't use the constant buffer
pImpl->SetConstants(false);
break;
default:
pImpl->SetConstants(true);
break;
}
}
// Properties
void BasicPostProcess::SetSourceTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
if (value)
{
ComPtr<ID3D11Resource> res;
value->GetResource(res.GetAddressOf());
D3D11_RESOURCE_DIMENSION resType = D3D11_RESOURCE_DIMENSION_UNKNOWN;
res->GetType(&resType);
switch (resType)
{
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
{
ComPtr<ID3D11Texture1D> tex;
ThrowIfFailed(res.As(&tex));
D3D11_TEXTURE1D_DESC desc = {};
tex->GetDesc(&desc);
pImpl->texWidth = desc.Width;
pImpl->texHeight = 1;
break;
}
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
{
ComPtr<ID3D11Texture2D> tex;
ThrowIfFailed(res.As(&tex));
D3D11_TEXTURE2D_DESC desc = {};
tex->GetDesc(&desc);
pImpl->texWidth = desc.Width;
pImpl->texHeight = desc.Height;
break;
}
default:
throw std::exception("Unsupported texture type");
}
}
else
{
pImpl->texWidth = pImpl->texHeight = 0;
}
}
void BasicPostProcess::SetGaussianParameter(float multiplier)
{
pImpl->guassianMultiplier = multiplier;
pImpl->SetDirtyFlag();
}
void BasicPostProcess::SetBloomExtractParameter(float threshold)
{
pImpl->bloomThreshold = threshold;
pImpl->SetDirtyFlag();
}
void BasicPostProcess::SetBloomBlurParameters(bool horizontal, float size, float brightness)
{
pImpl->bloomSize = size;
pImpl->bloomBrightness = brightness;
pImpl->bloomHorizontal = horizontal;
pImpl->SetDirtyFlag();
}

169
DirectXTK/Src/Bezier.h Normal file
View File

@@ -0,0 +1,169 @@
//--------------------------------------------------------------------------------------
// File: Bezier.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <array>
#include <algorithm>
#include <DirectXMath.h>
namespace Bezier
{
// Performs a cubic bezier interpolation between four control points,
// returning the value at the specified time (t ranges 0 to 1).
// This template implementation can be used to interpolate XMVECTOR,
// float, or any other types that define suitable * and + operators.
template<typename T>
T CubicInterpolate(T const& p1, T const& p2, T const& p3, T const& p4, float t)
{
using DirectX::operator*;
using DirectX::operator+;
return p1 * (1 - t) * (1 - t) * (1 - t) +
p2 * 3 * t * (1 - t) * (1 - t) +
p3 * 3 * t * t * (1 - t) +
p4 * t * t * t;
}
// Computes the tangent of a cubic bezier curve at the specified time.
// Template supports XMVECTOR, float, or any other types with * and + operators.
template<typename T>
T CubicTangent(T const& p1, T const& p2, T const& p3, T const& p4, float t)
{
using DirectX::operator*;
using DirectX::operator+;
return p1 * (-1 + 2 * t - t * t) +
p2 * (1 - 4 * t + 3 * t * t) +
p3 * (2 * t - 3 * t * t) +
p4 * (t * t);
}
// Creates vertices for a patch that is tessellated at the specified level.
// Calls the specified outputVertex function for each generated vertex,
// passing the position, normal, and texture coordinate as parameters.
template<typename TOutputFunc>
void CreatePatchVertices(_In_reads_(16) DirectX::XMVECTOR patch[16], size_t tessellation, bool isMirrored, TOutputFunc outputVertex)
{
using namespace DirectX;
for (size_t i = 0; i <= tessellation; i++)
{
float u = (float)i / tessellation;
for (size_t j = 0; j <= tessellation; j++)
{
float v = (float)j / tessellation;
// Perform four horizontal bezier interpolations
// between the control points of this patch.
XMVECTOR p1 = CubicInterpolate(patch[0], patch[1], patch[2], patch[3], u);
XMVECTOR p2 = CubicInterpolate(patch[4], patch[5], patch[6], patch[7], u);
XMVECTOR p3 = CubicInterpolate(patch[8], patch[9], patch[10], patch[11], u);
XMVECTOR p4 = CubicInterpolate(patch[12], patch[13], patch[14], patch[15], u);
// Perform a vertical interpolation between the results of the
// previous horizontal interpolations, to compute the position.
XMVECTOR position = CubicInterpolate(p1, p2, p3, p4, v);
// Perform another four bezier interpolations between the control
// points, but this time vertically rather than horizontally.
XMVECTOR q1 = CubicInterpolate(patch[0], patch[4], patch[8], patch[12], v);
XMVECTOR q2 = CubicInterpolate(patch[1], patch[5], patch[9], patch[13], v);
XMVECTOR q3 = CubicInterpolate(patch[2], patch[6], patch[10], patch[14], v);
XMVECTOR q4 = CubicInterpolate(patch[3], patch[7], patch[11], patch[15], v);
// Compute vertical and horizontal tangent vectors.
XMVECTOR tangent1 = CubicTangent(p1, p2, p3, p4, v);
XMVECTOR tangent2 = CubicTangent(q1, q2, q3, q4, u);
// Cross the two tangent vectors to compute the normal.
XMVECTOR normal = XMVector3Cross(tangent1, tangent2);
if (!XMVector3NearEqual(normal, XMVectorZero(), g_XMEpsilon))
{
normal = XMVector3Normalize(normal);
// If this patch is mirrored, we must invert the normal.
if (isMirrored)
{
normal = -normal;
}
}
else
{
// In a tidy and well constructed bezier patch, the preceding
// normal computation will always work. But the classic teapot
// model is not tidy or well constructed! At the top and bottom
// of the teapot, it contains degenerate geometry where a patch
// has several control points in the same place, which causes
// the tangent computation to fail and produce a zero normal.
// We 'fix' these cases by just hard-coding a normal that points
// either straight up or straight down, depending on whether we
// are on the top or bottom of the teapot. This is not a robust
// solution for all possible degenerate bezier patches, but hey,
// it's good enough to make the teapot work correctly!
normal = XMVectorSelect(g_XMIdentityR1, g_XMNegIdentityR1, XMVectorLess(position, XMVectorZero()));
}
// Compute the texture coordinate.
float mirroredU = isMirrored ? 1 - u : u;
XMVECTOR textureCoordinate = XMVectorSet(mirroredU, v, 0, 0);
// Output this vertex.
outputVertex(position, normal, textureCoordinate);
}
}
}
// Creates indices for a patch that is tessellated at the specified level.
// Calls the specified outputIndex function for each generated index value.
template<typename TOutputFunc>
void CreatePatchIndices(size_t tessellation, bool isMirrored, TOutputFunc outputIndex)
{
size_t stride = tessellation + 1;
for (size_t i = 0; i < tessellation; i++)
{
for (size_t j = 0; j < tessellation; j++)
{
// Make a list of six index values (two triangles).
std::array<size_t, 6> indices =
{
i * stride + j,
(i + 1) * stride + j,
(i + 1) * stride + j + 1,
i * stride + j,
(i + 1) * stride + j + 1,
i * stride + j + 1,
};
// If this patch is mirrored, reverse indices to fix the winding order.
if (isMirrored)
{
std::reverse(indices.begin(), indices.end());
}
// Output these index values.
std::for_each(indices.begin(), indices.end(), outputIndex);
}
}
}
}

View File

@@ -0,0 +1,92 @@
//--------------------------------------------------------------------------------------
// File: BinaryReader.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "BinaryReader.h"
using namespace DirectX;
// Constructor reads from the filesystem.
BinaryReader::BinaryReader(_In_z_ wchar_t const* fileName) :
mPos(nullptr),
mEnd(nullptr)
{
size_t dataSize;
HRESULT hr = ReadEntireFile(fileName, mOwnedData, &dataSize);
if ( FAILED(hr) )
{
DebugTrace( "BinaryReader failed (%08X) to load '%ls'\n", hr, fileName );
throw std::exception( "BinaryReader" );
}
mPos = mOwnedData.get();
mEnd = mOwnedData.get() + dataSize;
}
// Constructor reads from an existing memory buffer.
BinaryReader::BinaryReader(_In_reads_bytes_(dataSize) uint8_t const* dataBlob, size_t dataSize) :
mPos(dataBlob),
mEnd(dataBlob + dataSize)
{
}
// Reads from the filesystem into memory.
HRESULT BinaryReader::ReadEntireFile(_In_z_ wchar_t const* fileName, _Inout_ std::unique_ptr<uint8_t[]>& data, _Out_ size_t* dataSize)
{
// Open the file.
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(fileName, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(fileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr)));
#endif
if (!hFile)
return HRESULT_FROM_WIN32(GetLastError());
// Get the file size.
FILE_STANDARD_INFO fileInfo;
if (!GetFileInformationByHandleEx(hFile.get(), FileStandardInfo, &fileInfo, sizeof(fileInfo)))
{
return HRESULT_FROM_WIN32(GetLastError());
}
// File is too big for 32-bit allocation, so reject read.
if (fileInfo.EndOfFile.HighPart > 0)
return E_FAIL;
// Create enough space for the file data.
data.reset(new uint8_t[fileInfo.EndOfFile.LowPart]);
if (!data)
return E_OUTOFMEMORY;
// Read the data in.
DWORD bytesRead = 0;
if (!ReadFile(hFile.get(), data.get(), fileInfo.EndOfFile.LowPart, &bytesRead, nullptr))
{
return HRESULT_FROM_WIN32(GetLastError());
}
if (bytesRead < fileInfo.EndOfFile.LowPart)
return E_FAIL;
*dataSize = bytesRead;
return S_OK;
}

View File

@@ -0,0 +1,75 @@
//--------------------------------------------------------------------------------------
// File: BinaryReader.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <memory>
#include <exception>
#include <stdexcept>
#include <type_traits>
#include "PlatformHelpers.h"
namespace DirectX
{
// Helper for reading binary data, either from the filesystem a memory buffer.
class BinaryReader
{
public:
explicit BinaryReader(_In_z_ wchar_t const* fileName);
BinaryReader(_In_reads_bytes_(dataSize) uint8_t const* dataBlob, size_t dataSize);
BinaryReader(BinaryReader const&) = delete;
BinaryReader& operator= (BinaryReader const&) = delete;
// Reads a single value.
template<typename T> T const& Read()
{
return *ReadArray<T>(1);
}
// Reads an array of values.
template<typename T> T const* ReadArray(size_t elementCount)
{
static_assert(std::is_pod<T>::value, "Can only read plain-old-data types");
uint8_t const* newPos = mPos + sizeof(T) * elementCount;
if (newPos < mPos)
throw std::overflow_error("ReadArray");
if (newPos > mEnd)
throw std::exception("End of file");
auto result = reinterpret_cast<T const*>(mPos);
mPos = newPos;
return result;
}
// Lower level helper reads directly from the filesystem into memory.
static HRESULT ReadEntireFile(_In_z_ wchar_t const* fileName, _Inout_ std::unique_ptr<uint8_t[]>& data, _Out_ size_t* dataSize);
private:
// The data currently being read.
uint8_t const* mPos;
uint8_t const* mEnd;
std::unique_ptr<uint8_t[]> mOwnedData;
};
}

View File

@@ -0,0 +1,365 @@
//--------------------------------------------------------------------------------------
// File: CommonStates.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "CommonStates.h"
#include "DemandCreate.h"
#include "DirectXHelpers.h"
#include "SharedResourcePool.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
// Internal state object implementation class. Only one of these helpers is allocated
// per D3D device, even if there are multiple public facing CommonStates instances.
class CommonStates::Impl
{
public:
Impl(_In_ ID3D11Device* device)
: device(device)
{ }
HRESULT CreateBlendState(D3D11_BLEND srcBlend, D3D11_BLEND destBlend, _Out_ ID3D11BlendState** pResult);
HRESULT CreateDepthStencilState(bool enable, bool writeEnable, _Out_ ID3D11DepthStencilState** pResult);
HRESULT CreateRasterizerState(D3D11_CULL_MODE cullMode, D3D11_FILL_MODE fillMode, _Out_ ID3D11RasterizerState** pResult);
HRESULT CreateSamplerState(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressMode, _Out_ ID3D11SamplerState** pResult);
ComPtr<ID3D11Device> device;
ComPtr<ID3D11BlendState> opaque;
ComPtr<ID3D11BlendState> alphaBlend;
ComPtr<ID3D11BlendState> additive;
ComPtr<ID3D11BlendState> nonPremultiplied;
ComPtr<ID3D11DepthStencilState> depthNone;
ComPtr<ID3D11DepthStencilState> depthDefault;
ComPtr<ID3D11DepthStencilState> depthRead;
ComPtr<ID3D11RasterizerState> cullNone;
ComPtr<ID3D11RasterizerState> cullClockwise;
ComPtr<ID3D11RasterizerState> cullCounterClockwise;
ComPtr<ID3D11RasterizerState> wireframe;
ComPtr<ID3D11SamplerState> pointWrap;
ComPtr<ID3D11SamplerState> pointClamp;
ComPtr<ID3D11SamplerState> linearWrap;
ComPtr<ID3D11SamplerState> linearClamp;
ComPtr<ID3D11SamplerState> anisotropicWrap;
ComPtr<ID3D11SamplerState> anisotropicClamp;
std::mutex mutex;
static SharedResourcePool<ID3D11Device*, Impl> instancePool;
};
// Global instance pool.
SharedResourcePool<ID3D11Device*, CommonStates::Impl> CommonStates::Impl::instancePool;
// Helper for creating blend state objects.
HRESULT CommonStates::Impl::CreateBlendState(D3D11_BLEND srcBlend, D3D11_BLEND destBlend, _Out_ ID3D11BlendState** pResult)
{
D3D11_BLEND_DESC desc = {};
desc.RenderTarget[0].BlendEnable = (srcBlend != D3D11_BLEND_ONE) ||
(destBlend != D3D11_BLEND_ZERO);
desc.RenderTarget[0].SrcBlend = desc.RenderTarget[0].SrcBlendAlpha = srcBlend;
desc.RenderTarget[0].DestBlend = desc.RenderTarget[0].DestBlendAlpha = destBlend;
desc.RenderTarget[0].BlendOp = desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
HRESULT hr = device->CreateBlendState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
// Helper for creating depth stencil state objects.
HRESULT CommonStates::Impl::CreateDepthStencilState(bool enable, bool writeEnable, _Out_ ID3D11DepthStencilState** pResult)
{
D3D11_DEPTH_STENCIL_DESC desc = {};
desc.DepthEnable = enable ? TRUE : FALSE;
desc.DepthWriteMask = writeEnable ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
desc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
desc.StencilEnable = FALSE;
desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK;
desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK;
desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
desc.BackFace = desc.FrontFace;
HRESULT hr = device->CreateDepthStencilState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
// Helper for creating rasterizer state objects.
HRESULT CommonStates::Impl::CreateRasterizerState(D3D11_CULL_MODE cullMode, D3D11_FILL_MODE fillMode, _Out_ ID3D11RasterizerState** pResult)
{
D3D11_RASTERIZER_DESC desc = {};
desc.CullMode = cullMode;
desc.FillMode = fillMode;
desc.DepthClipEnable = TRUE;
desc.MultisampleEnable = TRUE;
HRESULT hr = device->CreateRasterizerState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
// Helper for creating sampler state objects.
HRESULT CommonStates::Impl::CreateSamplerState(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressMode, _Out_ ID3D11SamplerState** pResult)
{
D3D11_SAMPLER_DESC desc = {};
desc.Filter = filter;
desc.AddressU = addressMode;
desc.AddressV = addressMode;
desc.AddressW = addressMode;
desc.MaxAnisotropy = (device->GetFeatureLevel() > D3D_FEATURE_LEVEL_9_1) ? D3D11_MAX_MAXANISOTROPY : 2;
desc.MaxLOD = FLT_MAX;
desc.ComparisonFunc = D3D11_COMPARISON_NEVER;
HRESULT hr = device->CreateSamplerState(&desc, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:CommonStates");
return hr;
}
//--------------------------------------------------------------------------------------
// CommonStates
//--------------------------------------------------------------------------------------
// Public constructor.
CommonStates::CommonStates(_In_ ID3D11Device* device)
: pImpl(Impl::instancePool.DemandCreate(device))
{
}
// Move constructor.
CommonStates::CommonStates(CommonStates&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
CommonStates& CommonStates::operator= (CommonStates&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
CommonStates::~CommonStates()
{
}
//--------------------------------------------------------------------------------------
// Blend states
//--------------------------------------------------------------------------------------
ID3D11BlendState* CommonStates::Opaque() const
{
return DemandCreate(pImpl->opaque, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_ONE, D3D11_BLEND_ZERO, pResult);
});
}
ID3D11BlendState* CommonStates::AlphaBlend() const
{
return DemandCreate(pImpl->alphaBlend, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_ONE, D3D11_BLEND_INV_SRC_ALPHA, pResult);
});
}
ID3D11BlendState* CommonStates::Additive() const
{
return DemandCreate(pImpl->additive, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_SRC_ALPHA, D3D11_BLEND_ONE, pResult);
});
}
ID3D11BlendState* CommonStates::NonPremultiplied() const
{
return DemandCreate(pImpl->nonPremultiplied, pImpl->mutex, [&](ID3D11BlendState** pResult)
{
return pImpl->CreateBlendState(D3D11_BLEND_SRC_ALPHA, D3D11_BLEND_INV_SRC_ALPHA, pResult);
});
}
//--------------------------------------------------------------------------------------
// Depth stencil states
//--------------------------------------------------------------------------------------
ID3D11DepthStencilState* CommonStates::DepthNone() const
{
return DemandCreate(pImpl->depthNone, pImpl->mutex, [&](ID3D11DepthStencilState** pResult)
{
return pImpl->CreateDepthStencilState(false, false, pResult);
});
}
ID3D11DepthStencilState* CommonStates::DepthDefault() const
{
return DemandCreate(pImpl->depthDefault, pImpl->mutex, [&](ID3D11DepthStencilState** pResult)
{
return pImpl->CreateDepthStencilState(true, true, pResult);
});
}
ID3D11DepthStencilState* CommonStates::DepthRead() const
{
return DemandCreate(pImpl->depthRead, pImpl->mutex, [&](ID3D11DepthStencilState** pResult)
{
return pImpl->CreateDepthStencilState(true, false, pResult);
});
}
//--------------------------------------------------------------------------------------
// Rasterizer states
//--------------------------------------------------------------------------------------
ID3D11RasterizerState* CommonStates::CullNone() const
{
return DemandCreate(pImpl->cullNone, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_NONE, D3D11_FILL_SOLID, pResult);
});
}
ID3D11RasterizerState* CommonStates::CullClockwise() const
{
return DemandCreate(pImpl->cullClockwise, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_FRONT, D3D11_FILL_SOLID, pResult);
});
}
ID3D11RasterizerState* CommonStates::CullCounterClockwise() const
{
return DemandCreate(pImpl->cullCounterClockwise, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_BACK, D3D11_FILL_SOLID, pResult);
});
}
ID3D11RasterizerState* CommonStates::Wireframe() const
{
return DemandCreate(pImpl->wireframe, pImpl->mutex, [&](ID3D11RasterizerState** pResult)
{
return pImpl->CreateRasterizerState(D3D11_CULL_NONE, D3D11_FILL_WIREFRAME, pResult);
});
}
//--------------------------------------------------------------------------------------
// Sampler states
//--------------------------------------------------------------------------------------
ID3D11SamplerState* CommonStates::PointWrap() const
{
return DemandCreate(pImpl->pointWrap, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_WRAP, pResult);
});
}
ID3D11SamplerState* CommonStates::PointClamp() const
{
return DemandCreate(pImpl->pointClamp, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_CLAMP, pResult);
});
}
ID3D11SamplerState* CommonStates::LinearWrap() const
{
return DemandCreate(pImpl->linearWrap, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_WRAP, pResult);
});
}
ID3D11SamplerState* CommonStates::LinearClamp() const
{
return DemandCreate(pImpl->linearClamp, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_CLAMP, pResult);
});
}
ID3D11SamplerState* CommonStates::AnisotropicWrap() const
{
return DemandCreate(pImpl->anisotropicWrap, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_ANISOTROPIC, D3D11_TEXTURE_ADDRESS_WRAP, pResult);
});
}
ID3D11SamplerState* CommonStates::AnisotropicClamp() const
{
return DemandCreate(pImpl->anisotropicClamp, pImpl->mutex, [&](ID3D11SamplerState** pResult)
{
return pImpl->CreateSamplerState(D3D11_FILTER_ANISOTROPIC, D3D11_TEXTURE_ADDRESS_CLAMP, pResult);
});
}

View File

@@ -0,0 +1,115 @@
//--------------------------------------------------------------------------------------
// File: ConstantBuffer.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include "DirectXHelpers.h"
#include "GraphicsMemory.h"
#include "PlatformHelpers.h"
namespace DirectX
{
// Strongly typed wrapper around a D3D constant buffer.
template<typename T>
class ConstantBuffer
{
public:
// Constructor.
ConstantBuffer() = default;
explicit ConstantBuffer(_In_ ID3D11Device* device)
{
Create( device );
}
ConstantBuffer(ConstantBuffer const&) = delete;
ConstantBuffer& operator= (ConstantBuffer const&) = delete;
#if defined(_XBOX_ONE) && defined(_TITLE)
void Create(_In_ ID3D11Device* device)
{
D3D11_BUFFER_DESC desc = {};
desc.ByteWidth = sizeof(T);
desc.Usage = D3D11_USAGE_DEFAULT;
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
Microsoft::WRL::ComPtr<ID3D11DeviceX> deviceX;
ThrowIfFailed(device->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceX.GetAddressOf())));
ThrowIfFailed(deviceX->CreatePlacementBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf()));
SetDebugObjectName(mConstantBuffer.Get(), L"DirectXTK");
}
// Writes new data into the constant buffer.
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value, void** grfxMemory)
{
assert( grfxMemory != 0 );
void* ptr = GraphicsMemory::Get().Allocate( deviceContext, sizeof(T), 64 );
assert( ptr != 0 );
*(T*)ptr = value;
*grfxMemory = ptr;
}
#else
void Create(_In_ ID3D11Device* device)
{
D3D11_BUFFER_DESC desc = {};
desc.ByteWidth = sizeof(T);
desc.Usage = D3D11_USAGE_DYNAMIC;
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
ThrowIfFailed(
device->CreateBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf() )
);
SetDebugObjectName(mConstantBuffer.Get(), "DirectXTK");
}
// Writes new data into the constant buffer.
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value)
{
assert( mConstantBuffer.Get() != 0 );
D3D11_MAPPED_SUBRESOURCE mappedResource;
ThrowIfFailed(
deviceContext->Map(mConstantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)
);
*(T*)mappedResource.pData = value;
deviceContext->Unmap(mConstantBuffer.Get(), 0);
}
#endif
// Looks up the underlying D3D constant buffer.
ID3D11Buffer* GetBuffer()
{
return mConstantBuffer.Get();
}
private:
// The underlying D3D object.
Microsoft::WRL::ComPtr<ID3D11Buffer> mConstantBuffer;
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,941 @@
//--------------------------------------------------------------------------------------
// File: DGSLEffect.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
#include "DemandCreate.h"
//
// Based on the Visual Studio 3D Starter Kit
//
// http://aka.ms/vs3dkit
//
namespace DirectX
{
namespace EffectDirtyFlags
{
const int ConstantBufferMaterial = 0x10000;
const int ConstantBufferLight = 0x20000;
const int ConstantBufferObject = 0x40000;
const int ConstantBufferMisc = 0x80000;
const int ConstantBufferBones = 0x100000;
}
}
using namespace DirectX;
using Microsoft::WRL::ComPtr;
// Constant buffer layout. Must match the shader!
#pragma pack(push,1)
// Slot 0
struct MaterialConstants
{
XMVECTOR Ambient;
XMVECTOR Diffuse;
XMVECTOR Specular;
XMVECTOR Emissive;
float SpecularPower;
float Padding0;
float Padding1;
float Padding2;
};
// Slot 1
struct LightConstants
{
XMVECTOR Ambient;
XMVECTOR LightColor[DGSLEffect::MaxDirectionalLights];
XMVECTOR LightAttenuation[DGSLEffect::MaxDirectionalLights];
XMVECTOR LightDirection[DGSLEffect::MaxDirectionalLights];
XMVECTOR LightSpecularIntensity[DGSLEffect::MaxDirectionalLights];
UINT IsPointLight[DGSLEffect::MaxDirectionalLights];
UINT ActiveLights;
float Padding0;
float Padding1;
float Padding2;
};
// Note - DGSL does not appear to make use of LightAttenuation or IsPointLight. Not sure if it uses ActiveLights either.
// Slot 2
struct ObjectConstants
{
XMMATRIX LocalToWorld4x4;
XMMATRIX LocalToProjected4x4;
XMMATRIX WorldToLocal4x4;
XMMATRIX WorldToView4x4;
XMMATRIX UvTransform4x4;
XMVECTOR EyePosition;
};
// Slot 3
struct MiscConstants
{
float ViewportWidth;
float ViewportHeight;
float Time;
float Padding1;
};
// Slot 4
struct BoneConstants
{
XMVECTOR Bones[DGSLEffect::MaxBones][3];
};
#pragma pack(pop)
static_assert( ( sizeof(MaterialConstants) % 16 ) == 0, "CB size not padded correctly" );
static_assert( ( sizeof(LightConstants) % 16 ) == 0, "CB size not padded correctly" );
static_assert( ( sizeof(ObjectConstants) % 16 ) == 0, "CB size not padded correctly" );
static_assert( ( sizeof(MiscConstants) % 16 ) == 0, "CB size not padded correctly" );
static_assert( ( sizeof(BoneConstants) % 16 ) == 0, "CB size not padded correctly" );
__declspec(align(16)) struct DGSLEffectConstants
{
MaterialConstants material;
LightConstants light;
ObjectConstants object;
MiscConstants misc;
BoneConstants bones;
};
struct DGSLEffectTraits
{
static const int VertexShaderCount = 8;
static const int PixelShaderCount = 12;
static const ShaderBytecode VertexShaderBytecode[VertexShaderCount];
static const ShaderBytecode PixelShaderBytecode[PixelShaderCount];
};
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
// VS
#include "Shaders/Compiled/XboxOneDGSLEffect_main.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_mainVc.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_main1Bones.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_main1BonesVc.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_main2Bones.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_main2BonesVc.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_main4Bones.inc"
#include "Shaders/Compiled/XboxOneDGSLEffect_main4BonesVc.inc"
// PS
#include "Shaders/Compiled/XboxOneDGSLUnlit_main.inc"
#include "Shaders/Compiled/XboxOneDGSLLambert_main.inc"
#include "Shaders/Compiled/XboxOneDGSLPhong_main.inc"
#include "Shaders/Compiled/XboxOneDGSLUnlit_mainTk.inc"
#include "Shaders/Compiled/XboxOneDGSLLambert_mainTk.inc"
#include "Shaders/Compiled/XboxOneDGSLPhong_mainTk.inc"
#include "Shaders/Compiled/XboxOneDGSLUnlit_mainTx.inc"
#include "Shaders/Compiled/XboxOneDGSLLambert_mainTx.inc"
#include "Shaders/Compiled/XboxOneDGSLPhong_mainTx.inc"
#include "Shaders/Compiled/XboxOneDGSLUnlit_mainTxTk.inc"
#include "Shaders/Compiled/XboxOneDGSLLambert_mainTxTk.inc"
#include "Shaders/Compiled/XboxOneDGSLPhong_mainTxTk.inc"
#else
// VS
#include "Shaders/Compiled/DGSLEffect_main.inc"
#include "Shaders/Compiled/DGSLEffect_mainVc.inc"
#include "Shaders/Compiled/DGSLEffect_main1Bones.inc"
#include "Shaders/Compiled/DGSLEffect_main1BonesVc.inc"
#include "Shaders/Compiled/DGSLEffect_main2Bones.inc"
#include "Shaders/Compiled/DGSLEffect_main2BonesVc.inc"
#include "Shaders/Compiled/DGSLEffect_main4Bones.inc"
#include "Shaders/Compiled/DGSLEffect_main4BonesVc.inc"
// PS
#include "Shaders/Compiled/DGSLUnlit_main.inc"
#include "Shaders/Compiled/DGSLLambert_main.inc"
#include "Shaders/Compiled/DGSLPhong_main.inc"
#include "Shaders/Compiled/DGSLUnlit_mainTk.inc"
#include "Shaders/Compiled/DGSLLambert_mainTk.inc"
#include "Shaders/Compiled/DGSLPhong_mainTk.inc"
#include "Shaders/Compiled/DGSLUnlit_mainTx.inc"
#include "Shaders/Compiled/DGSLLambert_mainTx.inc"
#include "Shaders/Compiled/DGSLPhong_mainTx.inc"
#include "Shaders/Compiled/DGSLUnlit_mainTxTk.inc"
#include "Shaders/Compiled/DGSLLambert_mainTxTk.inc"
#include "Shaders/Compiled/DGSLPhong_mainTxTk.inc"
#endif
}
const ShaderBytecode DGSLEffectTraits::VertexShaderBytecode[] =
{
{ DGSLEffect_main, sizeof(DGSLEffect_main) },
{ DGSLEffect_mainVc, sizeof(DGSLEffect_mainVc) },
{ DGSLEffect_main1Bones, sizeof(DGSLEffect_main1Bones) },
{ DGSLEffect_main1BonesVc, sizeof(DGSLEffect_main1BonesVc) },
{ DGSLEffect_main2Bones, sizeof(DGSLEffect_main2Bones) },
{ DGSLEffect_main2BonesVc, sizeof(DGSLEffect_main2BonesVc) },
{ DGSLEffect_main4Bones, sizeof(DGSLEffect_main4Bones) },
{ DGSLEffect_main4BonesVc, sizeof(DGSLEffect_main4BonesVc) },
};
const ShaderBytecode DGSLEffectTraits::PixelShaderBytecode[] =
{
{ DGSLUnlit_main, sizeof(DGSLUnlit_main) }, // UNLIT (no texture)
{ DGSLLambert_main, sizeof(DGSLLambert_main) }, // LAMBERT (no texture)
{ DGSLPhong_main, sizeof(DGSLPhong_main) }, // PHONG (no texture)
{ DGSLUnlit_mainTx, sizeof(DGSLUnlit_mainTx) }, // UNLIT (textured)
{ DGSLLambert_mainTx, sizeof(DGSLLambert_mainTx) }, // LAMBERT (textured)
{ DGSLPhong_mainTx, sizeof(DGSLPhong_mainTx) }, // PHONG (textured)
{ DGSLUnlit_mainTk, sizeof(DGSLUnlit_mainTk) }, // UNLIT (no texture, discard)
{ DGSLLambert_mainTk, sizeof(DGSLLambert_mainTk) }, // LAMBERT (no texture, discard)
{ DGSLPhong_mainTk, sizeof(DGSLPhong_mainTk) }, // PHONG (no texture, discard)
{ DGSLUnlit_mainTxTk, sizeof(DGSLUnlit_mainTxTk) }, // UNLIT (textured, discard)
{ DGSLLambert_mainTxTk, sizeof(DGSLLambert_mainTxTk) }, // LAMBERT (textured, discard)
{ DGSLPhong_mainTxTk, sizeof(DGSLPhong_mainTxTk) }, // PHONG (textured, discard)
};
class DGSLEffect::Impl : public AlignedNew<DGSLEffectConstants>
{
public:
Impl( _In_ ID3D11Device* device, _In_opt_ ID3D11PixelShader* pixelShader, _In_ bool enableSkinning ) :
dirtyFlags( INT_MAX ),
vertexColorEnabled(false),
textureEnabled(false),
specularEnabled(false),
alphaDiscardEnabled(false),
weightsPerVertex( enableSkinning ? 4 : 0 ),
mCBMaterial( device ),
mCBLight( device ),
mCBObject( device ),
mCBMisc( device ),
mPixelShader( pixelShader ),
mDeviceResources( deviceResourcesPool.DemandCreate(device) )
{
static_assert( _countof(DGSLEffectTraits::VertexShaderBytecode) == DGSLEffectTraits::VertexShaderCount, "array/max mismatch" );
static_assert( _countof(DGSLEffectTraits::PixelShaderBytecode) == DGSLEffectTraits::PixelShaderCount, "array/max mismatch" );
memset( &constants, 0, sizeof(constants) );
XMMATRIX id = XMMatrixIdentity();
world = id;
view = id;
projection = id;
constants.material.Diffuse = g_XMOne;
constants.material.Specular = g_XMOne;
constants.material.SpecularPower = 16;
constants.object.UvTransform4x4 = id;
static_assert( MaxDirectionalLights == 4, "Mismatch with DGSL pipline" );
for( int i = 0; i < MaxDirectionalLights; ++i )
{
lightEnabled[i] = (i == 0);
lightDiffuseColor[i] = g_XMZero;
lightSpecularColor[i] = g_XMOne;
constants.light.LightDirection[i] = g_XMNegIdentityR1;
constants.light.LightColor[i] = lightEnabled[i] ? lightDiffuseColor[i] : g_XMZero;
constants.light.LightSpecularIntensity[i] = lightEnabled[i] ? lightSpecularColor[i] : g_XMZero;
}
if ( enableSkinning )
{
mCBBone.Create( device );
for( size_t j = 0; j < MaxBones; ++j )
{
constants.bones.Bones[ j ][0] = g_XMIdentityR0;
constants.bones.Bones[ j ][1] = g_XMIdentityR1;
constants.bones.Bones[ j ][2] = g_XMIdentityR2;
}
}
}
// Methods
void Apply( _In_ ID3D11DeviceContext* deviceContext );
void GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength);
// Fields
DGSLEffectConstants constants;
XMMATRIX world;
XMMATRIX view;
XMMATRIX projection;
bool lightEnabled[MaxDirectionalLights];
XMVECTOR lightDiffuseColor[MaxDirectionalLights];
XMVECTOR lightSpecularColor[MaxDirectionalLights];
ComPtr<ID3D11ShaderResourceView> textures[MaxTextures];
int dirtyFlags;
bool vertexColorEnabled;
bool textureEnabled;
bool specularEnabled;
bool alphaDiscardEnabled;
int weightsPerVertex;
private:
ConstantBuffer<MaterialConstants> mCBMaterial;
ConstantBuffer<LightConstants> mCBLight;
ConstantBuffer<ObjectConstants> mCBObject;
ConstantBuffer<MiscConstants> mCBMisc;
ConstantBuffer<BoneConstants> mCBBone;
ComPtr<ID3D11PixelShader> mPixelShader;
int GetCurrentVSPermutation() const;
int GetCurrentPSPermutation() const;
// Only one of these helpers is allocated per D3D device, even if there are multiple effect instances.
class DeviceResources : protected EffectDeviceResources
{
public:
DeviceResources(_In_ ID3D11Device* device) : EffectDeviceResources(device) {}
// Gets or lazily creates the vertex shader.
ID3D11VertexShader* GetVertexShader( int permutation )
{
assert(permutation >= 0 && permutation < DGSLEffectTraits::VertexShaderCount);
return DemandCreateVertexShader(mVertexShaders[permutation], DGSLEffectTraits::VertexShaderBytecode[permutation]);
}
// Gets or lazily creates the specified pixel shader permutation.
ID3D11PixelShader* GetPixelShader( int permutation )
{
assert(permutation >= 0 && permutation < DGSLEffectTraits::PixelShaderCount);
return DemandCreatePixelShader(mPixelShaders[permutation], DGSLEffectTraits::PixelShaderBytecode[permutation]);
}
// Gets or lazily creates the default texture
ID3D11ShaderResourceView* GetDefaultTexture() { return EffectDeviceResources::GetDefaultTexture(); }
private:
ComPtr<ID3D11VertexShader> mVertexShaders[DGSLEffectTraits::VertexShaderCount];
ComPtr<ID3D11PixelShader> mPixelShaders[DGSLEffectTraits::PixelShaderCount];
ComPtr<ID3D11ShaderResourceView> mDefaultTexture;
};
// Per-device resources.
std::shared_ptr<DeviceResources> mDeviceResources;
static SharedResourcePool<ID3D11Device*, DeviceResources> deviceResourcesPool;
};
SharedResourcePool<ID3D11Device*, DGSLEffect::Impl::DeviceResources> DGSLEffect::Impl::deviceResourcesPool;
void DGSLEffect::Impl::Apply( _In_ ID3D11DeviceContext* deviceContext )
{
auto vertexShader = mDeviceResources->GetVertexShader( GetCurrentVSPermutation() );
auto pixelShader = mPixelShader.Get();
if( !pixelShader )
{
pixelShader = mDeviceResources->GetPixelShader( GetCurrentPSPermutation() );
}
deviceContext->VSSetShader( vertexShader, nullptr, 0 );
deviceContext->PSSetShader( pixelShader, nullptr, 0 );
// Check for any required matrices updates
if (dirtyFlags & EffectDirtyFlags::WorldViewProj)
{
constants.object.LocalToWorld4x4 = XMMatrixTranspose( world );
constants.object.WorldToView4x4 = XMMatrixTranspose( view );
XMMATRIX worldView = XMMatrixMultiply( world, view );
constants.object.LocalToProjected4x4 = XMMatrixTranspose( XMMatrixMultiply( worldView, projection ) );
dirtyFlags &= ~EffectDirtyFlags::WorldViewProj;
dirtyFlags |= EffectDirtyFlags::ConstantBufferObject;
}
if (dirtyFlags & EffectDirtyFlags::WorldInverseTranspose)
{
XMMATRIX worldInverse = XMMatrixInverse( nullptr, world );
constants.object.WorldToLocal4x4 = XMMatrixTranspose( worldInverse );
dirtyFlags &= ~EffectDirtyFlags::WorldInverseTranspose;
dirtyFlags |= EffectDirtyFlags::ConstantBufferObject;
}
if (dirtyFlags & EffectDirtyFlags::EyePosition)
{
XMMATRIX viewInverse = XMMatrixInverse( nullptr, view );
constants.object.EyePosition = viewInverse.r[3];
dirtyFlags &= ~EffectDirtyFlags::EyePosition;
dirtyFlags |= EffectDirtyFlags::ConstantBufferObject;
}
#if defined(_XBOX_ONE) && defined(_TITLE)
void* grfxMemoryMaterial;
mCBMaterial.SetData(deviceContext, constants.material, &grfxMemoryMaterial);
void* grfxMemoryLight;
mCBLight.SetData(deviceContext, constants.light, &grfxMemoryLight);
void* grfxMemoryObject;
mCBObject.SetData(deviceContext, constants.object, &grfxMemoryObject);
void *grfxMemoryMisc;
mCBMisc.SetData(deviceContext, constants.misc, &grfxMemoryMisc);
ComPtr<ID3D11DeviceContextX> deviceContextX;
ThrowIfFailed(deviceContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceContextX.GetAddressOf())));
auto buffer = mCBMaterial.GetBuffer();
deviceContextX->VSSetPlacementConstantBuffer( 0, buffer, grfxMemoryMaterial );
deviceContextX->PSSetPlacementConstantBuffer( 0, buffer, grfxMemoryMaterial );
buffer = mCBLight.GetBuffer();
deviceContextX->VSSetPlacementConstantBuffer( 1, buffer, grfxMemoryMaterial );
deviceContextX->PSSetPlacementConstantBuffer( 1, buffer, grfxMemoryMaterial );
buffer = mCBObject.GetBuffer();
deviceContextX->VSSetPlacementConstantBuffer( 2, buffer, grfxMemoryObject );
deviceContextX->PSSetPlacementConstantBuffer( 2, buffer, grfxMemoryObject );
buffer = mCBMisc.GetBuffer();
deviceContextX->VSSetPlacementConstantBuffer( 3, buffer, grfxMemoryMisc );
deviceContextX->PSSetPlacementConstantBuffer( 3, buffer, grfxMemoryMisc );
if ( weightsPerVertex > 0 )
{
void* grfxMemoryBone;
mCBBone.SetData(deviceContext, constants.bones, &grfxMemoryBone);
deviceContextX->VSSetPlacementConstantBuffer( 4, mCBBone.GetBuffer(), grfxMemoryBone );
}
#else
// Make sure the constant buffers are up to date.
if (dirtyFlags & EffectDirtyFlags::ConstantBufferMaterial)
{
mCBMaterial.SetData(deviceContext, constants.material);
dirtyFlags &= ~EffectDirtyFlags::ConstantBufferMaterial;
}
if (dirtyFlags & EffectDirtyFlags::ConstantBufferLight)
{
mCBLight.SetData(deviceContext, constants.light);
dirtyFlags &= ~EffectDirtyFlags::ConstantBufferLight;
}
if (dirtyFlags & EffectDirtyFlags::ConstantBufferObject)
{
mCBObject.SetData(deviceContext, constants.object);
dirtyFlags &= ~EffectDirtyFlags::ConstantBufferObject;
}
if (dirtyFlags & EffectDirtyFlags::ConstantBufferMisc)
{
mCBMisc.SetData(deviceContext, constants.misc);
dirtyFlags &= ~EffectDirtyFlags::ConstantBufferMisc;
}
if ( weightsPerVertex > 0 )
{
if (dirtyFlags & EffectDirtyFlags::ConstantBufferBones)
{
mCBBone.SetData(deviceContext, constants.bones);
dirtyFlags &= ~EffectDirtyFlags::ConstantBufferBones;
}
ID3D11Buffer* buffers[5] = { mCBMaterial.GetBuffer(), mCBLight.GetBuffer(), mCBObject.GetBuffer(),
mCBMisc.GetBuffer(), mCBBone.GetBuffer() };
deviceContext->VSSetConstantBuffers( 0, 5, buffers );
deviceContext->PSSetConstantBuffers( 0, 4, buffers );
}
else
{
ID3D11Buffer* buffers[4] = { mCBMaterial.GetBuffer(), mCBLight.GetBuffer(), mCBObject.GetBuffer(), mCBMisc.GetBuffer() };
deviceContext->VSSetConstantBuffers( 0, 4, buffers );
deviceContext->PSSetConstantBuffers( 0, 4, buffers );
}
#endif
// Set the textures
if ( textureEnabled )
{
ID3D11ShaderResourceView* txt[MaxTextures] = { textures[0].Get(), textures[1].Get(), textures[2].Get(), textures[3].Get(),
textures[4].Get(), textures[5].Get(), textures[6].Get(), textures[7].Get() };
deviceContext->PSSetShaderResources( 0, MaxTextures, txt );
}
else
{
ID3D11ShaderResourceView* txt[MaxTextures] = { mDeviceResources->GetDefaultTexture(), 0 };
deviceContext->PSSetShaderResources( 0, MaxTextures, txt );
}
}
void DGSLEffect::Impl::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
int permutation = GetCurrentVSPermutation();
assert( permutation < DGSLEffectTraits::VertexShaderCount );
_Analysis_assume_( permutation < DGSLEffectTraits::VertexShaderCount );
auto shader = DGSLEffectTraits::VertexShaderBytecode[permutation];
*pShaderByteCode = shader.code;
*pByteCodeLength = shader.length;
}
int DGSLEffect::Impl::GetCurrentVSPermutation() const
{
int permutation = (vertexColorEnabled) ? 1 : 0;
if( weightsPerVertex > 0 )
{
// Evaluate 1, 2, or 4 weights per vertex?
permutation += 2;
if (weightsPerVertex == 2)
{
permutation += 2;
}
else if (weightsPerVertex == 4)
{
permutation += 4;
}
}
return permutation;
}
int DGSLEffect::Impl::GetCurrentPSPermutation() const
{
int permutation = 0;
if ( constants.light.ActiveLights > 0 )
{
permutation = ( specularEnabled ) ? 2 : 1;
}
if ( textureEnabled )
permutation += 3;
if ( alphaDiscardEnabled )
permutation += 6;
return permutation;
}
//--------------------------------------------------------------------------------------
// DGSLEffect
//--------------------------------------------------------------------------------------
DGSLEffect::DGSLEffect(_In_ ID3D11Device* device, _In_opt_ ID3D11PixelShader* pixelShader, _In_ bool enableSkinning)
: pImpl(new Impl(device, pixelShader, enableSkinning))
{
}
DGSLEffect::DGSLEffect(DGSLEffect&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
DGSLEffect& DGSLEffect::operator= (DGSLEffect&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
DGSLEffect::~DGSLEffect()
{
}
// IEffect methods.
void DGSLEffect::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
pImpl->Apply(deviceContext);
}
void DGSLEffect::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
pImpl->GetVertexShaderBytecode( pShaderByteCode, pByteCodeLength );
}
// Camera settings.
void XM_CALLCONV DGSLEffect::SetWorld(FXMMATRIX value)
{
pImpl->world = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose;
}
void XM_CALLCONV DGSLEffect::SetView(FXMMATRIX value)
{
pImpl->view = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition;
}
void XM_CALLCONV DGSLEffect::SetProjection(FXMMATRIX value)
{
pImpl->projection = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj;
}
void XM_CALLCONV DGSLEffect::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
pImpl->world = world;
pImpl->view = view;
pImpl->projection = projection;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition;
}
// Material settings.
void XM_CALLCONV DGSLEffect::SetAmbientColor(FXMVECTOR value)
{
pImpl->constants.material.Ambient = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void XM_CALLCONV DGSLEffect::SetDiffuseColor(FXMVECTOR value)
{
pImpl->constants.material.Diffuse = XMVectorSelect(pImpl->constants.material.Diffuse, value, g_XMSelect1110);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void XM_CALLCONV DGSLEffect::SetEmissiveColor(FXMVECTOR value)
{
pImpl->constants.material.Emissive = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void XM_CALLCONV DGSLEffect::SetSpecularColor(FXMVECTOR value)
{
pImpl->specularEnabled = true;
pImpl->constants.material.Specular = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void DGSLEffect::SetSpecularPower(float value)
{
pImpl->specularEnabled = true;
pImpl->constants.material.SpecularPower = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void DGSLEffect::DisableSpecular()
{
pImpl->specularEnabled = false;
pImpl->constants.material.Specular = g_XMZero;
pImpl->constants.material.SpecularPower = 1.f;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void DGSLEffect::SetAlpha(float value)
{
// Set w to new value, but preserve existing xyz (diffuse color).
pImpl->constants.material.Diffuse = XMVectorSetW(pImpl->constants.material.Diffuse, value);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
void XM_CALLCONV DGSLEffect::SetColorAndAlpha(FXMVECTOR value)
{
pImpl->constants.material.Diffuse = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMaterial;
}
// Additional settings.
void XM_CALLCONV DGSLEffect::SetUVTransform(FXMMATRIX value)
{
pImpl->constants.object.UvTransform4x4 = XMMatrixTranspose( value );
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferObject;
}
void DGSLEffect::SetViewport( float width, float height )
{
pImpl->constants.misc.ViewportWidth = width;
pImpl->constants.misc.ViewportHeight = height;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMisc;
}
void DGSLEffect::SetTime( float time )
{
pImpl->constants.misc.Time = time;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferMisc;
}
void DGSLEffect::SetAlphaDiscardEnable(bool value)
{
pImpl->alphaDiscardEnabled = value;
}
// Light settings.
void DGSLEffect::SetLightingEnabled(bool value)
{
if (value)
{
if ( !pImpl->constants.light.ActiveLights )
pImpl->constants.light.ActiveLights = 1;
}
else
{
pImpl->constants.light.ActiveLights = 0;
}
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferLight;
}
void DGSLEffect::SetPerPixelLighting(bool)
{
// Unsupported interface method.
}
void XM_CALLCONV DGSLEffect::SetAmbientLightColor(FXMVECTOR value)
{
pImpl->constants.light.Ambient = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferLight;
}
void DGSLEffect::SetLightEnabled(int whichLight, bool value)
{
if ( whichLight < 0 || whichLight >= MaxDirectionalLights )
throw std::out_of_range("whichLight parameter out of range");
if ( pImpl->lightEnabled[whichLight] == value )
return;
pImpl->lightEnabled[whichLight] = value;
if ( value )
{
if ( whichLight >= (int)pImpl->constants.light.ActiveLights )
pImpl->constants.light.ActiveLights = static_cast<UINT>( whichLight + 1 );
pImpl->constants.light.LightColor[whichLight] = pImpl->lightDiffuseColor[whichLight];
pImpl->constants.light.LightSpecularIntensity[whichLight] = pImpl->lightSpecularColor[whichLight];
}
else
{
pImpl->constants.light.LightColor[whichLight] =
pImpl->constants.light.LightSpecularIntensity[whichLight] = g_XMZero;
}
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferLight;
}
void XM_CALLCONV DGSLEffect::SetLightDirection(int whichLight, FXMVECTOR value)
{
if ( whichLight < 0 || whichLight >= MaxDirectionalLights )
throw std::out_of_range("whichLight parameter out of range");
// DGSL effects lights do not negate the direction like BasicEffect
pImpl->constants.light.LightDirection[whichLight] = XMVectorNegate( value );
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferLight;
}
void XM_CALLCONV DGSLEffect::SetLightDiffuseColor(int whichLight, FXMVECTOR value)
{
if ( whichLight < 0 || whichLight >= MaxDirectionalLights )
throw std::out_of_range("whichLight parameter out of range");
pImpl->lightDiffuseColor[whichLight] = value;
if ( pImpl->lightEnabled[whichLight] )
{
pImpl->constants.light.LightColor[whichLight] = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferLight;
}
}
void XM_CALLCONV DGSLEffect::SetLightSpecularColor(int whichLight, FXMVECTOR value)
{
if ( whichLight < 0 || whichLight >= MaxDirectionalLights )
throw std::out_of_range("whichLight parameter out of range");
pImpl->lightSpecularColor[whichLight] = value;
if ( pImpl->lightEnabled[whichLight] )
{
pImpl->constants.light.LightSpecularIntensity[whichLight] = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferLight;
}
}
void DGSLEffect::EnableDefaultLighting()
{
EffectLights::EnableDefaultLighting(this);
}
// Vertex color setting.
void DGSLEffect::SetVertexColorEnabled(bool value)
{
pImpl->vertexColorEnabled = value;
}
// Texture settings.
void DGSLEffect::SetTextureEnabled(bool value)
{
pImpl->textureEnabled = value;
}
void DGSLEffect::SetTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->textures[0] = value;
}
void DGSLEffect::SetTexture(int whichTexture, _In_opt_ ID3D11ShaderResourceView* value)
{
if ( whichTexture < 0 || whichTexture >= MaxTextures )
throw std::out_of_range("whichTexture parameter out of range");
pImpl->textures[ whichTexture ] = value;
}
// Animation settings.
void DGSLEffect::SetWeightsPerVertex(int value)
{
if ( !pImpl->weightsPerVertex )
{
// Safe to ignore since it's only an optimization hint
return;
}
if ((value != 1) &&
(value != 2) &&
(value != 4))
{
throw std::out_of_range("WeightsPerVertex must be 1, 2, or 4");
}
pImpl->weightsPerVertex = value;
}
void DGSLEffect::SetBoneTransforms(_In_reads_(count) XMMATRIX const* value, size_t count)
{
if ( !pImpl->weightsPerVertex )
throw std::exception("Skinning not enabled for this effect");
if (count > MaxBones)
throw std::out_of_range("count parameter out of range");
auto boneConstant = pImpl->constants.bones.Bones;
for (size_t i = 0; i < count; i++)
{
XMMATRIX boneMatrix = XMMatrixTranspose(value[i]);
boneConstant[i][0] = boneMatrix.r[0];
boneConstant[i][1] = boneMatrix.r[1];
boneConstant[i][2] = boneMatrix.r[2];
}
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferBones;
}
void DGSLEffect::ResetBoneTransforms()
{
if ( !pImpl->weightsPerVertex )
{
// Safe to ignore since it just returns things back to default settings
return;
}
auto boneConstant = pImpl->constants.bones.Bones;
for(size_t i = 0; i < MaxBones; ++i)
{
boneConstant[i][0] = g_XMIdentityR0;
boneConstant[i][1] = g_XMIdentityR1;
boneConstant[i][2] = g_XMIdentityR2;
}
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBufferBones;
}

View File

@@ -0,0 +1,591 @@
//--------------------------------------------------------------------------------------
// File: DGSLEffectFactory.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Effects.h"
#include "DemandCreate.h"
#include "SharedResourcePool.h"
#include "DDSTextureLoader.h"
#include "WICTextureLoader.h"
#include <string.h>
#include "BinaryReader.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
static_assert(DGSLEffect::MaxTextures == DGSLEffectFactory::DGSLEffectInfo::BaseTextureOffset + _countof(DGSLEffectFactory::DGSLEffectInfo::textures), "DGSL supports 8 textures");
#endif
// Internal DGSLEffectFactory implementation class. Only one of these helpers is allocated
// per D3D device, even if there are multiple public facing DGSLEffectFactory instances.
class DGSLEffectFactory::Impl
{
public:
Impl(_In_ ID3D11Device* device)
: mPath{},
device(device),
mSharing(true),
mForceSRGB(false)
{}
std::shared_ptr<IEffect> CreateEffect( _In_ DGSLEffectFactory* factory, _In_ const IEffectFactory::EffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext );
std::shared_ptr<IEffect> CreateDGSLEffect( _In_ DGSLEffectFactory* factory, _In_ const DGSLEffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext );
void CreateTexture( _In_z_ const wchar_t* texture, _In_opt_ ID3D11DeviceContext* deviceContext, _Outptr_ ID3D11ShaderResourceView** textureView );
void CreatePixelShader( _In_z_ const wchar_t* shader, _Outptr_ ID3D11PixelShader** pixelShader );
void ReleaseCache();
void SetSharing( bool enabled ) { mSharing = enabled; }
void EnableForceSRGB(bool forceSRGB) { mForceSRGB = forceSRGB; }
static SharedResourcePool<ID3D11Device*, Impl> instancePool;
wchar_t mPath[MAX_PATH];
private:
ComPtr<ID3D11Device> device;
typedef std::map< std::wstring, std::shared_ptr<IEffect> > EffectCache;
typedef std::map< std::wstring, ComPtr<ID3D11ShaderResourceView> > TextureCache;
typedef std::map< std::wstring, ComPtr<ID3D11PixelShader> > ShaderCache;
EffectCache mEffectCache;
EffectCache mEffectCacheSkinning;
TextureCache mTextureCache;
ShaderCache mShaderCache;
bool mSharing;
bool mForceSRGB;
std::mutex mutex;
};
// Global instance pool.
SharedResourcePool<ID3D11Device*, DGSLEffectFactory::Impl> DGSLEffectFactory::Impl::instancePool;
_Use_decl_annotations_
std::shared_ptr<IEffect> DGSLEffectFactory::Impl::CreateEffect( DGSLEffectFactory* factory, const DGSLEffectFactory::EffectInfo& info, ID3D11DeviceContext* deviceContext )
{
if ( info.enableDualTexture )
{
throw std::exception( "DGSLEffect does not support multiple texcoords" );
}
if ( mSharing && info.name && *info.name )
{
if ( info.enableSkinning )
{
auto it = mEffectCacheSkinning.find( info.name );
if ( it != mEffectCacheSkinning.end() )
{
return it->second;
}
}
else
{
auto it = mEffectCache.find( info.name );
if ( it != mEffectCache.end() )
{
return it->second;
}
}
}
auto effect = std::make_shared<DGSLEffect>( device.Get(), nullptr, info.enableSkinning );
effect->EnableDefaultLighting();
effect->SetLightingEnabled(true);
XMVECTOR color = XMLoadFloat3( &info.ambientColor );
effect->SetAmbientColor( color );
color = XMLoadFloat3( &info.diffuseColor );
effect->SetDiffuseColor( color );
effect->SetAlpha( info.alpha );
if ( info.perVertexColor )
{
effect->SetVertexColorEnabled( true );
}
if ( info.specularColor.x != 0 || info.specularColor.y != 0 || info.specularColor.z != 0 )
{
color = XMLoadFloat3( &info.specularColor );
effect->SetSpecularColor( color );
effect->SetSpecularPower( info.specularPower );
}
if ( info.emissiveColor.x != 0 || info.emissiveColor.y != 0 || info.emissiveColor.z != 0 )
{
color = XMLoadFloat3( &info.emissiveColor );
effect->SetEmissiveColor( color );
}
if ( info.diffuseTexture && *info.diffuseTexture )
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture( info.diffuseTexture, deviceContext, srv.GetAddressOf() );
effect->SetTexture( srv.Get() );
effect->SetTextureEnabled(true);
}
if ( mSharing && info.name && *info.name )
{
std::lock_guard<std::mutex> lock(mutex);
if ( info.enableSkinning )
{
mEffectCacheSkinning.insert( EffectCache::value_type( info.name, effect ) );
}
else
{
mEffectCache.insert( EffectCache::value_type( info.name, effect ) );
}
}
return effect;
}
_Use_decl_annotations_
std::shared_ptr<IEffect> DGSLEffectFactory::Impl::CreateDGSLEffect( DGSLEffectFactory* factory, const DGSLEffectFactory::DGSLEffectInfo& info, ID3D11DeviceContext* deviceContext )
{
if ( mSharing && info.name && *info.name )
{
if ( info.enableSkinning )
{
auto it = mEffectCacheSkinning.find( info.name );
if ( it != mEffectCacheSkinning.end() )
{
return it->second;
}
}
else
{
auto it = mEffectCache.find( info.name );
if ( it != mEffectCache.end() )
{
return it->second;
}
}
}
std::shared_ptr<DGSLEffect> effect;
bool lighting = true;
bool allowSpecular = true;
if ( !info.pixelShader || !*info.pixelShader )
{
effect = std::make_shared<DGSLEffect>( device.Get(), nullptr, info.enableSkinning );
}
else
{
wchar_t root[ MAX_PATH ] = {};
auto last = wcsrchr( info.pixelShader, '_' );
if ( last )
{
wcscpy_s( root, last+1 );
}
else
{
wcscpy_s( root, info.pixelShader );
}
auto first = wcschr( root, '.' );
if ( first )
*first = 0;
if ( !_wcsicmp( root, L"lambert" ) )
{
allowSpecular = false;
effect = std::make_shared<DGSLEffect>( device.Get(), nullptr, info.enableSkinning );
}
else if ( !_wcsicmp( root, L"phong" ) )
{
effect = std::make_shared<DGSLEffect>( device.Get(), nullptr, info.enableSkinning );
}
else if ( !_wcsicmp( root, L"unlit" ) )
{
lighting = false;
effect = std::make_shared<DGSLEffect>( device.Get(), nullptr, info.enableSkinning );
}
else if ( device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0 )
{
// DGSL shaders are not compatible with Feature Level 9.x, use fallback shader
wcscat_s( root, L".cso" );
ComPtr<ID3D11PixelShader> ps;
factory->CreatePixelShader( root, ps.GetAddressOf() );
effect = std::make_shared<DGSLEffect>( device.Get(), ps.Get(), info.enableSkinning );
}
else
{
// Create DGSL shader and use it for the effect
ComPtr<ID3D11PixelShader> ps;
factory->CreatePixelShader( info.pixelShader, ps.GetAddressOf() );
effect = std::make_shared<DGSLEffect>( device.Get(), ps.Get(), info.enableSkinning );
}
}
if ( lighting )
{
effect->EnableDefaultLighting();
effect->SetLightingEnabled(true);
}
XMVECTOR color = XMLoadFloat3( &info.ambientColor );
effect->SetAmbientColor( color );
color = XMLoadFloat3( &info.diffuseColor );
effect->SetDiffuseColor( color );
effect->SetAlpha( info.alpha );
if ( info.perVertexColor )
{
effect->SetVertexColorEnabled( true );
}
effect->SetAlphaDiscardEnable(true);
if ( allowSpecular
&& ( info.specularColor.x != 0 || info.specularColor.y != 0 || info.specularColor.z != 0 ) )
{
color = XMLoadFloat3( &info.specularColor );
effect->SetSpecularColor( color );
effect->SetSpecularPower( info.specularPower );
}
else
{
effect->DisableSpecular();
}
if ( info.emissiveColor.x != 0 || info.emissiveColor.y != 0 || info.emissiveColor.z != 0 )
{
color = XMLoadFloat3( &info.emissiveColor );
effect->SetEmissiveColor( color );
}
if ( info.diffuseTexture && *info.diffuseTexture )
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture( info.diffuseTexture, deviceContext, srv.GetAddressOf() );
effect->SetTexture( srv.Get() );
effect->SetTextureEnabled(true);
}
if ( info.specularTexture && *info.specularTexture )
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture( info.specularTexture, deviceContext, srv.GetAddressOf() );
effect->SetTexture( 1, srv.Get() );
effect->SetTextureEnabled(true);
}
if ( info.normalTexture && *info.normalTexture )
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture( info.normalTexture, deviceContext, srv.GetAddressOf() );
effect->SetTexture( 2, srv.Get() );
effect->SetTextureEnabled(true);
}
for( int j = 0; j < _countof(info.textures); ++j )
{
if ( info.textures[j] && *info.textures[j] )
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture( info.textures[j], deviceContext, srv.GetAddressOf() );
effect->SetTexture( j + DGSLEffectInfo::BaseTextureOffset, srv.Get() );
effect->SetTextureEnabled(true);
}
}
if ( mSharing && info.name && *info.name )
{
std::lock_guard<std::mutex> lock(mutex);
if ( info.enableSkinning )
{
mEffectCacheSkinning.insert( EffectCache::value_type( info.name, effect ) );
}
else
{
mEffectCache.insert( EffectCache::value_type( info.name, effect ) );
}
}
return effect;
}
_Use_decl_annotations_
void DGSLEffectFactory::Impl::CreateTexture( const wchar_t* name, ID3D11DeviceContext* deviceContext, ID3D11ShaderResourceView** textureView )
{
if ( !name || !textureView )
throw std::exception("invalid arguments");
#if defined(_XBOX_ONE) && defined(_TITLE)
UNREFERENCED_PARAMETER(deviceContext);
#endif
auto it = mTextureCache.find( name );
if ( mSharing && it != mTextureCache.end() )
{
ID3D11ShaderResourceView* srv = it->second.Get();
srv->AddRef();
*textureView = srv;
}
else
{
wchar_t fullName[MAX_PATH] = {};
wcscpy_s( fullName, mPath );
wcscat_s( fullName, name );
WIN32_FILE_ATTRIBUTE_DATA fileAttr = {};
if ( !GetFileAttributesExW(fullName, GetFileExInfoStandard, &fileAttr) )
{
// Try Current Working Directory (CWD)
wcscpy_s( fullName, name );
if ( !GetFileAttributesExW(fullName, GetFileExInfoStandard, &fileAttr) )
{
DebugTrace( "DGSLEffectFactory could not find texture file '%ls'\n", name );
throw std::exception( "CreateTexture" );
}
}
wchar_t ext[_MAX_EXT];
_wsplitpath_s( name, nullptr, 0, nullptr, 0, nullptr, 0, ext, _MAX_EXT );
if ( _wcsicmp( ext, L".dds" ) == 0 )
{
HRESULT hr = CreateDDSTextureFromFileEx(
device.Get(), fullName, 0,
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
mForceSRGB, nullptr, textureView);
if ( FAILED(hr) )
{
DebugTrace( "CreateDDSTextureFromFile failed (%08X) for '%ls'\n", hr, fullName );
throw std::exception( "CreateDDSTextureFromFile" );
}
}
#if !defined(_XBOX_ONE) || !defined(_TITLE)
else if ( deviceContext )
{
std::lock_guard<std::mutex> lock(mutex);
HRESULT hr = CreateWICTextureFromFileEx(
device.Get(), deviceContext, fullName, 0,
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
mForceSRGB ? WIC_LOADER_FORCE_SRGB : WIC_LOADER_DEFAULT, nullptr, textureView );
if ( FAILED(hr) )
{
DebugTrace( "CreateWICTextureFromFile failed (%08X) for '%ls'\n", hr, fullName );
throw std::exception( "CreateWICTextureFromFile" );
}
}
#endif
else
{
HRESULT hr = CreateWICTextureFromFileEx(
device.Get(), fullName, 0,
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
mForceSRGB ? WIC_LOADER_FORCE_SRGB : WIC_LOADER_DEFAULT, nullptr, textureView );
if ( FAILED(hr) )
{
DebugTrace( "CreateWICTextureFromFile failed (%08X) for '%ls'\n", hr, fullName );
throw std::exception( "CreateWICTextureFromFile" );
}
}
if ( mSharing && *name && it == mTextureCache.end() )
{
std::lock_guard<std::mutex> lock(mutex);
mTextureCache.insert( TextureCache::value_type( name, *textureView ) );
}
}
}
_Use_decl_annotations_
void DGSLEffectFactory::Impl::CreatePixelShader( const wchar_t* name, ID3D11PixelShader** pixelShader )
{
if ( !name || !pixelShader )
throw std::exception("invalid arguments");
auto it = mShaderCache.find( name );
if ( mSharing && it != mShaderCache.end() )
{
ID3D11PixelShader* ps = it->second.Get();
ps->AddRef();
*pixelShader = ps;
}
else
{
wchar_t fullName[MAX_PATH] = {};
wcscpy_s( fullName, mPath );
wcscat_s( fullName, name );
WIN32_FILE_ATTRIBUTE_DATA fileAttr = {};
if ( !GetFileAttributesExW(fullName, GetFileExInfoStandard, &fileAttr) )
{
// Try Current Working Directory (CWD)
wcscpy_s( fullName, name );
if ( !GetFileAttributesExW(fullName, GetFileExInfoStandard, &fileAttr) )
{
DebugTrace( "DGSLEffectFactory could not find shader file '%ls'\n", name );
throw std::exception( "CreatePixelShader" );
}
}
size_t dataSize = 0;
std::unique_ptr<uint8_t[]> data;
HRESULT hr = BinaryReader::ReadEntireFile( fullName, data, &dataSize );
if ( FAILED(hr) )
{
DebugTrace( "CreatePixelShader failed (%08X) to load shader file '%ls'\n", hr, fullName );
throw std::exception( "CreatePixelShader" );
}
ThrowIfFailed(
device->CreatePixelShader( data.get(), dataSize, nullptr, pixelShader ) );
_Analysis_assume_(*pixelShader != 0);
if ( mSharing && *name && it == mShaderCache.end() )
{
std::lock_guard<std::mutex> lock(mutex);
mShaderCache.insert( ShaderCache::value_type( name, *pixelShader ) );
}
}
}
void DGSLEffectFactory::Impl::ReleaseCache()
{
std::lock_guard<std::mutex> lock(mutex);
mEffectCache.clear();
mEffectCacheSkinning.clear();
mTextureCache.clear();
mShaderCache.clear();
}
//--------------------------------------------------------------------------------------
// DGSLEffectFactory
//--------------------------------------------------------------------------------------
DGSLEffectFactory::DGSLEffectFactory(_In_ ID3D11Device* device)
: pImpl(Impl::instancePool.DemandCreate(device))
{
}
DGSLEffectFactory::~DGSLEffectFactory()
{
}
DGSLEffectFactory::DGSLEffectFactory(DGSLEffectFactory&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
DGSLEffectFactory& DGSLEffectFactory::operator= (DGSLEffectFactory&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// IEffectFactory methods
_Use_decl_annotations_
std::shared_ptr<IEffect> DGSLEffectFactory::CreateEffect( const EffectInfo& info, ID3D11DeviceContext* deviceContext )
{
return pImpl->CreateEffect( this, info, deviceContext );
}
_Use_decl_annotations_
void DGSLEffectFactory::CreateTexture( const wchar_t* name, ID3D11DeviceContext* deviceContext, ID3D11ShaderResourceView** textureView )
{
return pImpl->CreateTexture( name, deviceContext, textureView );
}
// DGSL methods.
_Use_decl_annotations_
std::shared_ptr<IEffect> DGSLEffectFactory::CreateDGSLEffect( const DGSLEffectInfo& info, ID3D11DeviceContext* deviceContext )
{
return pImpl->CreateDGSLEffect( this, info, deviceContext );
}
_Use_decl_annotations_
void DGSLEffectFactory::CreatePixelShader( const wchar_t* shader, ID3D11PixelShader** pixelShader )
{
pImpl->CreatePixelShader( shader, pixelShader );
}
// Settings
void DGSLEffectFactory::ReleaseCache()
{
pImpl->ReleaseCache();
}
void DGSLEffectFactory::SetSharing( bool enabled )
{
pImpl->SetSharing( enabled );
}
void DGSLEffectFactory::EnableForceSRGB(bool forceSRGB)
{
pImpl->EnableForceSRGB( forceSRGB );
}
void DGSLEffectFactory::SetDirectory( _In_opt_z_ const wchar_t* path )
{
if ( path && *path != 0 )
{
wcscpy_s( pImpl->mPath, path );
size_t len = wcsnlen( pImpl->mPath, MAX_PATH );
if ( len > 0 && len < (MAX_PATH-1) )
{
// Ensure it has a trailing slash
if ( pImpl->mPath[len-1] != L'\\' )
{
pImpl->mPath[len] = L'\\';
pImpl->mPath[len+1] = 0;
}
}
}
else
*pImpl->mPath = 0;
}

View File

@@ -0,0 +1,51 @@
//--------------------------------------------------------------------------------------
// File: DemandCreate.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include "PlatformHelpers.h"
namespace DirectX
{
// Helper for lazily creating a D3D resource.
template<typename T, typename TCreateFunc>
static T* DemandCreate(Microsoft::WRL::ComPtr<T>& comPtr, std::mutex& mutex, TCreateFunc createFunc)
{
T* result = comPtr.Get();
// Double-checked lock pattern.
MemoryBarrier();
if (!result)
{
std::lock_guard<std::mutex> lock(mutex);
result = comPtr.Get();
if (!result)
{
// Create the new object.
ThrowIfFailed(
createFunc(&result)
);
MemoryBarrier();
comPtr.Attach(result);
}
}
return result;
}
}

View File

@@ -0,0 +1,340 @@
//--------------------------------------------------------------------------------------
// File: DualPostProcess.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "PostProcess.h"
#include "AlignedNew.h"
#include "CommonStates.h"
#include "ConstantBuffer.h"
#include "DemandCreate.h"
#include "DirectXHelpers.h"
#include "SharedResourcePool.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
namespace
{
const int c_MaxSamples = 16;
const int Dirty_ConstantBuffer = 0x01;
const int Dirty_Parameters = 0x02;
// Constant buffer layout. Must match the shader!
__declspec(align(16)) struct PostProcessConstants
{
XMVECTOR sampleOffsets[c_MaxSamples];
XMVECTOR sampleWeights[c_MaxSamples];
};
static_assert((sizeof(PostProcessConstants) % 16) == 0, "CB size not padded correctly");
}
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOnePostProcess_VSQuad.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSMerge.inc"
#include "Shaders/Compiled/XboxOnePostProcess_PSBloomCombine.inc"
#else
#include "Shaders/Compiled/PostProcess_VSQuad.inc"
#include "Shaders/Compiled/PostProcess_PSMerge.inc"
#include "Shaders/Compiled/PostProcess_PSBloomCombine.inc"
#endif
}
namespace
{
struct ShaderBytecode
{
void const* code;
size_t length;
};
const ShaderBytecode pixelShaders[] =
{
{ PostProcess_PSMerge, sizeof(PostProcess_PSMerge) },
{ PostProcess_PSBloomCombine, sizeof(PostProcess_PSBloomCombine) },
};
static_assert(_countof(pixelShaders) == DualPostProcess::Effect_Max, "array/max mismatch");
// Factory for lazily instantiating shaders.
class DeviceResources
{
public:
DeviceResources(_In_ ID3D11Device* device)
: stateObjects(device),
mDevice(device)
{ }
// Gets or lazily creates the vertex shader.
ID3D11VertexShader* GetVertexShader()
{
return DemandCreate(mVertexShader, mMutex, [&](ID3D11VertexShader** pResult) -> HRESULT
{
HRESULT hr = mDevice->CreateVertexShader(PostProcess_VSQuad, sizeof(PostProcess_VSQuad), nullptr, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DualPostProcess");
return hr;
});
}
// Gets or lazily creates the specified pixel shader.
ID3D11PixelShader* GetPixelShader(int shaderIndex)
{
assert(shaderIndex >= 0 && shaderIndex < DualPostProcess::Effect_Max);
_Analysis_assume_(shaderIndex >= 0 && shaderIndex < DualPostProcess::Effect_Max);
return DemandCreate(mPixelShaders[shaderIndex], mMutex, [&](ID3D11PixelShader** pResult) -> HRESULT
{
HRESULT hr = mDevice->CreatePixelShader(pixelShaders[shaderIndex].code, pixelShaders[shaderIndex].length, nullptr, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DualPostProcess");
return hr;
});
}
CommonStates stateObjects;
protected:
ComPtr<ID3D11Device> mDevice;
ComPtr<ID3D11VertexShader> mVertexShader;
ComPtr<ID3D11PixelShader> mPixelShaders[DualPostProcess::Effect_Max];
std::mutex mMutex;
};
}
class DualPostProcess::Impl : public AlignedNew<PostProcessConstants>
{
public:
Impl(_In_ ID3D11Device* device);
void Process(_In_ ID3D11DeviceContext* deviceContext, std::function<void __cdecl()>& setCustomState);
void SetDirtyFlag() { mDirtyFlags = INT_MAX; }
// Fields.
DualPostProcess::Effect fx;
PostProcessConstants constants;
ComPtr<ID3D11ShaderResourceView> texture;
ComPtr<ID3D11ShaderResourceView> texture2;
float mergeWeight1;
float mergeWeight2;
float bloomIntensity;
float bloomBaseIntensity;
float bloomSaturation;
float bloomBaseSaturation;
private:
int mDirtyFlags;
ConstantBuffer<PostProcessConstants> mConstantBuffer;
// Per-device resources.
std::shared_ptr<DeviceResources> mDeviceResources;
static SharedResourcePool<ID3D11Device*, DeviceResources> deviceResourcesPool;
};
// Global pool of per-device DualPostProcess resources.
SharedResourcePool<ID3D11Device*, DeviceResources> DualPostProcess::Impl::deviceResourcesPool;
// Constructor.
DualPostProcess::Impl::Impl(_In_ ID3D11Device* device)
: fx(DualPostProcess::Merge),
mergeWeight1(0.5f),
mergeWeight2(0.5f),
bloomIntensity(1.25f),
bloomBaseIntensity(1.f),
bloomSaturation(1.f),
bloomBaseSaturation(1.f),
mDirtyFlags(INT_MAX),
mConstantBuffer(device),
mDeviceResources(deviceResourcesPool.DemandCreate(device)),
constants{}
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::exception("DualPostProcess requires Feature Level 10.0 or later");
}
}
// Sets our state onto the D3D device.
void DualPostProcess::Impl::Process(_In_ ID3D11DeviceContext* deviceContext, std::function<void __cdecl()>& setCustomState)
{
// Set the texture.
ID3D11ShaderResourceView* textures[2] = { texture.Get(), texture2.Get() };
deviceContext->PSSetShaderResources(0, 2, textures);
auto sampler = mDeviceResources->stateObjects.LinearClamp();
deviceContext->PSSetSamplers(0, 1, &sampler);
// Set state objects.
deviceContext->OMSetBlendState(mDeviceResources->stateObjects.Opaque(), nullptr, 0xffffffff);
deviceContext->OMSetDepthStencilState(mDeviceResources->stateObjects.DepthNone(), 0);
deviceContext->RSSetState(mDeviceResources->stateObjects.CullNone());
// Set shaders.
auto vertexShader = mDeviceResources->GetVertexShader();
auto pixelShader = mDeviceResources->GetPixelShader(fx);
deviceContext->VSSetShader(vertexShader, nullptr, 0);
deviceContext->PSSetShader(pixelShader, nullptr, 0);
// Set constants.
if (mDirtyFlags & Dirty_Parameters)
{
mDirtyFlags &= ~Dirty_Parameters;
mDirtyFlags |= Dirty_ConstantBuffer;
switch (fx)
{
case Merge:
constants.sampleWeights[0] = XMVectorReplicate(mergeWeight1);
constants.sampleWeights[1] = XMVectorReplicate(mergeWeight2);
break;
case BloomCombine:
constants.sampleWeights[0] = XMVectorSet(bloomBaseSaturation, bloomSaturation, 0.f, 0.f);
constants.sampleWeights[1] = XMVectorReplicate(bloomBaseIntensity);
constants.sampleWeights[2] = XMVectorReplicate(bloomIntensity);
break;
default:
break;
}
}
#if defined(_XBOX_ONE) && defined(_TITLE)
void *grfxMemory;
mConstantBuffer.SetData(deviceContext, constants, &grfxMemory);
Microsoft::WRL::ComPtr<ID3D11DeviceContextX> deviceContextX;
ThrowIfFailed(deviceContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceContextX.GetAddressOf())));
auto buffer = mConstantBuffer.GetBuffer();
deviceContextX->PSSetPlacementConstantBuffer(0, buffer, grfxMemory);
#else
if (mDirtyFlags & Dirty_ConstantBuffer)
{
mDirtyFlags &= ~Dirty_ConstantBuffer;
mConstantBuffer.SetData(deviceContext, constants);
}
// Set the constant buffer.
auto buffer = mConstantBuffer.GetBuffer();
deviceContext->PSSetConstantBuffers(0, 1, &buffer);
#endif
if (setCustomState)
{
setCustomState();
}
// Draw quad.
deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
deviceContext->Draw(4, 0);
}
// Public constructor.
DualPostProcess::DualPostProcess(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
DualPostProcess::DualPostProcess(DualPostProcess&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
DualPostProcess& DualPostProcess::operator= (DualPostProcess&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
DualPostProcess::~DualPostProcess()
{
}
// IPostProcess methods.
void DualPostProcess::Process(_In_ ID3D11DeviceContext* deviceContext, _In_opt_ std::function<void __cdecl()> setCustomState)
{
pImpl->Process(deviceContext, setCustomState);
}
// Shader control.
void DualPostProcess::SetEffect(Effect fx)
{
if (fx < 0 || fx >= Effect_Max)
throw std::out_of_range("Effect not defined");
pImpl->fx = fx;
pImpl->SetDirtyFlag();
}
// Properties
void DualPostProcess::SetSourceTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
}
void DualPostProcess::SetSourceTexture2(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture2 = value;
}
void DualPostProcess::SetMergeParameters(float weight1, float weight2)
{
pImpl->mergeWeight1 = weight1;
pImpl->mergeWeight2 = weight2;
pImpl->SetDirtyFlag();
}
void DualPostProcess::SetBloomCombineParameters(float bloom, float base, float bloomSaturation, float baseSaturation)
{
pImpl->bloomIntensity = bloom;
pImpl->bloomBaseIntensity = base;
pImpl->bloomSaturation = bloomSaturation;
pImpl->bloomBaseSaturation = baseSaturation;
pImpl->SetDirtyFlag();
}

View File

@@ -0,0 +1,338 @@
//--------------------------------------------------------------------------------------
// File: DualTextureEffect.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
// Constant buffer layout. Must match the shader!
struct DualTextureEffectConstants
{
XMVECTOR diffuseColor;
XMVECTOR fogColor;
XMVECTOR fogVector;
XMMATRIX worldViewProj;
};
static_assert( ( sizeof(DualTextureEffectConstants) % 16 ) == 0, "CB size not padded correctly" );
// Traits type describes our characteristics to the EffectBase template.
struct DualTextureEffectTraits
{
typedef DualTextureEffectConstants ConstantBufferType;
static const int VertexShaderCount = 4;
static const int PixelShaderCount = 2;
static const int ShaderPermutationCount = 4;
};
// Internal DualTextureEffect implementation class.
class DualTextureEffect::Impl : public EffectBase<DualTextureEffectTraits>
{
public:
Impl(_In_ ID3D11Device* device);
bool vertexColorEnabled;
EffectColor color;
ComPtr<ID3D11ShaderResourceView> texture2;
int GetCurrentShaderPermutation() const;
void Apply(_In_ ID3D11DeviceContext* deviceContext);
};
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOneDualTextureEffect_VSDualTexture.inc"
#include "Shaders/Compiled/XboxOneDualTextureEffect_VSDualTextureNoFog.inc"
#include "Shaders/Compiled/XboxOneDualTextureEffect_VSDualTextureVc.inc"
#include "Shaders/Compiled/XboxOneDualTextureEffect_VSDualTextureVcNoFog.inc"
#include "Shaders/Compiled/XboxOneDualTextureEffect_PSDualTexture.inc"
#include "Shaders/Compiled/XboxOneDualTextureEffect_PSDualTextureNoFog.inc"
#else
#include "Shaders/Compiled/DualTextureEffect_VSDualTexture.inc"
#include "Shaders/Compiled/DualTextureEffect_VSDualTextureNoFog.inc"
#include "Shaders/Compiled/DualTextureEffect_VSDualTextureVc.inc"
#include "Shaders/Compiled/DualTextureEffect_VSDualTextureVcNoFog.inc"
#include "Shaders/Compiled/DualTextureEffect_PSDualTexture.inc"
#include "Shaders/Compiled/DualTextureEffect_PSDualTextureNoFog.inc"
#endif
}
template<>
const ShaderBytecode EffectBase<DualTextureEffectTraits>::VertexShaderBytecode[] =
{
{ DualTextureEffect_VSDualTexture, sizeof(DualTextureEffect_VSDualTexture) },
{ DualTextureEffect_VSDualTextureNoFog, sizeof(DualTextureEffect_VSDualTextureNoFog) },
{ DualTextureEffect_VSDualTextureVc, sizeof(DualTextureEffect_VSDualTextureVc) },
{ DualTextureEffect_VSDualTextureVcNoFog, sizeof(DualTextureEffect_VSDualTextureVcNoFog) },
};
template<>
const int EffectBase<DualTextureEffectTraits>::VertexShaderIndices[] =
{
0, // basic
1, // no fog
2, // vertex color
3, // vertex color, no fog
};
template<>
const ShaderBytecode EffectBase<DualTextureEffectTraits>::PixelShaderBytecode[] =
{
{ DualTextureEffect_PSDualTexture, sizeof(DualTextureEffect_PSDualTexture) },
{ DualTextureEffect_PSDualTextureNoFog, sizeof(DualTextureEffect_PSDualTextureNoFog) },
};
template<>
const int EffectBase<DualTextureEffectTraits>::PixelShaderIndices[] =
{
0, // basic
1, // no fog
0, // vertex color
1, // vertex color, no fog
};
// Global pool of per-device DualTextureEffect resources.
template<>
SharedResourcePool<ID3D11Device*, EffectBase<DualTextureEffectTraits>::DeviceResources> EffectBase<DualTextureEffectTraits>::deviceResourcesPool;
// Constructor.
DualTextureEffect::Impl::Impl(_In_ ID3D11Device* device)
: EffectBase(device),
vertexColorEnabled(false)
{
static_assert( _countof(EffectBase<DualTextureEffectTraits>::VertexShaderIndices) == DualTextureEffectTraits::ShaderPermutationCount, "array/max mismatch" );
static_assert( _countof(EffectBase<DualTextureEffectTraits>::VertexShaderBytecode) == DualTextureEffectTraits::VertexShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<DualTextureEffectTraits>::PixelShaderBytecode) == DualTextureEffectTraits::PixelShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<DualTextureEffectTraits>::PixelShaderIndices) == DualTextureEffectTraits::ShaderPermutationCount, "array/max mismatch" );
}
int DualTextureEffect::Impl::GetCurrentShaderPermutation() const
{
int permutation = 0;
// Use optimized shaders if fog is disabled.
if (!fog.enabled)
{
permutation += 1;
}
// Support vertex coloring?
if (vertexColorEnabled)
{
permutation += 2;
}
return permutation;
}
// Sets our state onto the D3D device.
void DualTextureEffect::Impl::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
// Compute derived parameter values.
matrices.SetConstants(dirtyFlags, constants.worldViewProj);
fog.SetConstants(dirtyFlags, matrices.worldView, constants.fogVector);
color.SetConstants(dirtyFlags, constants.diffuseColor);
// Set the textures.
ID3D11ShaderResourceView* textures[2] =
{
texture.Get(),
texture2.Get(),
};
deviceContext->PSSetShaderResources(0, 2, textures);
// Set shaders and constant buffers.
ApplyShaders(deviceContext, GetCurrentShaderPermutation());
}
// Public constructor.
DualTextureEffect::DualTextureEffect(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
DualTextureEffect::DualTextureEffect(DualTextureEffect&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
DualTextureEffect& DualTextureEffect::operator= (DualTextureEffect&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
DualTextureEffect::~DualTextureEffect()
{
}
// IEffect methods.
void DualTextureEffect::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
pImpl->Apply(deviceContext);
}
void DualTextureEffect::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
pImpl->GetVertexShaderBytecode(pImpl->GetCurrentShaderPermutation(), pShaderByteCode, pByteCodeLength);
}
// Camera settings.
void XM_CALLCONV DualTextureEffect::SetWorld(FXMMATRIX value)
{
pImpl->matrices.world = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV DualTextureEffect::SetView(FXMMATRIX value)
{
pImpl->matrices.view = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV DualTextureEffect::SetProjection(FXMMATRIX value)
{
pImpl->matrices.projection = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj;
}
void XM_CALLCONV DualTextureEffect::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
pImpl->matrices.world = world;
pImpl->matrices.view = view;
pImpl->matrices.projection = projection;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
// Material settings.
void XM_CALLCONV DualTextureEffect::SetDiffuseColor(FXMVECTOR value)
{
pImpl->color.diffuseColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void DualTextureEffect::SetAlpha(float value)
{
pImpl->color.alpha = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV DualTextureEffect::SetColorAndAlpha(FXMVECTOR value)
{
pImpl->color.diffuseColor = value;
pImpl->color.alpha = XMVectorGetW(value);
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
// Fog settings.
void DualTextureEffect::SetFogEnabled(bool value)
{
pImpl->fog.enabled = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogEnable;
}
void DualTextureEffect::SetFogStart(float value)
{
pImpl->fog.start = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void DualTextureEffect::SetFogEnd(float value)
{
pImpl->fog.end = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void XM_CALLCONV DualTextureEffect::SetFogColor(FXMVECTOR value)
{
pImpl->constants.fogColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Vertex color setting.
void DualTextureEffect::SetVertexColorEnabled(bool value)
{
pImpl->vertexColorEnabled = value;
}
// Texture settings.
void DualTextureEffect::SetTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
}
void DualTextureEffect::SetTexture2(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture2 = value;
}

View File

@@ -0,0 +1,451 @@
//--------------------------------------------------------------------------------------
// File: EffectCommon.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
#include "DemandCreate.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
// IEffectMatrices default method
void XM_CALLCONV IEffectMatrices::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
SetWorld(world);
SetView(view);
SetProjection(projection);
}
// Constructor initializes default matrix values.
EffectMatrices::EffectMatrices()
{
world = XMMatrixIdentity();
view = XMMatrixIdentity();
projection = XMMatrixIdentity();
worldView = XMMatrixIdentity();
}
// Lazily recomputes the combined world+view+projection matrix.
_Use_decl_annotations_ void EffectMatrices::SetConstants(int& dirtyFlags, XMMATRIX& worldViewProjConstant)
{
if (dirtyFlags & EffectDirtyFlags::WorldViewProj)
{
worldView = XMMatrixMultiply(world, view);
worldViewProjConstant = XMMatrixTranspose(XMMatrixMultiply(worldView, projection));
dirtyFlags &= ~EffectDirtyFlags::WorldViewProj;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
}
// Constructor initializes default fog settings.
EffectFog::EffectFog() :
enabled(false),
start(0),
end(1.f)
{
}
// Lazily recomputes the derived vector used by shader fog calculations.
_Use_decl_annotations_
void XM_CALLCONV EffectFog::SetConstants(int& dirtyFlags, FXMMATRIX worldView, XMVECTOR& fogVectorConstant)
{
if (enabled)
{
if (dirtyFlags & (EffectDirtyFlags::FogVector | EffectDirtyFlags::FogEnable))
{
if (start == end)
{
// Degenerate case: force everything to 100% fogged if start and end are the same.
static const XMVECTORF32 fullyFogged = { { { 0, 0, 0, 1 } } };
fogVectorConstant = fullyFogged;
}
else
{
// We want to transform vertex positions into view space, take the resulting
// Z value, then scale and offset according to the fog start/end distances.
// Because we only care about the Z component, the shader can do all this
// with a single dot product, using only the Z row of the world+view matrix.
// _13, _23, _33, _43
XMVECTOR worldViewZ = XMVectorMergeXY(XMVectorMergeZW(worldView.r[0], worldView.r[2]),
XMVectorMergeZW(worldView.r[1], worldView.r[3]));
// 0, 0, 0, fogStart
XMVECTOR wOffset = XMVectorSwizzle<1, 2, 3, 0>(XMLoadFloat(&start));
fogVectorConstant = (worldViewZ + wOffset) / (start - end);
}
dirtyFlags &= ~(EffectDirtyFlags::FogVector | EffectDirtyFlags::FogEnable);
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
}
else
{
// When fog is disabled, make sure the fog vector is reset to zero.
if (dirtyFlags & EffectDirtyFlags::FogEnable)
{
fogVectorConstant = g_XMZero;
dirtyFlags &= ~EffectDirtyFlags::FogEnable;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
}
}
// Constructor initializes default material color settings.
EffectColor::EffectColor() :
alpha(1.f)
{
diffuseColor = g_XMOne;
}
// Lazily recomputes the material color parameter for shaders that do not support realtime lighting.
void EffectColor::SetConstants(_Inout_ int& dirtyFlags, _Inout_ XMVECTOR& diffuseColorConstant)
{
if (dirtyFlags & EffectDirtyFlags::MaterialColor)
{
XMVECTOR alphaVector = XMVectorReplicate(alpha);
// xyz = diffuse * alpha, w = alpha.
diffuseColorConstant = XMVectorSelect(alphaVector, diffuseColor * alphaVector, g_XMSelect1110);
dirtyFlags &= ~EffectDirtyFlags::MaterialColor;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
}
// Constructor initializes default light settings.
EffectLights::EffectLights()
{
emissiveColor = g_XMZero;
ambientLightColor = g_XMZero;
for (int i = 0; i < MaxDirectionalLights; i++)
{
lightEnabled[i] = (i == 0);
lightDiffuseColor[i] = g_XMOne;
lightSpecularColor[i] = g_XMZero;
}
}
#ifdef _PREFAST_
#pragma prefast(push)
#pragma prefast(disable:22103, "PREFAST doesn't understand buffer is bounded by a static const value even with SAL" )
#endif
// Initializes constant buffer fields to match the current lighting state.
_Use_decl_annotations_ void EffectLights::InitializeConstants(XMVECTOR& specularColorAndPowerConstant, XMVECTOR* lightDirectionConstant, XMVECTOR* lightDiffuseConstant, XMVECTOR* lightSpecularConstant) const
{
static const XMVECTORF32 defaultSpecular = { { { 1, 1, 1, 16 } } };
static const XMVECTORF32 defaultLightDirection = { { { 0, -1, 0, 0 } } };
specularColorAndPowerConstant = defaultSpecular;
for (int i = 0; i < MaxDirectionalLights; i++)
{
lightDirectionConstant[i] = defaultLightDirection;
lightDiffuseConstant[i] = lightEnabled[i] ? lightDiffuseColor[i] : g_XMZero;
lightSpecularConstant[i] = lightEnabled[i] ? lightSpecularColor[i] : g_XMZero;
}
}
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
// Lazily recomputes derived parameter values used by shader lighting calculations.
_Use_decl_annotations_ void EffectLights::SetConstants(int& dirtyFlags, EffectMatrices const& matrices, XMMATRIX& worldConstant, XMVECTOR worldInverseTransposeConstant[3], XMVECTOR& eyePositionConstant, XMVECTOR& diffuseColorConstant, XMVECTOR& emissiveColorConstant, bool lightingEnabled)
{
if (lightingEnabled)
{
// World inverse transpose matrix.
if (dirtyFlags & EffectDirtyFlags::WorldInverseTranspose)
{
worldConstant = XMMatrixTranspose(matrices.world);
XMMATRIX worldInverse = XMMatrixInverse(nullptr, matrices.world);
worldInverseTransposeConstant[0] = worldInverse.r[0];
worldInverseTransposeConstant[1] = worldInverse.r[1];
worldInverseTransposeConstant[2] = worldInverse.r[2];
dirtyFlags &= ~EffectDirtyFlags::WorldInverseTranspose;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Eye position vector.
if (dirtyFlags & EffectDirtyFlags::EyePosition)
{
XMMATRIX viewInverse = XMMatrixInverse(nullptr, matrices.view);
eyePositionConstant = viewInverse.r[3];
dirtyFlags &= ~EffectDirtyFlags::EyePosition;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
}
// Material color parameters. The desired lighting model is:
//
// ((ambientLightColor + sum(diffuse directional light)) * diffuseColor) + emissiveColor
//
// When lighting is disabled, ambient and directional lights are ignored, leaving:
//
// diffuseColor + emissiveColor
//
// For the lighting disabled case, we can save one shader instruction by precomputing
// diffuse+emissive on the CPU, after which the shader can use diffuseColor directly,
// ignoring its emissive parameter.
//
// When lighting is enabled, we can merge the ambient and emissive settings. If we
// set our emissive parameter to emissive+(ambient*diffuse), the shader no longer
// needs to bother adding the ambient contribution, simplifying its computation to:
//
// (sum(diffuse directional light) * diffuseColor) + emissiveColor
//
// For futher optimization goodness, we merge material alpha with the diffuse
// color parameter, and premultiply all color values by this alpha.
if (dirtyFlags & EffectDirtyFlags::MaterialColor)
{
XMVECTOR diffuse = diffuseColor;
XMVECTOR alphaVector = XMVectorReplicate(alpha);
if (lightingEnabled)
{
// Merge emissive and ambient light contributions.
emissiveColorConstant = (emissiveColor + ambientLightColor * diffuse) * alphaVector;
}
else
{
// Merge diffuse and emissive light contributions.
diffuse += emissiveColor;
}
// xyz = diffuse * alpha, w = alpha.
diffuseColorConstant = XMVectorSelect(alphaVector, diffuse * alphaVector, g_XMSelect1110);
dirtyFlags &= ~EffectDirtyFlags::MaterialColor;
dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
}
#ifdef _PREFAST_
#pragma prefast(push)
#pragma prefast(disable:26015, "PREFAST doesn't understand that ValidateLightIndex bounds whichLight" )
#endif
// Helper for turning one of the directional lights on or off.
_Use_decl_annotations_ int EffectLights::SetLightEnabled(int whichLight, bool value, XMVECTOR* lightDiffuseConstant, XMVECTOR* lightSpecularConstant)
{
ValidateLightIndex(whichLight);
if (lightEnabled[whichLight] == value)
return 0;
lightEnabled[whichLight] = value;
if (value)
{
// If this light is now on, store its color in the constant buffer.
lightDiffuseConstant[whichLight] = lightDiffuseColor[whichLight];
lightSpecularConstant[whichLight] = lightSpecularColor[whichLight];
}
else
{
// If the light is off, reset constant buffer colors to zero.
lightDiffuseConstant[whichLight] = g_XMZero;
lightSpecularConstant[whichLight] = g_XMZero;
}
return EffectDirtyFlags::ConstantBuffer;
}
// Helper for setting diffuse color of one of the directional lights.
_Use_decl_annotations_
int XM_CALLCONV EffectLights::SetLightDiffuseColor(int whichLight, FXMVECTOR value, XMVECTOR* lightDiffuseConstant)
{
ValidateLightIndex(whichLight);
// Locally store the new color.
lightDiffuseColor[whichLight] = value;
// If this light is currently on, also update the constant buffer.
if (lightEnabled[whichLight])
{
lightDiffuseConstant[whichLight] = value;
return EffectDirtyFlags::ConstantBuffer;
}
return 0;
}
// Helper for setting specular color of one of the directional lights.
_Use_decl_annotations_
int XM_CALLCONV EffectLights::SetLightSpecularColor(int whichLight, FXMVECTOR value, XMVECTOR* lightSpecularConstant)
{
ValidateLightIndex(whichLight);
// Locally store the new color.
lightSpecularColor[whichLight] = value;
// If this light is currently on, also update the constant buffer.
if (lightEnabled[whichLight])
{
lightSpecularConstant[whichLight] = value;
return EffectDirtyFlags::ConstantBuffer;
}
return 0;
}
#ifdef _PREFAST_
#pragma prefast(pop)
#endif
// Parameter validation helper.
void EffectLights::ValidateLightIndex(int whichLight)
{
if (whichLight < 0 || whichLight >= MaxDirectionalLights)
{
throw std::out_of_range("whichLight parameter out of range");
}
}
// Activates the default lighting rig (key, fill, and back lights).
void EffectLights::EnableDefaultLighting(_In_ IEffectLights* effect)
{
static const XMVECTORF32 defaultDirections[MaxDirectionalLights] =
{
{ { { -0.5265408f, -0.5735765f, -0.6275069f, 0 } } },
{ { { 0.7198464f, 0.3420201f, 0.6040227f, 0 } } },
{ { { 0.4545195f, -0.7660444f, 0.4545195f, 0 } } },
};
static const XMVECTORF32 defaultDiffuse[MaxDirectionalLights] =
{
{ { { 1.0000000f, 0.9607844f, 0.8078432f, 0 } } },
{ { { 0.9647059f, 0.7607844f, 0.4078432f, 0 } } },
{ { { 0.3231373f, 0.3607844f, 0.3937255f, 0 } } },
};
static const XMVECTORF32 defaultSpecular[MaxDirectionalLights] =
{
{ { { 1.0000000f, 0.9607844f, 0.8078432f, 0 } } },
{ { { 0.0000000f, 0.0000000f, 0.0000000f, 0 } } },
{ { { 0.3231373f, 0.3607844f, 0.3937255f, 0 } } },
};
static const XMVECTORF32 defaultAmbient = { { { 0.05333332f, 0.09882354f, 0.1819608f, 0 } } };
effect->SetLightingEnabled(true);
effect->SetAmbientLightColor(defaultAmbient);
for (int i = 0; i < MaxDirectionalLights; i++)
{
effect->SetLightEnabled(i, true);
effect->SetLightDirection(i, defaultDirections[i]);
effect->SetLightDiffuseColor(i, defaultDiffuse[i]);
effect->SetLightSpecularColor(i, defaultSpecular[i]);
}
}
// Gets or lazily creates the specified vertex shader permutation.
ID3D11VertexShader* EffectDeviceResources::DemandCreateVertexShader(_Inout_ ComPtr<ID3D11VertexShader>& vertexShader, ShaderBytecode const& bytecode)
{
return DemandCreate(vertexShader, mMutex, [&](ID3D11VertexShader** pResult) -> HRESULT
{
HRESULT hr = mDevice->CreateVertexShader(bytecode.code, bytecode.length, nullptr, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:Effect");
return hr;
});
}
// Gets or lazily creates the specified pixel shader permutation.
ID3D11PixelShader* EffectDeviceResources::DemandCreatePixelShader(_Inout_ ComPtr<ID3D11PixelShader>& pixelShader, ShaderBytecode const& bytecode)
{
return DemandCreate(pixelShader, mMutex, [&](ID3D11PixelShader** pResult) -> HRESULT
{
HRESULT hr = mDevice->CreatePixelShader(bytecode.code, bytecode.length, nullptr, pResult);
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:Effect");
return hr;
});
}
// Gets or lazily creates the default texture
ID3D11ShaderResourceView* EffectDeviceResources::GetDefaultTexture()
{
return DemandCreate(mDefaultTexture, mMutex, [&](ID3D11ShaderResourceView** pResult) -> HRESULT
{
static const uint32_t s_pixel = 0xffffffff;
D3D11_SUBRESOURCE_DATA initData = { &s_pixel, sizeof(uint32_t), 0 };
D3D11_TEXTURE2D_DESC desc = {};
desc.Width = desc.Height = desc.MipLevels = desc.ArraySize = 1;
desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
desc.SampleDesc.Count = 1;
desc.Usage = D3D11_USAGE_IMMUTABLE;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
ComPtr<ID3D11Texture2D> tex;
HRESULT hr = mDevice->CreateTexture2D( &desc, &initData, tex.GetAddressOf() );
if (SUCCEEDED(hr))
{
SetDebugObjectName(tex.Get(), "DirectXTK:Effect");
D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc = {};
SRVDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
SRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
SRVDesc.Texture2D.MipLevels = 1;
hr = mDevice->CreateShaderResourceView( tex.Get(), &SRVDesc, pResult );
if (SUCCEEDED(hr))
SetDebugObjectName(*pResult, "DirectXTK:Effect");
}
return hr;
});
}

View File

@@ -0,0 +1,293 @@
//--------------------------------------------------------------------------------------
// File: EffectCommon.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include <memory>
#include "Effects.h"
#include "PlatformHelpers.h"
#include "ConstantBuffer.h"
#include "SharedResourcePool.h"
#include "AlignedNew.h"
// BasicEffect, SkinnedEffect, et al, have many things in common, but also significant
// differences (for instance, not all the effects support lighting). This header breaks
// out common functionality into a set of helpers which can be assembled in different
// combinations to build up whatever subset is needed by each effect.
namespace DirectX
{
// Bitfield tracks which derived parameter values need to be recomputed.
namespace EffectDirtyFlags
{
const int ConstantBuffer = 0x01;
const int WorldViewProj = 0x02;
const int WorldInverseTranspose = 0x04;
const int EyePosition = 0x08;
const int MaterialColor = 0x10;
const int FogVector = 0x20;
const int FogEnable = 0x40;
const int AlphaTest = 0x80;
}
// Helper stores matrix parameter values, and computes derived matrices.
struct EffectMatrices
{
EffectMatrices();
XMMATRIX world;
XMMATRIX view;
XMMATRIX projection;
XMMATRIX worldView;
void SetConstants(_Inout_ int& dirtyFlags, _Inout_ XMMATRIX& worldViewProjConstant);
};
// Helper stores the current fog settings, and computes derived shader parameters.
struct EffectFog
{
EffectFog();
bool enabled;
float start;
float end;
void XM_CALLCONV SetConstants(_Inout_ int& dirtyFlags, _In_ FXMMATRIX worldView, _Inout_ XMVECTOR& fogVectorConstant);
};
// Helper stores material color settings, and computes derived parameters for shaders that do not support realtime lighting.
struct EffectColor
{
EffectColor();
XMVECTOR diffuseColor;
float alpha;
void SetConstants(_Inout_ int& dirtyFlags, _Inout_ XMVECTOR& diffuseColorConstant);
};
// Helper stores the current light settings, and computes derived shader parameters.
struct EffectLights : public EffectColor
{
EffectLights();
static const int MaxDirectionalLights = IEffectLights::MaxDirectionalLights;
// Fields.
XMVECTOR emissiveColor;
XMVECTOR ambientLightColor;
bool lightEnabled[MaxDirectionalLights];
XMVECTOR lightDiffuseColor[MaxDirectionalLights];
XMVECTOR lightSpecularColor[MaxDirectionalLights];
// Methods.
void InitializeConstants(_Out_ XMVECTOR& specularColorAndPowerConstant, _Out_writes_all_(MaxDirectionalLights) XMVECTOR* lightDirectionConstant, _Out_writes_all_(MaxDirectionalLights) XMVECTOR* lightDiffuseConstant, _Out_writes_all_(MaxDirectionalLights) XMVECTOR* lightSpecularConstant) const;
void SetConstants(_Inout_ int& dirtyFlags, _In_ EffectMatrices const& matrices, _Inout_ XMMATRIX& worldConstant, _Inout_updates_(3) XMVECTOR worldInverseTransposeConstant[3], _Inout_ XMVECTOR& eyePositionConstant, _Inout_ XMVECTOR& diffuseColorConstant, _Inout_ XMVECTOR& emissiveColorConstant, bool lightingEnabled);
int SetLightEnabled(int whichLight, bool value, _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightDiffuseConstant, _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightSpecularConstant);
int XM_CALLCONV SetLightDiffuseColor(int whichLight, FXMVECTOR value, _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightDiffuseConstant);
int XM_CALLCONV SetLightSpecularColor(int whichLight, FXMVECTOR value, _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightSpecularConstant);
static void ValidateLightIndex(int whichLight);
static void EnableDefaultLighting(_In_ IEffectLights* effect);
};
// Points to a precompiled vertex or pixel shader program.
struct ShaderBytecode
{
void const* code;
size_t length;
};
// Factory for lazily instantiating shaders. BasicEffect supports many different
// shader permutations, so we only bother creating the ones that are actually used.
class EffectDeviceResources
{
public:
EffectDeviceResources(_In_ ID3D11Device* device)
: mDevice(device)
{ }
ID3D11VertexShader* DemandCreateVertexShader(_Inout_ Microsoft::WRL::ComPtr<ID3D11VertexShader>& vertexShader, ShaderBytecode const& bytecode);
ID3D11PixelShader * DemandCreatePixelShader (_Inout_ Microsoft::WRL::ComPtr<ID3D11PixelShader> & pixelShader, ShaderBytecode const& bytecode);
ID3D11ShaderResourceView* GetDefaultTexture();
protected:
Microsoft::WRL::ComPtr<ID3D11Device> mDevice;
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> mDefaultTexture;
std::mutex mMutex;
};
// Templated base class provides functionality common to all the built-in effects.
template<typename Traits>
class EffectBase : public AlignedNew<typename Traits::ConstantBufferType>
{
public:
// Constructor.
EffectBase(_In_ ID3D11Device* device)
: dirtyFlags(INT_MAX),
mConstantBuffer(device),
mDeviceResources(deviceResourcesPool.DemandCreate(device)),
constants{}
{
}
// Fields.
typename Traits::ConstantBufferType constants;
EffectMatrices matrices;
EffectFog fog;
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> texture;
int dirtyFlags;
// Helper looks up the bytecode for the specified vertex shader permutation.
// Client code needs this in order to create matching input layouts.
void GetVertexShaderBytecode(int permutation, _Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
assert(permutation >= 0 && permutation < Traits::ShaderPermutationCount);
_Analysis_assume_(permutation >= 0 && permutation < Traits::ShaderPermutationCount);
int shaderIndex = VertexShaderIndices[permutation];
assert(shaderIndex >= 0 && shaderIndex < Traits::VertexShaderCount);
_Analysis_assume_(shaderIndex >= 0 && shaderIndex < Traits::VertexShaderCount);
ShaderBytecode const& bytecode = VertexShaderBytecode[shaderIndex];
*pShaderByteCode = bytecode.code;
*pByteCodeLength = bytecode.length;
}
// Helper sets our shaders and constant buffers onto the D3D device.
void ApplyShaders(_In_ ID3D11DeviceContext* deviceContext, int permutation)
{
// Set shaders.
auto vertexShader = mDeviceResources->GetVertexShader(permutation);
auto pixelShader = mDeviceResources->GetPixelShader(permutation);
deviceContext->VSSetShader(vertexShader, nullptr, 0);
deviceContext->PSSetShader(pixelShader, nullptr, 0);
#if defined(_XBOX_ONE) && defined(_TITLE)
void *grfxMemory;
mConstantBuffer.SetData(deviceContext, constants, &grfxMemory);
Microsoft::WRL::ComPtr<ID3D11DeviceContextX> deviceContextX;
ThrowIfFailed(deviceContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceContextX.GetAddressOf())));
auto buffer = mConstantBuffer.GetBuffer();
deviceContextX->VSSetPlacementConstantBuffer(0, buffer, grfxMemory);
deviceContextX->PSSetPlacementConstantBuffer(0, buffer, grfxMemory);
#else
// Make sure the constant buffer is up to date.
if (dirtyFlags & EffectDirtyFlags::ConstantBuffer)
{
mConstantBuffer.SetData(deviceContext, constants);
dirtyFlags &= ~EffectDirtyFlags::ConstantBuffer;
}
// Set the constant buffer.
ID3D11Buffer* buffer = mConstantBuffer.GetBuffer();
deviceContext->VSSetConstantBuffers(0, 1, &buffer);
deviceContext->PSSetConstantBuffers(0, 1, &buffer);
#endif
}
// Helper returns the default texture.
ID3D11ShaderResourceView* GetDefaultTexture() { return mDeviceResources->GetDefaultTexture(); }
protected:
// Static arrays hold all the precompiled shader permutations.
static const ShaderBytecode VertexShaderBytecode[Traits::VertexShaderCount];
static const ShaderBytecode PixelShaderBytecode[Traits::PixelShaderCount];
static const int VertexShaderIndices[Traits::ShaderPermutationCount];
static const int PixelShaderIndices[Traits::ShaderPermutationCount];
private:
// D3D constant buffer holds a copy of the same data as the public 'constants' field.
ConstantBuffer<typename Traits::ConstantBufferType> mConstantBuffer;
// Only one of these helpers is allocated per D3D device, even if there are multiple effect instances.
class DeviceResources : protected EffectDeviceResources
{
public:
DeviceResources(_In_ ID3D11Device* device)
: EffectDeviceResources(device)
{ }
// Gets or lazily creates the specified vertex shader permutation.
ID3D11VertexShader* GetVertexShader(int permutation)
{
assert(permutation >= 0 && permutation < Traits::ShaderPermutationCount);
_Analysis_assume_(permutation >= 0 && permutation < Traits::ShaderPermutationCount);
int shaderIndex = VertexShaderIndices[permutation];
assert(shaderIndex >= 0 && shaderIndex < Traits::VertexShaderCount);
_Analysis_assume_(shaderIndex >= 0 && shaderIndex < Traits::VertexShaderCount);
return DemandCreateVertexShader(mVertexShaders[shaderIndex], VertexShaderBytecode[shaderIndex]);
}
// Gets or lazily creates the specified pixel shader permutation.
ID3D11PixelShader* GetPixelShader(int permutation)
{
assert(permutation >= 0 && permutation < Traits::ShaderPermutationCount);
_Analysis_assume_(permutation >= 0 && permutation < Traits::ShaderPermutationCount);
int shaderIndex = PixelShaderIndices[permutation];
assert(shaderIndex >= 0 && shaderIndex < Traits::PixelShaderCount);
_Analysis_assume_(shaderIndex >= 0 && shaderIndex < Traits::PixelShaderCount);
return DemandCreatePixelShader(mPixelShaders[shaderIndex], PixelShaderBytecode[shaderIndex]);
}
// Gets or lazily creates the default texture
ID3D11ShaderResourceView* GetDefaultTexture() { return EffectDeviceResources::GetDefaultTexture(); }
private:
Microsoft::WRL::ComPtr<ID3D11VertexShader> mVertexShaders[Traits::VertexShaderCount];
Microsoft::WRL::ComPtr<ID3D11PixelShader> mPixelShaders[Traits::PixelShaderCount];
};
// Per-device resources.
std::shared_ptr<DeviceResources> mDeviceResources;
static SharedResourcePool<ID3D11Device*, DeviceResources> deviceResourcesPool;
};
}

View File

@@ -0,0 +1,521 @@
//--------------------------------------------------------------------------------------
// File: EffectFactory.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Effects.h"
#include "DemandCreate.h"
#include "SharedResourcePool.h"
#include "DDSTextureLoader.h"
#include "WICTextureLoader.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
// Internal EffectFactory implementation class. Only one of these helpers is allocated
// per D3D device, even if there are multiple public facing EffectFactory instances.
class EffectFactory::Impl
{
public:
Impl(_In_ ID3D11Device* device)
: mPath{},
device(device),
mSharing(true),
mUseNormalMapEffect(true),
mForceSRGB(false)
{}
std::shared_ptr<IEffect> CreateEffect( _In_ IEffectFactory* factory, _In_ const IEffectFactory::EffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext );
void CreateTexture( _In_z_ const wchar_t* texture, _In_opt_ ID3D11DeviceContext* deviceContext, _Outptr_ ID3D11ShaderResourceView** textureView );
void ReleaseCache();
void SetSharing( bool enabled ) { mSharing = enabled; }
void EnableNormalMapEffect( bool enabled ) { mUseNormalMapEffect = enabled; }
void EnableForceSRGB(bool forceSRGB) { mForceSRGB = forceSRGB; }
static SharedResourcePool<ID3D11Device*, Impl> instancePool;
wchar_t mPath[MAX_PATH];
private:
ComPtr<ID3D11Device> device;
typedef std::map< std::wstring, std::shared_ptr<IEffect> > EffectCache;
typedef std::map< std::wstring, ComPtr<ID3D11ShaderResourceView> > TextureCache;
EffectCache mEffectCache;
EffectCache mEffectCacheSkinning;
EffectCache mEffectCacheDualTexture;
EffectCache mEffectNormalMap;
TextureCache mTextureCache;
bool mSharing;
bool mUseNormalMapEffect;
bool mForceSRGB;
std::mutex mutex;
};
// Global instance pool.
SharedResourcePool<ID3D11Device*, EffectFactory::Impl> EffectFactory::Impl::instancePool;
_Use_decl_annotations_
std::shared_ptr<IEffect> EffectFactory::Impl::CreateEffect(IEffectFactory* factory, const IEffectFactory::EffectInfo& info, ID3D11DeviceContext* deviceContext)
{
if (info.enableSkinning)
{
// SkinnedEffect
if (mSharing && info.name && *info.name)
{
auto it = mEffectCacheSkinning.find(info.name);
if (mSharing && it != mEffectCacheSkinning.end())
{
return it->second;
}
}
auto effect = std::make_shared<SkinnedEffect>(device.Get());
effect->EnableDefaultLighting();
effect->SetAlpha(info.alpha);
// Skinned Effect does not have an ambient material color, or per-vertex color support
XMVECTOR color = XMLoadFloat3(&info.diffuseColor);
effect->SetDiffuseColor(color);
if (info.specularColor.x != 0 || info.specularColor.y != 0 || info.specularColor.z != 0)
{
color = XMLoadFloat3(&info.specularColor);
effect->SetSpecularColor(color);
effect->SetSpecularPower(info.specularPower);
}
else
{
effect->DisableSpecular();
}
if (info.emissiveColor.x != 0 || info.emissiveColor.y != 0 || info.emissiveColor.z != 0)
{
color = XMLoadFloat3(&info.emissiveColor);
effect->SetEmissiveColor(color);
}
if (info.diffuseTexture && *info.diffuseTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.diffuseTexture, deviceContext, srv.GetAddressOf());
effect->SetTexture(srv.Get());
}
if (info.biasedVertexNormals)
{
effect->SetBiasedVertexNormals(true);
}
if (mSharing && info.name && *info.name)
{
std::lock_guard<std::mutex> lock(mutex);
mEffectCacheSkinning.insert(EffectCache::value_type(info.name, effect));
}
return effect;
}
else if (info.enableDualTexture)
{
// DualTextureEffect
if (mSharing && info.name && *info.name)
{
auto it = mEffectCacheDualTexture.find(info.name);
if (mSharing && it != mEffectCacheDualTexture.end())
{
return it->second;
}
}
auto effect = std::make_shared<DualTextureEffect>(device.Get());
// Dual texture effect doesn't support lighting (usually it's lightmaps)
effect->SetAlpha(info.alpha);
if (info.perVertexColor)
{
effect->SetVertexColorEnabled(true);
}
XMVECTOR color = XMLoadFloat3(&info.diffuseColor);
effect->SetDiffuseColor(color);
if (info.diffuseTexture && *info.diffuseTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.diffuseTexture, deviceContext, srv.GetAddressOf());
effect->SetTexture(srv.Get());
}
if (info.specularTexture && *info.specularTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.specularTexture, deviceContext, srv.GetAddressOf());
effect->SetTexture2(srv.Get());
}
if (mSharing && info.name && *info.name)
{
std::lock_guard<std::mutex> lock(mutex);
mEffectCacheDualTexture.insert(EffectCache::value_type(info.name, effect));
}
return effect;
}
else if (info.enableNormalMaps && mUseNormalMapEffect)
{
// NormalMapEffect
if (mSharing && info.name && *info.name)
{
auto it = mEffectNormalMap.find(info.name);
if (mSharing && it != mEffectNormalMap.end())
{
return it->second;
}
}
auto effect = std::make_shared<NormalMapEffect>(device.Get());
effect->EnableDefaultLighting();
effect->SetAlpha(info.alpha);
if (info.perVertexColor)
{
effect->SetVertexColorEnabled(true);
}
// NormalMap Effect does not have an ambient material color
XMVECTOR color = XMLoadFloat3(&info.diffuseColor);
effect->SetDiffuseColor(color);
if (info.specularColor.x != 0 || info.specularColor.y != 0 || info.specularColor.z != 0)
{
color = XMLoadFloat3(&info.specularColor);
effect->SetSpecularColor(color);
effect->SetSpecularPower(info.specularPower);
}
else
{
effect->DisableSpecular();
}
if (info.emissiveColor.x != 0 || info.emissiveColor.y != 0 || info.emissiveColor.z != 0)
{
color = XMLoadFloat3(&info.emissiveColor);
effect->SetEmissiveColor(color);
}
if (info.diffuseTexture && *info.diffuseTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.diffuseTexture, deviceContext, srv.GetAddressOf());
effect->SetTexture(srv.Get());
}
if (info.specularTexture && *info.specularTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.specularTexture, deviceContext, srv.GetAddressOf());
effect->SetSpecularTexture(srv.Get());
}
if (info.normalTexture && *info.normalTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.normalTexture, deviceContext, srv.GetAddressOf());
effect->SetNormalTexture(srv.Get());
}
if (info.biasedVertexNormals)
{
effect->SetBiasedVertexNormalsAndTangents(true);
}
if (mSharing && info.name && *info.name)
{
std::lock_guard<std::mutex> lock(mutex);
mEffectNormalMap.insert(EffectCache::value_type(info.name, effect));
}
return effect;
}
else
{
// BasicEffect
if (mSharing && info.name && *info.name)
{
auto it = mEffectCache.find(info.name);
if (mSharing && it != mEffectCache.end())
{
return it->second;
}
}
auto effect = std::make_shared<BasicEffect>(device.Get());
effect->EnableDefaultLighting();
effect->SetLightingEnabled(true);
effect->SetAlpha(info.alpha);
if (info.perVertexColor)
{
effect->SetVertexColorEnabled(true);
}
// Basic Effect does not have an ambient material color
XMVECTOR color = XMLoadFloat3(&info.diffuseColor);
effect->SetDiffuseColor(color);
if (info.specularColor.x != 0 || info.specularColor.y != 0 || info.specularColor.z != 0)
{
color = XMLoadFloat3(&info.specularColor);
effect->SetSpecularColor(color);
effect->SetSpecularPower(info.specularPower);
}
else
{
effect->DisableSpecular();
}
if (info.emissiveColor.x != 0 || info.emissiveColor.y != 0 || info.emissiveColor.z != 0)
{
color = XMLoadFloat3(&info.emissiveColor);
effect->SetEmissiveColor(color);
}
if (info.diffuseTexture && *info.diffuseTexture)
{
ComPtr<ID3D11ShaderResourceView> srv;
factory->CreateTexture(info.diffuseTexture, deviceContext, srv.GetAddressOf());
effect->SetTexture(srv.Get());
effect->SetTextureEnabled(true);
}
if (info.biasedVertexNormals)
{
effect->SetBiasedVertexNormals(true);
}
if (mSharing && info.name && *info.name)
{
std::lock_guard<std::mutex> lock(mutex);
mEffectCache.insert(EffectCache::value_type(info.name, effect));
}
return effect;
}
}
_Use_decl_annotations_
void EffectFactory::Impl::CreateTexture(const wchar_t* name, ID3D11DeviceContext* deviceContext, ID3D11ShaderResourceView** textureView)
{
if (!name || !textureView)
throw std::exception("invalid arguments");
#if defined(_XBOX_ONE) && defined(_TITLE)
UNREFERENCED_PARAMETER(deviceContext);
#endif
auto it = mTextureCache.find(name);
if (mSharing && it != mTextureCache.end())
{
ID3D11ShaderResourceView* srv = it->second.Get();
srv->AddRef();
*textureView = srv;
}
else
{
wchar_t fullName[MAX_PATH] = {};
wcscpy_s(fullName, mPath);
wcscat_s(fullName, name);
WIN32_FILE_ATTRIBUTE_DATA fileAttr = {};
if (!GetFileAttributesExW(fullName, GetFileExInfoStandard, &fileAttr))
{
// Try Current Working Directory (CWD)
wcscpy_s(fullName, name);
if (!GetFileAttributesExW(fullName, GetFileExInfoStandard, &fileAttr))
{
DebugTrace("EffectFactory could not find texture file '%ls'\n", name);
throw std::exception("CreateTexture");
}
}
wchar_t ext[_MAX_EXT];
_wsplitpath_s(name, nullptr, 0, nullptr, 0, nullptr, 0, ext, _MAX_EXT);
if (_wcsicmp(ext, L".dds") == 0)
{
HRESULT hr = CreateDDSTextureFromFileEx(
device.Get(), fullName, 0,
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
mForceSRGB, nullptr, textureView);
if (FAILED(hr))
{
DebugTrace("CreateDDSTextureFromFile failed (%08X) for '%ls'\n", hr, fullName);
throw std::exception("CreateDDSTextureFromFile");
}
}
#if !defined(_XBOX_ONE) || !defined(_TITLE)
else if (deviceContext)
{
std::lock_guard<std::mutex> lock(mutex);
HRESULT hr = CreateWICTextureFromFileEx(
device.Get(), deviceContext, fullName, 0,
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
mForceSRGB ? WIC_LOADER_FORCE_SRGB : WIC_LOADER_DEFAULT, nullptr, textureView);
if (FAILED(hr))
{
DebugTrace("CreateWICTextureFromFile failed (%08X) for '%ls'\n", hr, fullName);
throw std::exception("CreateWICTextureFromFile");
}
}
#endif
else
{
HRESULT hr = CreateWICTextureFromFileEx(
device.Get(), fullName, 0,
D3D11_USAGE_DEFAULT, D3D11_BIND_SHADER_RESOURCE, 0, 0,
mForceSRGB ? WIC_LOADER_FORCE_SRGB : WIC_LOADER_DEFAULT, nullptr, textureView);
if (FAILED(hr))
{
DebugTrace("CreateWICTextureFromFile failed (%08X) for '%ls'\n", hr, fullName);
throw std::exception("CreateWICTextureFromFile");
}
}
if (mSharing && *name && it == mTextureCache.end())
{
std::lock_guard<std::mutex> lock(mutex);
mTextureCache.insert(TextureCache::value_type(name, *textureView));
}
}
}
void EffectFactory::Impl::ReleaseCache()
{
std::lock_guard<std::mutex> lock(mutex);
mEffectCache.clear();
mEffectCacheSkinning.clear();
mEffectCacheDualTexture.clear();
mEffectNormalMap.clear();
mTextureCache.clear();
}
//--------------------------------------------------------------------------------------
// EffectFactory
//--------------------------------------------------------------------------------------
EffectFactory::EffectFactory(_In_ ID3D11Device* device)
: pImpl(Impl::instancePool.DemandCreate(device))
{
}
EffectFactory::~EffectFactory()
{
}
EffectFactory::EffectFactory(EffectFactory&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
EffectFactory& EffectFactory::operator= (EffectFactory&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
_Use_decl_annotations_
std::shared_ptr<IEffect> EffectFactory::CreateEffect(const EffectInfo& info, ID3D11DeviceContext* deviceContext)
{
return pImpl->CreateEffect(this, info, deviceContext);
}
_Use_decl_annotations_
void EffectFactory::CreateTexture(const wchar_t* name, ID3D11DeviceContext* deviceContext, ID3D11ShaderResourceView** textureView)
{
return pImpl->CreateTexture(name, deviceContext, textureView);
}
void EffectFactory::ReleaseCache()
{
pImpl->ReleaseCache();
}
void EffectFactory::SetSharing(bool enabled)
{
pImpl->SetSharing(enabled);
}
void EffectFactory::EnableNormalMapEffect(bool enabled)
{
pImpl->EnableNormalMapEffect( enabled );
}
void EffectFactory::EnableForceSRGB(bool forceSRGB)
{
pImpl->EnableForceSRGB( forceSRGB );
}
void EffectFactory::SetDirectory(_In_opt_z_ const wchar_t* path)
{
if (path && *path != 0)
{
wcscpy_s(pImpl->mPath, path);
size_t len = wcsnlen(pImpl->mPath, MAX_PATH);
if (len > 0 && len < (MAX_PATH - 1))
{
// Ensure it has a trailing slash
if (pImpl->mPath[len - 1] != L'\\')
{
pImpl->mPath[len] = L'\\';
pImpl->mPath[len + 1] = 0;
}
}
}
else
*pImpl->mPath = 0;
}

View File

@@ -0,0 +1,606 @@
//--------------------------------------------------------------------------------------
// File: EnvironmentMapEffect.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
// Constant buffer layout. Must match the shader!
struct EnvironmentMapEffectConstants
{
XMVECTOR environmentMapSpecular;
float environmentMapAmount;
float fresnelFactor;
float pad[2];
XMVECTOR diffuseColor;
XMVECTOR emissiveColor;
XMVECTOR lightDirection[IEffectLights::MaxDirectionalLights];
XMVECTOR lightDiffuseColor[IEffectLights::MaxDirectionalLights];
XMVECTOR eyePosition;
XMVECTOR fogColor;
XMVECTOR fogVector;
XMMATRIX world;
XMVECTOR worldInverseTranspose[3];
XMMATRIX worldViewProj;
};
static_assert( ( sizeof(EnvironmentMapEffectConstants) % 16 ) == 0, "CB size not padded correctly" );
// Traits type describes our characteristics to the EffectBase template.
struct EnvironmentMapEffectTraits
{
typedef EnvironmentMapEffectConstants ConstantBufferType;
static const int VertexShaderCount = 10;
static const int PixelShaderCount = 8;
static const int ShaderPermutationCount = 40;
};
// Internal EnvironmentMapEffect implementation class.
class EnvironmentMapEffect::Impl : public EffectBase<EnvironmentMapEffectTraits>
{
public:
Impl(_In_ ID3D11Device* device);
bool preferPerPixelLighting;
bool fresnelEnabled;
bool specularEnabled;
bool biasedVertexNormals;
EffectLights lights;
ComPtr<ID3D11ShaderResourceView> environmentMap;
int GetCurrentShaderPermutation() const;
void Apply(_In_ ID3D11DeviceContext* deviceContext);
};
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMap.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapFresnel.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapOneLight.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapOneLightFresnel.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapPixelLighting.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapBn.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapFresnelBn.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapOneLightBn.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapOneLightFresnelBn.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_VSEnvMapPixelLightingBn.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMap.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapNoFog.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapSpecular.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapSpecularNoFog.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapPixelLighting.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapPixelLightingNoFog.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapPixelLightingFresnel.inc"
#include "Shaders/Compiled/XboxOneEnvironmentMapEffect_PSEnvMapPixelLightingFresnelNoFog.inc"
#else
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMap.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapFresnel.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapOneLight.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapOneLightFresnel.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapPixelLighting.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapBn.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapFresnelBn.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapOneLightBn.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapOneLightFresnelBn.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_VSEnvMapPixelLightingBn.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMap.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapNoFog.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapSpecular.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapSpecularNoFog.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapPixelLighting.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapPixelLightingNoFog.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapPixelLightingFresnel.inc"
#include "Shaders/Compiled/EnvironmentMapEffect_PSEnvMapPixelLightingFresnelNoFog.inc"
#endif
}
template<>
const ShaderBytecode EffectBase<EnvironmentMapEffectTraits>::VertexShaderBytecode[] =
{
{ EnvironmentMapEffect_VSEnvMap, sizeof(EnvironmentMapEffect_VSEnvMap) },
{ EnvironmentMapEffect_VSEnvMapFresnel, sizeof(EnvironmentMapEffect_VSEnvMapFresnel) },
{ EnvironmentMapEffect_VSEnvMapOneLight, sizeof(EnvironmentMapEffect_VSEnvMapOneLight) },
{ EnvironmentMapEffect_VSEnvMapOneLightFresnel, sizeof(EnvironmentMapEffect_VSEnvMapOneLightFresnel) },
{ EnvironmentMapEffect_VSEnvMapPixelLighting, sizeof(EnvironmentMapEffect_VSEnvMapPixelLighting) },
{ EnvironmentMapEffect_VSEnvMapBn, sizeof(EnvironmentMapEffect_VSEnvMapBn) },
{ EnvironmentMapEffect_VSEnvMapFresnelBn, sizeof(EnvironmentMapEffect_VSEnvMapFresnelBn) },
{ EnvironmentMapEffect_VSEnvMapOneLightBn, sizeof(EnvironmentMapEffect_VSEnvMapOneLightBn) },
{ EnvironmentMapEffect_VSEnvMapOneLightFresnelBn, sizeof(EnvironmentMapEffect_VSEnvMapOneLightFresnelBn) },
{ EnvironmentMapEffect_VSEnvMapPixelLightingBn, sizeof(EnvironmentMapEffect_VSEnvMapPixelLightingBn) },
};
template<>
const int EffectBase<EnvironmentMapEffectTraits>::VertexShaderIndices[] =
{
0, // basic
0, // basic, no fog
1, // fresnel
1, // fresnel, no fog
0, // specular
0, // specular, no fog
1, // fresnel + specular
1, // fresnel + specular, no fog
2, // one light
2, // one light, no fog
3, // one light, fresnel
3, // one light, fresnel, no fog
2, // one light, specular
2, // one light, specular, no fog
3, // one light, fresnel + specular
3, // one light, fresnel + specular, no fog
4, // pixel lighting
4, // pixel lighting, no fog
4, // pixel lighting, fresnel
4, // pixel lighting, fresnel, no fog
5, // basic (biased vertex normals)
5, // basic (biased vertex normals), no fog
6, // fresnel (biased vertex normals)
6, // fresnel (biased vertex normals), no fog
5, // specular (biased vertex normals)
5, // specular (biased vertex normals), no fog
6, // fresnel + specular (biased vertex normals)
6, // fresnel + specular (biased vertex normals), no fog
7, // one light (biased vertex normals)
7, // one light (biased vertex normals), no fog
8, // one light (biased vertex normals), fresnel
8, // one light (biased vertex normals), fresnel, no fog
7, // one light (biased vertex normals), specular
7, // one light (biased vertex normals), specular, no fog
8, // one light (biased vertex normals), fresnel + specular
8, // one light (biased vertex normals), fresnel + specular, no fog
9, // pixel lighting (biased vertex normals)
9, // pixel lighting (biased vertex normals), no fog
9, // pixel lighting (biased vertex normals), fresnel
9, // pixel lighting (biased vertex normals), fresnel, no fog
};
template<>
const ShaderBytecode EffectBase<EnvironmentMapEffectTraits>::PixelShaderBytecode[] =
{
{ EnvironmentMapEffect_PSEnvMap, sizeof(EnvironmentMapEffect_PSEnvMap) },
{ EnvironmentMapEffect_PSEnvMapNoFog, sizeof(EnvironmentMapEffect_PSEnvMapNoFog) },
{ EnvironmentMapEffect_PSEnvMapSpecular, sizeof(EnvironmentMapEffect_PSEnvMapSpecular) },
{ EnvironmentMapEffect_PSEnvMapSpecularNoFog, sizeof(EnvironmentMapEffect_PSEnvMapSpecularNoFog) },
{ EnvironmentMapEffect_PSEnvMapPixelLighting, sizeof(EnvironmentMapEffect_PSEnvMapPixelLighting) },
{ EnvironmentMapEffect_PSEnvMapPixelLightingNoFog, sizeof(EnvironmentMapEffect_PSEnvMapPixelLightingNoFog) },
{ EnvironmentMapEffect_PSEnvMapPixelLightingFresnel, sizeof(EnvironmentMapEffect_PSEnvMapPixelLightingFresnel) },
{ EnvironmentMapEffect_PSEnvMapPixelLightingFresnelNoFog, sizeof(EnvironmentMapEffect_PSEnvMapPixelLightingFresnelNoFog) },
};
template<>
const int EffectBase<EnvironmentMapEffectTraits>::PixelShaderIndices[] =
{
0, // basic
1, // basic, no fog
0, // fresnel
1, // fresnel, no fog
2, // specular
3, // specular, no fog
2, // fresnel + specular
3, // fresnel + specular, no fog
0, // one light
1, // one light, no fog
0, // one light, fresnel
1, // one light, fresnel, no fog
2, // one light, specular
3, // one light, specular, no fog
2, // one light, fresnel + specular
3, // one light, fresnel + specular, no fog
4, // per pixel lighting
5, // per pixel lighting, no fog
6, // per pixel lighting, fresnel
7, // per pixel lighting, fresnel, no fog
0, // basic (biased vertex normals)
1, // basic (biased vertex normals), no fog
0, // fresnel (biased vertex normals)
1, // fresnel (biased vertex normals), no fog
2, // specular (biased vertex normals)
3, // specular (biased vertex normals), no fog
2, // fresnel + specular (biased vertex normals)
3, // fresnel + specular (biased vertex normals), no fog
0, // one light (biased vertex normals)
1, // one light (biased vertex normals), no fog
0, // one light (biased vertex normals), fresnel
1, // one light (biased vertex normals), fresnel, no fog
2, // one light (biased vertex normals), specular
3, // one light (biased vertex normals), specular, no fog
2, // one light (biased vertex normals), fresnel + specular
3, // one light (biased vertex normals), fresnel + specular, no fog
4, // per pixel lighting (biased vertex normals)
5, // per pixel lighting (biased vertex normals), no fog
6, // per pixel lighting (biased vertex normals), fresnel
7, // per pixel lighting (biased vertex normals), fresnel, no fog
};
// Global pool of per-device EnvironmentMapEffect resources.
SharedResourcePool<ID3D11Device*, EffectBase<EnvironmentMapEffectTraits>::DeviceResources> EffectBase<EnvironmentMapEffectTraits>::deviceResourcesPool;
// Constructor.
EnvironmentMapEffect::Impl::Impl(_In_ ID3D11Device* device)
: EffectBase(device),
preferPerPixelLighting(false),
fresnelEnabled(true),
specularEnabled(false),
biasedVertexNormals(false)
{
static_assert( _countof(EffectBase<EnvironmentMapEffectTraits>::VertexShaderIndices) == EnvironmentMapEffectTraits::ShaderPermutationCount, "array/max mismatch" );
static_assert( _countof(EffectBase<EnvironmentMapEffectTraits>::VertexShaderBytecode) == EnvironmentMapEffectTraits::VertexShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<EnvironmentMapEffectTraits>::PixelShaderBytecode) == EnvironmentMapEffectTraits::PixelShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<EnvironmentMapEffectTraits>::PixelShaderIndices) == EnvironmentMapEffectTraits::ShaderPermutationCount, "array/max mismatch" );
constants.environmentMapAmount = 1;
constants.fresnelFactor = 1;
XMVECTOR unwantedOutput[MaxDirectionalLights];
lights.InitializeConstants(unwantedOutput[0], constants.lightDirection, constants.lightDiffuseColor, unwantedOutput);
}
int EnvironmentMapEffect::Impl::GetCurrentShaderPermutation() const
{
int permutation = 0;
// Use optimized shaders if fog is disabled.
if (!fog.enabled)
{
permutation += 1;
}
// Support fresnel?
if (fresnelEnabled)
{
permutation += 2;
}
if (preferPerPixelLighting)
{
permutation += 16;
}
else
{
// Support specular?
if (specularEnabled)
{
permutation += 4;
}
// Use the only-bother-with-the-first-light shader optimization?
if (!lights.lightEnabled[1] && !lights.lightEnabled[2])
{
permutation += 8;
}
}
if (biasedVertexNormals)
{
// Compressed normals need to be scaled and biased in the vertex shader.
permutation += 20;
}
return permutation;
}
// Sets our state onto the D3D device.
void EnvironmentMapEffect::Impl::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
// Compute derived parameter values.
matrices.SetConstants(dirtyFlags, constants.worldViewProj);
fog.SetConstants(dirtyFlags, matrices.worldView, constants.fogVector);
lights.SetConstants(dirtyFlags, matrices, constants.world, constants.worldInverseTranspose, constants.eyePosition, constants.diffuseColor, constants.emissiveColor, true);
// Set the textures.
ID3D11ShaderResourceView* textures[2] =
{
texture.Get(),
environmentMap.Get(),
};
deviceContext->PSSetShaderResources(0, 2, textures);
// Set shaders and constant buffers.
ApplyShaders(deviceContext, GetCurrentShaderPermutation());
}
// Public constructor.
EnvironmentMapEffect::EnvironmentMapEffect(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
EnvironmentMapEffect::EnvironmentMapEffect(EnvironmentMapEffect&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
EnvironmentMapEffect& EnvironmentMapEffect::operator= (EnvironmentMapEffect&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
EnvironmentMapEffect::~EnvironmentMapEffect()
{
}
// IEffect methods.
void EnvironmentMapEffect::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
pImpl->Apply(deviceContext);
}
void EnvironmentMapEffect::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
pImpl->GetVertexShaderBytecode(pImpl->GetCurrentShaderPermutation(), pShaderByteCode, pByteCodeLength);
}
// Camera settings.
void XM_CALLCONV EnvironmentMapEffect::SetWorld(FXMMATRIX value)
{
pImpl->matrices.world = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV EnvironmentMapEffect::SetView(FXMMATRIX value)
{
pImpl->matrices.view = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV EnvironmentMapEffect::SetProjection(FXMMATRIX value)
{
pImpl->matrices.projection = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj;
}
void XM_CALLCONV EnvironmentMapEffect::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
pImpl->matrices.world = world;
pImpl->matrices.view = view;
pImpl->matrices.projection = projection;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
// Material settings.
void XM_CALLCONV EnvironmentMapEffect::SetDiffuseColor(FXMVECTOR value)
{
pImpl->lights.diffuseColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV EnvironmentMapEffect::SetEmissiveColor(FXMVECTOR value)
{
pImpl->lights.emissiveColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void EnvironmentMapEffect::SetAlpha(float value)
{
pImpl->lights.alpha = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV EnvironmentMapEffect::SetColorAndAlpha(FXMVECTOR value)
{
pImpl->lights.diffuseColor = value;
pImpl->lights.alpha = XMVectorGetW(value);
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
// Light settings.
void EnvironmentMapEffect::SetLightingEnabled(bool value)
{
if (!value)
{
throw std::exception("EnvironmentMapEffect does not support turning off lighting");
}
}
void EnvironmentMapEffect::SetPerPixelLighting(bool value)
{
pImpl->preferPerPixelLighting = value;
}
void XM_CALLCONV EnvironmentMapEffect::SetAmbientLightColor(FXMVECTOR value)
{
pImpl->lights.ambientLightColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void EnvironmentMapEffect::SetLightEnabled(int whichLight, bool value)
{
XMVECTOR unwantedOutput[MaxDirectionalLights] = {};
pImpl->dirtyFlags |= pImpl->lights.SetLightEnabled(whichLight, value, pImpl->constants.lightDiffuseColor, unwantedOutput);
}
void XM_CALLCONV EnvironmentMapEffect::SetLightDirection(int whichLight, FXMVECTOR value)
{
EffectLights::ValidateLightIndex(whichLight);
pImpl->constants.lightDirection[whichLight] = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void XM_CALLCONV EnvironmentMapEffect::SetLightDiffuseColor(int whichLight, FXMVECTOR value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightDiffuseColor(whichLight, value, pImpl->constants.lightDiffuseColor);
}
void XM_CALLCONV EnvironmentMapEffect::SetLightSpecularColor(int, FXMVECTOR)
{
// Unsupported interface method.
}
void EnvironmentMapEffect::EnableDefaultLighting()
{
EffectLights::EnableDefaultLighting(this);
}
// Fog settings.
void EnvironmentMapEffect::SetFogEnabled(bool value)
{
pImpl->fog.enabled = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogEnable;
}
void EnvironmentMapEffect::SetFogStart(float value)
{
pImpl->fog.start = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void EnvironmentMapEffect::SetFogEnd(float value)
{
pImpl->fog.end = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void XM_CALLCONV EnvironmentMapEffect::SetFogColor(FXMVECTOR value)
{
pImpl->constants.fogColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Texture settings.
void EnvironmentMapEffect::SetTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
}
void EnvironmentMapEffect::SetEnvironmentMap(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->environmentMap = value;
}
// Additional settings.
void EnvironmentMapEffect::SetEnvironmentMapAmount(float value)
{
pImpl->constants.environmentMapAmount = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void XM_CALLCONV EnvironmentMapEffect::SetEnvironmentMapSpecular(FXMVECTOR value)
{
pImpl->constants.environmentMapSpecular = value;
pImpl->specularEnabled = !XMVector3Equal(value, XMVectorZero());
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void EnvironmentMapEffect::SetFresnelFactor(float value)
{
pImpl->constants.fresnelFactor = value;
pImpl->fresnelEnabled = (value != 0);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Normal compression settings.
void EnvironmentMapEffect::SetBiasedVertexNormals(bool value)
{
pImpl->biasedVertexNormals = value;
}

1440
DirectXTK/Src/GamePad.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,793 @@
//--------------------------------------------------------------------------------------
// File: GeometricPrimitive.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "GeometricPrimitive.h"
#include "Effects.h"
#include "CommonStates.h"
#include "DirectXHelpers.h"
#include "SharedResourcePool.h"
#include "Geometry.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
namespace
{
// Helper for creating a D3D vertex or index buffer.
template<typename T>
static void CreateBuffer(_In_ ID3D11Device* device, T const& data, D3D11_BIND_FLAG bindFlags, _Outptr_ ID3D11Buffer** pBuffer)
{
assert(pBuffer != 0);
D3D11_BUFFER_DESC bufferDesc = {};
bufferDesc.ByteWidth = (UINT)data.size() * sizeof(typename T::value_type);
bufferDesc.BindFlags = bindFlags;
bufferDesc.Usage = D3D11_USAGE_DEFAULT;
D3D11_SUBRESOURCE_DATA dataDesc = {};
dataDesc.pSysMem = data.data();
ThrowIfFailed(
device->CreateBuffer(&bufferDesc, &dataDesc, pBuffer)
);
_Analysis_assume_(*pBuffer != 0);
SetDebugObjectName(*pBuffer, "DirectXTK:GeometricPrimitive");
}
// Helper for creating a D3D input layout.
void CreateInputLayout(_In_ ID3D11Device* device, IEffect* effect, _Outptr_ ID3D11InputLayout** pInputLayout)
{
assert(pInputLayout != 0);
void const* shaderByteCode;
size_t byteCodeLength;
effect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
ThrowIfFailed(
device->CreateInputLayout(VertexPositionNormalTexture::InputElements,
VertexPositionNormalTexture::InputElementCount,
shaderByteCode, byteCodeLength,
pInputLayout)
);
_Analysis_assume_(*pInputLayout != 0);
SetDebugObjectName(*pInputLayout, "DirectXTK:GeometricPrimitive");
}
}
// Internal GeometricPrimitive implementation class.
class GeometricPrimitive::Impl
{
public:
void Initialize(_In_ ID3D11DeviceContext* deviceContext, const VertexCollection& vertices, const IndexCollection& indices);
void XM_CALLCONV Draw(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection, FXMVECTOR color, _In_opt_ ID3D11ShaderResourceView* texture, bool wireframe, std::function<void()>& setCustomState) const;
void Draw(_In_ IEffect* effect, _In_ ID3D11InputLayout* inputLayout, bool alpha, bool wireframe, std::function<void()>& setCustomState) const;
void CreateInputLayout(_In_ IEffect* effect, _Outptr_ ID3D11InputLayout** inputLayout) const;
private:
ComPtr<ID3D11Buffer> mVertexBuffer;
ComPtr<ID3D11Buffer> mIndexBuffer;
UINT mIndexCount;
// Only one of these helpers is allocated per D3D device context, even if there are multiple GeometricPrimitive instances.
class SharedResources
{
public:
SharedResources(_In_ ID3D11DeviceContext* deviceContext);
void PrepareForRendering(bool alpha, bool wireframe) const;
ComPtr<ID3D11DeviceContext> deviceContext;
std::unique_ptr<BasicEffect> effect;
ComPtr<ID3D11InputLayout> inputLayoutTextured;
ComPtr<ID3D11InputLayout> inputLayoutUntextured;
std::unique_ptr<CommonStates> stateObjects;
};
// Per-device-context data.
std::shared_ptr<SharedResources> mResources;
static SharedResourcePool<ID3D11DeviceContext*, SharedResources> sharedResourcesPool;
};
// Global pool of per-device-context GeometricPrimitive resources.
SharedResourcePool<ID3D11DeviceContext*, GeometricPrimitive::Impl::SharedResources> GeometricPrimitive::Impl::sharedResourcesPool;
// Per-device-context constructor.
GeometricPrimitive::Impl::SharedResources::SharedResources(_In_ ID3D11DeviceContext* deviceContext)
: deviceContext(deviceContext)
{
ComPtr<ID3D11Device> device;
deviceContext->GetDevice(&device);
// Create the BasicEffect.
effect = std::make_unique<BasicEffect>(device.Get());
effect->EnableDefaultLighting();
// Create state objects.
stateObjects = std::make_unique<CommonStates>(device.Get());
// Create input layouts.
effect->SetTextureEnabled(true);
::CreateInputLayout(device.Get(), effect.get(), &inputLayoutTextured);
effect->SetTextureEnabled(false);
::CreateInputLayout(device.Get(), effect.get(), &inputLayoutUntextured);
}
// Sets up D3D device state ready for drawing a primitive.
void GeometricPrimitive::Impl::SharedResources::PrepareForRendering(bool alpha, bool wireframe) const
{
// Set the blend and depth stencil state.
ID3D11BlendState* blendState;
ID3D11DepthStencilState* depthStencilState;
if (alpha)
{
// Alpha blended rendering.
blendState = stateObjects->AlphaBlend();
depthStencilState = stateObjects->DepthRead();
}
else
{
// Opaque rendering.
blendState = stateObjects->Opaque();
depthStencilState = stateObjects->DepthDefault();
}
deviceContext->OMSetBlendState(blendState, nullptr, 0xFFFFFFFF);
deviceContext->OMSetDepthStencilState(depthStencilState, 0);
// Set the rasterizer state.
if (wireframe)
deviceContext->RSSetState(stateObjects->Wireframe());
else
deviceContext->RSSetState(stateObjects->CullCounterClockwise());
ID3D11SamplerState* samplerState = stateObjects->LinearWrap();
deviceContext->PSSetSamplers(0, 1, &samplerState);
}
// Initializes a geometric primitive instance that will draw the specified vertex and index data.
_Use_decl_annotations_
void GeometricPrimitive::Impl::Initialize(ID3D11DeviceContext* deviceContext, const VertexCollection& vertices, const IndexCollection& indices)
{
if (vertices.size() >= USHRT_MAX)
throw std::exception("Too many vertices for 16-bit index buffer");
mResources = sharedResourcesPool.DemandCreate(deviceContext);
ComPtr<ID3D11Device> device;
deviceContext->GetDevice(&device);
CreateBuffer(device.Get(), vertices, D3D11_BIND_VERTEX_BUFFER, &mVertexBuffer);
CreateBuffer(device.Get(), indices, D3D11_BIND_INDEX_BUFFER, &mIndexBuffer);
mIndexCount = static_cast<UINT>(indices.size());
}
// Draws the primitive.
_Use_decl_annotations_
void XM_CALLCONV GeometricPrimitive::Impl::Draw(
FXMMATRIX world,
CXMMATRIX view,
CXMMATRIX projection,
FXMVECTOR color,
ID3D11ShaderResourceView* texture,
bool wireframe,
std::function<void()>& setCustomState) const
{
assert(mResources != 0);
auto effect = mResources->effect.get();
assert(effect != 0);
ID3D11InputLayout *inputLayout;
if (texture)
{
effect->SetTextureEnabled(true);
effect->SetTexture(texture);
inputLayout = mResources->inputLayoutTextured.Get();
}
else
{
effect->SetTextureEnabled(false);
inputLayout = mResources->inputLayoutUntextured.Get();
}
// Set effect parameters.
effect->SetMatrices(world, view, projection);
effect->SetColorAndAlpha(color);
float alpha = XMVectorGetW(color);
Draw(effect, inputLayout, (alpha < 1.f), wireframe, setCustomState);
}
// Draw the primitive using a custom effect.
_Use_decl_annotations_
void GeometricPrimitive::Impl::Draw(
IEffect* effect,
ID3D11InputLayout* inputLayout,
bool alpha,
bool wireframe,
std::function<void()>& setCustomState) const
{
assert(mResources != 0);
auto deviceContext = mResources->deviceContext.Get();
assert(deviceContext != 0);
// Set state objects.
mResources->PrepareForRendering(alpha, wireframe);
// Set input layout.
assert(inputLayout != 0);
deviceContext->IASetInputLayout(inputLayout);
// Activate our shaders, constant buffers, texture, etc.
assert(effect != 0);
effect->Apply(deviceContext);
// Set the vertex and index buffer.
auto vertexBuffer = mVertexBuffer.Get();
UINT vertexStride = sizeof(VertexPositionNormalTexture);
UINT vertexOffset = 0;
deviceContext->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &vertexOffset);
deviceContext->IASetIndexBuffer(mIndexBuffer.Get(), DXGI_FORMAT_R16_UINT, 0);
// Hook lets the caller replace our shaders or state settings with whatever else they see fit.
if (setCustomState)
{
setCustomState();
}
// Draw the primitive.
deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
deviceContext->DrawIndexed(mIndexCount, 0, 0);
}
// Create input layout for drawing with a custom effect.
_Use_decl_annotations_
void GeometricPrimitive::Impl::CreateInputLayout(IEffect* effect, ID3D11InputLayout** inputLayout) const
{
assert(effect != 0);
assert(inputLayout != 0);
assert(mResources != 0);
auto deviceContext = mResources->deviceContext.Get();
assert(deviceContext != 0);
ComPtr<ID3D11Device> device;
deviceContext->GetDevice(&device);
::CreateInputLayout(device.Get(), effect, inputLayout);
}
//--------------------------------------------------------------------------------------
// GeometricPrimitive
//--------------------------------------------------------------------------------------
// Constructor.
GeometricPrimitive::GeometricPrimitive()
: pImpl(new Impl())
{
}
// Destructor.
GeometricPrimitive::~GeometricPrimitive()
{
}
// Public entrypoints.
_Use_decl_annotations_
void XM_CALLCONV GeometricPrimitive::Draw(
FXMMATRIX world,
CXMMATRIX view,
CXMMATRIX projection,
FXMVECTOR color,
ID3D11ShaderResourceView* texture,
bool wireframe,
std::function<void()> setCustomState) const
{
pImpl->Draw(world, view, projection, color, texture, wireframe, setCustomState);
}
_Use_decl_annotations_
void GeometricPrimitive::Draw(
IEffect* effect,
ID3D11InputLayout* inputLayout,
bool alpha,
bool wireframe,
std::function<void()> setCustomState) const
{
pImpl->Draw(effect, inputLayout, alpha, wireframe, setCustomState);
}
_Use_decl_annotations_
void GeometricPrimitive::CreateInputLayout(IEffect* effect, ID3D11InputLayout** inputLayout) const
{
pImpl->CreateInputLayout(effect, inputLayout);
}
//--------------------------------------------------------------------------------------
// Cube (aka a Hexahedron) or Box
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateCube(
ID3D11DeviceContext* deviceContext,
float size,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeBox(vertices, indices, XMFLOAT3(size, size, size), rhcoords, false);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateCube(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float size,
bool rhcoords)
{
ComputeBox(vertices, indices, XMFLOAT3(size, size, size), rhcoords, false);
}
// Creates a box primitive.
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateBox(
ID3D11DeviceContext* deviceContext,
const XMFLOAT3& size,
bool rhcoords,
bool invertn)
{
VertexCollection vertices;
IndexCollection indices;
ComputeBox(vertices, indices, size, rhcoords, invertn);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateBox(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
const XMFLOAT3& size,
bool rhcoords,
bool invertn)
{
ComputeBox(vertices, indices, size, rhcoords, invertn);
}
//--------------------------------------------------------------------------------------
// Sphere
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateSphere(
ID3D11DeviceContext* deviceContext,
float diameter,
size_t tessellation,
bool rhcoords,
bool invertn)
{
VertexCollection vertices;
IndexCollection indices;
ComputeSphere(vertices, indices, diameter, tessellation, rhcoords, invertn);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateSphere(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float diameter,
size_t tessellation,
bool rhcoords,
bool invertn)
{
ComputeSphere(vertices, indices, diameter, tessellation, rhcoords, invertn);
}
//--------------------------------------------------------------------------------------
// Geodesic sphere
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateGeoSphere(
ID3D11DeviceContext* deviceContext,
float diameter,
size_t tessellation,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeGeoSphere(vertices, indices, diameter, tessellation, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateGeoSphere(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float diameter,
size_t tessellation, bool rhcoords)
{
ComputeGeoSphere(vertices, indices, diameter, tessellation, rhcoords);
}
//--------------------------------------------------------------------------------------
// Cylinder / Cone
//--------------------------------------------------------------------------------------
// Creates a cylinder primitive.
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateCylinder(
ID3D11DeviceContext* deviceContext,
float height,
float diameter,
size_t tessellation,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeCylinder(vertices, indices, height, diameter, tessellation, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateCylinder(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float height,
float diameter,
size_t tessellation,
bool rhcoords)
{
ComputeCylinder(vertices, indices, height, diameter, tessellation, rhcoords);
}
// Creates a cone primitive.
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateCone(
ID3D11DeviceContext* deviceContext,
float diameter,
float height,
size_t tessellation,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeCone(vertices, indices, diameter, height, tessellation, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateCone(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float diameter,
float height,
size_t tessellation,
bool rhcoords)
{
ComputeCone(vertices, indices, diameter, height, tessellation, rhcoords);
}
//--------------------------------------------------------------------------------------
// Torus
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateTorus(
ID3D11DeviceContext* deviceContext,
float diameter,
float thickness,
size_t tessellation,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeTorus(vertices, indices, diameter, thickness, tessellation, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateTorus(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float diameter,
float thickness,
size_t tessellation,
bool rhcoords)
{
ComputeTorus(vertices, indices, diameter, thickness, tessellation, rhcoords);
}
//--------------------------------------------------------------------------------------
// Tetrahedron
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateTetrahedron(
ID3D11DeviceContext* deviceContext,
float size,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeTetrahedron(vertices, indices, size, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateTetrahedron(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float size,
bool rhcoords)
{
ComputeTetrahedron(vertices, indices, size, rhcoords);
}
//--------------------------------------------------------------------------------------
// Octahedron
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateOctahedron(
ID3D11DeviceContext* deviceContext,
float size,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeOctahedron(vertices, indices, size, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateOctahedron(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float size,
bool rhcoords)
{
ComputeOctahedron(vertices, indices, size, rhcoords);
}
//--------------------------------------------------------------------------------------
// Dodecahedron
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateDodecahedron(
ID3D11DeviceContext* deviceContext,
float size,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeDodecahedron(vertices, indices, size, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateDodecahedron(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float size,
bool rhcoords)
{
ComputeDodecahedron(vertices, indices, size, rhcoords);
}
//--------------------------------------------------------------------------------------
// Icosahedron
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateIcosahedron(
ID3D11DeviceContext* deviceContext,
float size,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeIcosahedron(vertices, indices, size, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateIcosahedron(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float size,
bool rhcoords)
{
ComputeIcosahedron(vertices, indices, size, rhcoords);
}
//--------------------------------------------------------------------------------------
// Teapot
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateTeapot(
ID3D11DeviceContext* deviceContext,
float size,
size_t tessellation,
bool rhcoords)
{
VertexCollection vertices;
IndexCollection indices;
ComputeTeapot(vertices, indices, size, tessellation, rhcoords);
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}
void GeometricPrimitive::CreateTeapot(
std::vector<VertexPositionNormalTexture>& vertices,
std::vector<uint16_t>& indices,
float size,
size_t tessellation,
bool rhcoords)
{
ComputeTeapot(vertices, indices, size, tessellation, rhcoords);
}
//--------------------------------------------------------------------------------------
// Custom
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<GeometricPrimitive> GeometricPrimitive::CreateCustom(
ID3D11DeviceContext* deviceContext,
const std::vector<VertexPositionNormalTexture>& vertices,
const std::vector<uint16_t>& indices)
{
// Extra validation
if (vertices.empty() || indices.empty())
throw std::exception("Requires both vertices and indices");
if (indices.size() % 3)
throw std::exception("Expected triangular faces");
size_t nVerts = vertices.size();
if (nVerts >= USHRT_MAX)
throw std::exception("Too many vertices for 16-bit index buffer");
for (auto it = indices.cbegin(); it != indices.cend(); ++it)
{
if (*it >= nVerts)
{
throw std::exception("Index not in vertices list");
}
}
// Create the primitive object.
std::unique_ptr<GeometricPrimitive> primitive(new GeometricPrimitive());
primitive->pImpl->Initialize(deviceContext, vertices, indices);
return primitive;
}

1184
DirectXTK/Src/Geometry.cpp Normal file

File diff suppressed because it is too large Load Diff

32
DirectXTK/Src/Geometry.h Normal file
View File

@@ -0,0 +1,32 @@
//--------------------------------------------------------------------------------------
// File: Geometry.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "VertexTypes.h"
namespace DirectX
{
typedef std::vector<DirectX::VertexPositionNormalTexture> VertexCollection;
typedef std::vector<uint16_t> IndexCollection;
void ComputeBox(VertexCollection& vertices, IndexCollection& indices, const XMFLOAT3& size, bool rhcoords, bool invertn);
void ComputeSphere(VertexCollection& vertices, IndexCollection& indices, float diameter, size_t tessellation, bool rhcoords, bool invertn);
void ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indices, float diameter, size_t tessellation, bool rhcoords);
void ComputeCylinder(VertexCollection& vertices, IndexCollection& indices, float height, float diameter, size_t tessellation, bool rhcoords);
void ComputeCone(VertexCollection& vertices, IndexCollection& indices, float diameter, float height, size_t tessellation, bool rhcoords);
void ComputeTorus(VertexCollection& vertices, IndexCollection& indices, float diameter, float thickness, size_t tessellation, bool rhcoords);
void ComputeTetrahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
void ComputeOctahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
void ComputeDodecahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
void ComputeIcosahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
void ComputeTeapot(VertexCollection& vertices, IndexCollection& indices, float size, size_t tessellation, bool rhcoords);
}

View File

@@ -0,0 +1,334 @@
//--------------------------------------------------------------------------------------
// File: GraphicsMemory.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "GraphicsMemory.h"
#include "PlatformHelpers.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
namespace
{
template <typename T> __forceinline T AlignUp(T value, size_t alignment)
{
assert(((alignment - 1) & alignment) == 0);
return static_cast<T>( (static_cast<size_t>(value) + alignment - 1) & ~(alignment - 1) );
}
}
#if defined(_XBOX_ONE) && defined(_TITLE)
//======================================================================================
// Xbox One Direct3D 11.x
//======================================================================================
class GraphicsMemory::Impl
{
public:
Impl(GraphicsMemory* owner) :
mOwner(owner),
mCurrentFrame(0)
{
if (s_graphicsMemory)
{
throw std::exception("GraphicsMemory is a singleton");
}
s_graphicsMemory = this;
}
~Impl()
{
if (mDevice && mDeviceContext)
{
UINT64 finalFence = mDeviceContext->InsertFence(0);
while (mDevice->IsFencePending(finalFence))
{
SwitchToThread();
}
mDeviceContext.Reset();
mDevice.Reset();
}
s_graphicsMemory = nullptr;
}
void Initialize(_In_ ID3D11DeviceX* device, UINT backBufferCount)
{
assert( device != 0 );
mDevice = device;
device->GetImmediateContextX( mDeviceContext.GetAddressOf() );
mFrames.resize( backBufferCount );
}
void* Allocate(_In_opt_ ID3D11DeviceContext* deviceContext, size_t size, int alignment)
{
// Currently use a single global allocator instead of a per-context allocator
UNREFERENCED_PARAMETER(deviceContext);
std::lock_guard<std::mutex> lock(mGuard);
return mFrames[mCurrentFrame].Allocate(size, alignment);
}
void Commit()
{
std::lock_guard<std::mutex> lock(mGuard);
mFrames[mCurrentFrame].mFence = mDeviceContext->InsertFence(D3D11_INSERT_FENCE_NO_KICKOFF);
++mCurrentFrame;
if (mCurrentFrame >= mFrames.size())
{
mCurrentFrame = 0;
}
mFrames[mCurrentFrame].WaitOnFence(mDevice.Get());
mFrames[mCurrentFrame].Clear();
}
GraphicsMemory* mOwner;
std::mutex mGuard;
struct MemoryPage
{
MemoryPage() : mPageSize(0), mGrfxMemory(nullptr) {}
void Initialize(size_t reqSize)
{
mPageSize = 0x100000; // 1 MB general pages for Xbox One
if (mPageSize < reqSize)
{
mPageSize = AlignUp(reqSize, 65536);
}
mGrfxMemory = VirtualAlloc(nullptr, mPageSize,
MEM_LARGE_PAGES | MEM_GRAPHICS | MEM_RESERVE | MEM_COMMIT,
PAGE_WRITECOMBINE | PAGE_READWRITE | PAGE_GPU_READONLY);
if (!mGrfxMemory)
throw std::bad_alloc();
}
size_t mPageSize;
void* mGrfxMemory;
};
struct MemoryFrame
{
MemoryFrame() : mCurOffset(0), mFence(0) {}
~MemoryFrame() { Clear(); }
UINT mCurOffset;
UINT64 mFence;
void* Allocate(size_t size, size_t alignment)
{
size_t alignedSize = AlignUp(size, alignment);
if (mPages.empty())
{
MemoryPage newPage;
newPage.Initialize(alignedSize);
mCurOffset = 0;
mPages.emplace_back(newPage);
}
else
{
mCurOffset = AlignUp(mCurOffset, alignment);
if (mCurOffset + alignedSize > mPages.front().mPageSize)
{
MemoryPage newPage;
newPage.Initialize(alignedSize);
mCurOffset = 0;
mPages.emplace_front(newPage);
}
}
void* ptr = static_cast<uint8_t*>(mPages.front().mGrfxMemory) + mCurOffset;
mCurOffset += static_cast<UINT>( alignedSize );
return ptr;
}
void WaitOnFence(ID3D11DeviceX* device)
{
if (mFence)
{
while (device->IsFencePending(mFence))
{
SwitchToThread();
}
mFence = 0;
}
}
void Clear()
{
for (auto it = mPages.begin(); it != mPages.end(); ++it)
{
if (it->mGrfxMemory)
{
VirtualFree(it->mGrfxMemory, 0, MEM_RELEASE);
it->mGrfxMemory = nullptr;
}
}
mPages.clear();
mCurOffset = 0;
}
std::list<MemoryPage> mPages;
};
UINT mCurrentFrame;
std::vector<MemoryFrame> mFrames;
ComPtr<ID3D11DeviceX> mDevice;
ComPtr<ID3D11DeviceContextX> mDeviceContext;
static GraphicsMemory::Impl* s_graphicsMemory;
};
GraphicsMemory::Impl* GraphicsMemory::Impl::s_graphicsMemory = nullptr;
#else
//======================================================================================
// Null allocator for standard Direct3D
//======================================================================================
class GraphicsMemory::Impl
{
public:
Impl(GraphicsMemory* owner) :
mOwner(owner)
{
if (s_graphicsMemory)
{
throw std::exception("GraphicsMemory is a singleton");
}
s_graphicsMemory = this;
}
~Impl()
{
s_graphicsMemory = nullptr;
}
void Initialize(_In_ ID3D11Device* device, UINT backBufferCount)
{
UNREFERENCED_PARAMETER(device);
UNREFERENCED_PARAMETER(backBufferCount);
}
void* Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment)
{
UNREFERENCED_PARAMETER(context);
UNREFERENCED_PARAMETER(size);
UNREFERENCED_PARAMETER(alignment);
return nullptr;
}
void Commit()
{
}
GraphicsMemory* mOwner;
static GraphicsMemory::Impl* s_graphicsMemory;
};
GraphicsMemory::Impl* GraphicsMemory::Impl::s_graphicsMemory = nullptr;
#endif
//--------------------------------------------------------------------------------------
#pragma warning( disable : 4355 )
// Public constructor.
#if defined(_XBOX_ONE) && defined(_TITLE)
GraphicsMemory::GraphicsMemory(_In_ ID3D11DeviceX* device, UINT backBufferCount)
#else
GraphicsMemory::GraphicsMemory(_In_ ID3D11Device* device, UINT backBufferCount)
#endif
: pImpl(new Impl(this))
{
pImpl->Initialize(device, backBufferCount);
}
// Move constructor.
GraphicsMemory::GraphicsMemory(GraphicsMemory&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
pImpl->mOwner = this;
}
// Move assignment.
GraphicsMemory& GraphicsMemory::operator= (GraphicsMemory&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
pImpl->mOwner = this;
return *this;
}
// Public destructor.
GraphicsMemory::~GraphicsMemory()
{
}
void* GraphicsMemory::Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment)
{
return pImpl->Allocate(context, size, alignment);
}
void GraphicsMemory::Commit()
{
pImpl->Commit();
}
GraphicsMemory& GraphicsMemory::Get()
{
if (!Impl::s_graphicsMemory || !Impl::s_graphicsMemory->mOwner)
throw std::exception("GraphicsMemory singleton not created");
return *Impl::s_graphicsMemory->mOwner;
}

557
DirectXTK/Src/Keyboard.cpp Normal file
View File

@@ -0,0 +1,557 @@
//--------------------------------------------------------------------------------------
// File: Keyboard.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Keyboard.h"
#include "PlatformHelpers.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
static_assert(sizeof(Keyboard::State) == (256 / 8), "Size mismatch for State");
namespace
{
void KeyDown(int key, Keyboard::State& state)
{
if (key < 0 || key > 0xfe)
return;
auto ptr = reinterpret_cast<uint32_t*>(&state);
unsigned int bf = 1u << (key & 0x1f);
ptr[(key >> 5)] |= bf;
}
void KeyUp(int key, Keyboard::State& state)
{
if (key < 0 || key > 0xfe)
return;
auto ptr = reinterpret_cast<uint32_t*>(&state);
unsigned int bf = 1u << (key & 0x1f);
ptr[(key >> 5)] &= ~bf;
}
}
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
//======================================================================================
// Windows Store or Universal Windows Platform (UWP) app implementation
//======================================================================================
//
// For a Windows Store app or Universal Windows Platform (UWP) app, add the following:
//
// void App::SetWindow(CoreWindow^ window )
// {
// m_keyboard->SetWindow(window);
// }
//
#include <Windows.Devices.Input.h>
class Keyboard::Impl
{
public:
Impl(Keyboard* owner) :
mOwner(owner)
{
mAcceleratorKeyToken.value = 0;
mActivatedToken.value = 0;
if ( s_keyboard )
{
throw std::exception( "Keyboard is a singleton" );
}
s_keyboard = this;
memset( &mState, 0, sizeof(State) );
}
~Impl()
{
s_keyboard = nullptr;
RemoveHandlers();
}
void GetState(State& state) const
{
memcpy( &state, &mState, sizeof(State) );
}
void Reset()
{
memset( &mState, 0, sizeof(State) );
}
bool IsConnected() const
{
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Devices::Input;
using namespace ABI::Windows::Foundation;
ComPtr<IKeyboardCapabilities> caps;
HRESULT hr = RoActivateInstance(HStringReference(RuntimeClass_Windows_Devices_Input_KeyboardCapabilities).Get(), &caps);
ThrowIfFailed(hr);
INT32 value;
if (SUCCEEDED(caps->get_KeyboardPresent(&value)))
{
return value != 0;
}
return false;
}
void SetWindow(ABI::Windows::UI::Core::ICoreWindow* window)
{
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::UI::Core;
if (mWindow.Get() == window)
return;
RemoveHandlers();
mWindow = window;
if (!window)
return;
typedef __FITypedEventHandler_2_Windows__CUI__CCore__CCoreWindow_Windows__CUI__CCore__CWindowActivatedEventArgs ActivatedHandler;
HRESULT hr = window->add_Activated(Callback<ActivatedHandler>(Activated).Get(), &mActivatedToken);
ThrowIfFailed(hr);
ComPtr<ICoreDispatcher> dispatcher;
hr = window->get_Dispatcher( dispatcher.GetAddressOf() );
ThrowIfFailed(hr);
ComPtr<ICoreAcceleratorKeys> keys;
hr = dispatcher.As(&keys);
ThrowIfFailed(hr);
typedef __FITypedEventHandler_2_Windows__CUI__CCore__CCoreDispatcher_Windows__CUI__CCore__CAcceleratorKeyEventArgs AcceleratorKeyHandler;
hr = keys->add_AcceleratorKeyActivated( Callback<AcceleratorKeyHandler>(AcceleratorKeyEvent).Get(), &mAcceleratorKeyToken);
ThrowIfFailed(hr);
}
State mState;
Keyboard* mOwner;
static Keyboard::Impl* s_keyboard;
private:
ComPtr<ABI::Windows::UI::Core::ICoreWindow> mWindow;
EventRegistrationToken mAcceleratorKeyToken;
EventRegistrationToken mActivatedToken;
void RemoveHandlers()
{
if (mWindow)
{
using namespace ABI::Windows::UI::Core;
ComPtr<ICoreDispatcher> dispatcher;
HRESULT hr = mWindow->get_Dispatcher( dispatcher.GetAddressOf() );
ThrowIfFailed(hr);
(void)mWindow->remove_Activated(mActivatedToken);
mActivatedToken.value = 0;
ComPtr<ICoreAcceleratorKeys> keys;
hr = dispatcher.As(&keys);
ThrowIfFailed(hr);
(void)keys->remove_AcceleratorKeyActivated(mAcceleratorKeyToken);
mAcceleratorKeyToken.value = 0;
}
}
static HRESULT Activated( IInspectable *, ABI::Windows::UI::Core::IWindowActivatedEventArgs* )
{
auto pImpl = Impl::s_keyboard;
if (!pImpl)
return S_OK;
pImpl->Reset();
return S_OK;
}
static HRESULT AcceleratorKeyEvent( IInspectable *, ABI::Windows::UI::Core::IAcceleratorKeyEventArgs* args )
{
using namespace ABI::Windows::System;
using namespace ABI::Windows::UI::Core;
auto pImpl = Impl::s_keyboard;
if (!pImpl)
return S_OK;
CoreAcceleratorKeyEventType evtType;
HRESULT hr = args->get_EventType(&evtType);
ThrowIfFailed(hr);
bool down = false;
switch (evtType)
{
case CoreAcceleratorKeyEventType_KeyDown:
case CoreAcceleratorKeyEventType_SystemKeyDown:
down = true;
break;
case CoreAcceleratorKeyEventType_KeyUp:
case CoreAcceleratorKeyEventType_SystemKeyUp:
break;
default:
return S_OK;
}
CorePhysicalKeyStatus status;
hr = args->get_KeyStatus(&status);
ThrowIfFailed(hr);
VirtualKey virtualKey;
hr = args->get_VirtualKey(&virtualKey);
ThrowIfFailed(hr);
int vk = static_cast<int>( virtualKey );
switch (vk)
{
case VK_SHIFT:
vk = (status.ScanCode == 0x36) ? VK_RSHIFT : VK_LSHIFT;
if ( !down )
{
// Workaround to ensure left vs. right shift get cleared when both were pressed at same time
KeyUp(VK_LSHIFT, pImpl->mState);
KeyUp(VK_RSHIFT, pImpl->mState);
}
break;
case VK_CONTROL:
vk = (status.IsExtendedKey) ? VK_RCONTROL : VK_LCONTROL;
break;
case VK_MENU:
vk = (status.IsExtendedKey) ? VK_RMENU : VK_LMENU;
break;
}
if (down)
{
KeyDown(vk, pImpl->mState);
}
else
{
KeyUp(vk, pImpl->mState);
}
return S_OK;
}
};
Keyboard::Impl* Keyboard::Impl::s_keyboard = nullptr;
void Keyboard::SetWindow(ABI::Windows::UI::Core::ICoreWindow* window)
{
pImpl->SetWindow(window);
}
#elif defined(_XBOX_ONE) || ( defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) )
//======================================================================================
// Null device for Windows Phone and Xbox One
//======================================================================================
class Keyboard::Impl
{
public:
Impl(Keyboard* owner) :
mOwner(owner)
{
if ( s_keyboard )
{
throw std::exception( "Keyboard is a singleton" );
}
s_keyboard = this;
}
~Impl()
{
s_keyboard = nullptr;
}
void GetState(State& state) const
{
memset( &state, 0, sizeof(State) );
}
void Reset()
{
}
bool IsConnected() const
{
return false;
}
Keyboard* mOwner;
static Keyboard::Impl* s_keyboard;
};
Keyboard::Impl* Keyboard::Impl::s_keyboard = nullptr;
#else
//======================================================================================
// Win32 desktop implementation
//======================================================================================
//
// For a Win32 desktop application, call this function from your Window Message Procedure
//
// LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
// {
// switch (message)
// {
//
// case WM_ACTIVATEAPP:
// Keyboard::ProcessMessage(message, wParam, lParam);
// break;
//
// case WM_KEYDOWN:
// case WM_SYSKEYDOWN:
// case WM_KEYUP:
// case WM_SYSKEYUP:
// Keyboard::ProcessMessage(message, wParam, lParam);
// break;
//
// }
// }
//
class Keyboard::Impl
{
public:
Impl(Keyboard* owner) :
mOwner(owner)
{
if ( s_keyboard )
{
throw std::exception( "Keyboard is a singleton" );
}
s_keyboard = this;
memset( &mState, 0, sizeof(State) );
}
~Impl()
{
s_keyboard = nullptr;
}
void GetState(State& state) const
{
memcpy( &state, &mState, sizeof(State) );
}
void Reset()
{
memset( &mState, 0, sizeof(State) );
}
bool IsConnected() const
{
return true;
}
State mState;
Keyboard* mOwner;
static Keyboard::Impl* s_keyboard;
};
Keyboard::Impl* Keyboard::Impl::s_keyboard = nullptr;
void Keyboard::ProcessMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
auto pImpl = Impl::s_keyboard;
if (!pImpl)
return;
bool down = false;
switch (message)
{
case WM_ACTIVATEAPP:
pImpl->Reset();
return;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
down = true;
break;
case WM_KEYUP:
case WM_SYSKEYUP:
break;
default:
return;
}
int vk = static_cast<int>( wParam );
switch (vk)
{
case VK_SHIFT:
vk = MapVirtualKey((lParam & 0x00ff0000) >> 16, MAPVK_VSC_TO_VK_EX);
if ( !down )
{
// Workaround to ensure left vs. right shift get cleared when both were pressed at same time
KeyUp(VK_LSHIFT, pImpl->mState);
KeyUp(VK_RSHIFT, pImpl->mState);
}
break;
case VK_CONTROL:
vk = (lParam & 0x01000000) ? VK_RCONTROL : VK_LCONTROL;
break;
case VK_MENU:
vk = (lParam & 0x01000000) ? VK_RMENU : VK_LMENU;
break;
}
if (down)
{
KeyDown(vk, pImpl->mState);
}
else
{
KeyUp(vk, pImpl->mState);
}
}
#endif
#pragma warning( disable : 4355 )
// Public constructor.
Keyboard::Keyboard()
: pImpl( new Impl(this) )
{
}
// Move constructor.
Keyboard::Keyboard(Keyboard&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
pImpl->mOwner = this;
}
// Move assignment.
Keyboard& Keyboard::operator= (Keyboard&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
pImpl->mOwner = this;
return *this;
}
// Public destructor.
Keyboard::~Keyboard()
{
}
Keyboard::State Keyboard::GetState() const
{
State state;
pImpl->GetState(state);
return state;
}
void Keyboard::Reset()
{
pImpl->Reset();
}
bool Keyboard::IsConnected() const
{
return pImpl->IsConnected();
}
Keyboard& Keyboard::Get()
{
if ( !Impl::s_keyboard || !Impl::s_keyboard->mOwner )
throw std::exception( "Keyboard is a singleton" );
return *Impl::s_keyboard->mOwner;
}
//======================================================================================
// KeyboardStateTracker
//======================================================================================
void Keyboard::KeyboardStateTracker::Update( const State& state )
{
auto currPtr = reinterpret_cast<const uint32_t*>(&state);
auto prevPtr = reinterpret_cast<const uint32_t*>(&lastState);
auto releasedPtr = reinterpret_cast<uint32_t*>(&released);
auto pressedPtr = reinterpret_cast<uint32_t*>(&pressed);
for (size_t j = 0; j < (256 / 32); ++j)
{
*pressedPtr = *currPtr & ~(*prevPtr);
*releasedPtr = ~(*currPtr) & *prevPtr;
++currPtr;
++prevPtr;
++releasedPtr;
++pressedPtr;
}
lastState = state;
}
void Keyboard::KeyboardStateTracker::Reset()
{
memset( this, 0, sizeof(KeyboardStateTracker) );
}

View File

@@ -0,0 +1,874 @@
//--------------------------------------------------------------------------------------
// File: LoaderHelpers.h
//
// Helper functions for texture loaders and screen grabber
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#include "DDS.h"
#include "DDSTextureLoader.h"
namespace DirectX
{
namespace LoaderHelpers
{
//--------------------------------------------------------------------------------------
// Return the BPP for a particular format
//--------------------------------------------------------------------------------------
inline size_t BitsPerPixel(_In_ DXGI_FORMAT fmt)
{
switch (fmt)
{
case DXGI_FORMAT_R32G32B32A32_TYPELESS:
case DXGI_FORMAT_R32G32B32A32_FLOAT:
case DXGI_FORMAT_R32G32B32A32_UINT:
case DXGI_FORMAT_R32G32B32A32_SINT:
return 128;
case DXGI_FORMAT_R32G32B32_TYPELESS:
case DXGI_FORMAT_R32G32B32_FLOAT:
case DXGI_FORMAT_R32G32B32_UINT:
case DXGI_FORMAT_R32G32B32_SINT:
return 96;
case DXGI_FORMAT_R16G16B16A16_TYPELESS:
case DXGI_FORMAT_R16G16B16A16_FLOAT:
case DXGI_FORMAT_R16G16B16A16_UNORM:
case DXGI_FORMAT_R16G16B16A16_UINT:
case DXGI_FORMAT_R16G16B16A16_SNORM:
case DXGI_FORMAT_R16G16B16A16_SINT:
case DXGI_FORMAT_R32G32_TYPELESS:
case DXGI_FORMAT_R32G32_FLOAT:
case DXGI_FORMAT_R32G32_UINT:
case DXGI_FORMAT_R32G32_SINT:
case DXGI_FORMAT_R32G8X24_TYPELESS:
case DXGI_FORMAT_D32_FLOAT_S8X24_UINT:
case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
case DXGI_FORMAT_Y416:
case DXGI_FORMAT_Y210:
case DXGI_FORMAT_Y216:
return 64;
case DXGI_FORMAT_R10G10B10A2_TYPELESS:
case DXGI_FORMAT_R10G10B10A2_UNORM:
case DXGI_FORMAT_R10G10B10A2_UINT:
case DXGI_FORMAT_R11G11B10_FLOAT:
case DXGI_FORMAT_R8G8B8A8_TYPELESS:
case DXGI_FORMAT_R8G8B8A8_UNORM:
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
case DXGI_FORMAT_R8G8B8A8_UINT:
case DXGI_FORMAT_R8G8B8A8_SNORM:
case DXGI_FORMAT_R8G8B8A8_SINT:
case DXGI_FORMAT_R16G16_TYPELESS:
case DXGI_FORMAT_R16G16_FLOAT:
case DXGI_FORMAT_R16G16_UNORM:
case DXGI_FORMAT_R16G16_UINT:
case DXGI_FORMAT_R16G16_SNORM:
case DXGI_FORMAT_R16G16_SINT:
case DXGI_FORMAT_R32_TYPELESS:
case DXGI_FORMAT_D32_FLOAT:
case DXGI_FORMAT_R32_FLOAT:
case DXGI_FORMAT_R32_UINT:
case DXGI_FORMAT_R32_SINT:
case DXGI_FORMAT_R24G8_TYPELESS:
case DXGI_FORMAT_D24_UNORM_S8_UINT:
case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
case DXGI_FORMAT_R8G8_B8G8_UNORM:
case DXGI_FORMAT_G8R8_G8B8_UNORM:
case DXGI_FORMAT_B8G8R8A8_UNORM:
case DXGI_FORMAT_B8G8R8X8_UNORM:
case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM:
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
case DXGI_FORMAT_AYUV:
case DXGI_FORMAT_Y410:
case DXGI_FORMAT_YUY2:
return 32;
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
return 24;
case DXGI_FORMAT_R8G8_TYPELESS:
case DXGI_FORMAT_R8G8_UNORM:
case DXGI_FORMAT_R8G8_UINT:
case DXGI_FORMAT_R8G8_SNORM:
case DXGI_FORMAT_R8G8_SINT:
case DXGI_FORMAT_R16_TYPELESS:
case DXGI_FORMAT_R16_FLOAT:
case DXGI_FORMAT_D16_UNORM:
case DXGI_FORMAT_R16_UNORM:
case DXGI_FORMAT_R16_UINT:
case DXGI_FORMAT_R16_SNORM:
case DXGI_FORMAT_R16_SINT:
case DXGI_FORMAT_B5G6R5_UNORM:
case DXGI_FORMAT_B5G5R5A1_UNORM:
case DXGI_FORMAT_A8P8:
case DXGI_FORMAT_B4G4R4A4_UNORM:
return 16;
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_420_OPAQUE:
case DXGI_FORMAT_NV11:
return 12;
case DXGI_FORMAT_R8_TYPELESS:
case DXGI_FORMAT_R8_UNORM:
case DXGI_FORMAT_R8_UINT:
case DXGI_FORMAT_R8_SNORM:
case DXGI_FORMAT_R8_SINT:
case DXGI_FORMAT_A8_UNORM:
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
return 8;
case DXGI_FORMAT_R1_UNORM:
return 1;
case DXGI_FORMAT_BC1_TYPELESS:
case DXGI_FORMAT_BC1_UNORM:
case DXGI_FORMAT_BC1_UNORM_SRGB:
case DXGI_FORMAT_BC4_TYPELESS:
case DXGI_FORMAT_BC4_UNORM:
case DXGI_FORMAT_BC4_SNORM:
return 4;
case DXGI_FORMAT_BC2_TYPELESS:
case DXGI_FORMAT_BC2_UNORM:
case DXGI_FORMAT_BC2_UNORM_SRGB:
case DXGI_FORMAT_BC3_TYPELESS:
case DXGI_FORMAT_BC3_UNORM:
case DXGI_FORMAT_BC3_UNORM_SRGB:
case DXGI_FORMAT_BC5_TYPELESS:
case DXGI_FORMAT_BC5_UNORM:
case DXGI_FORMAT_BC5_SNORM:
case DXGI_FORMAT_BC6H_TYPELESS:
case DXGI_FORMAT_BC6H_UF16:
case DXGI_FORMAT_BC6H_SF16:
case DXGI_FORMAT_BC7_TYPELESS:
case DXGI_FORMAT_BC7_UNORM:
case DXGI_FORMAT_BC7_UNORM_SRGB:
return 8;
#if defined(_XBOX_ONE) && defined(_TITLE)
case DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
case DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT:
case DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM:
return 32;
case DXGI_FORMAT_D16_UNORM_S8_UINT:
case DXGI_FORMAT_R16_UNORM_X8_TYPELESS:
case DXGI_FORMAT_X16_TYPELESS_G8_UINT:
return 24;
case DXGI_FORMAT_R4G4_UNORM:
return 8;
#endif // _XBOX_ONE && _TITLE
default:
return 0;
}
}
//--------------------------------------------------------------------------------------
inline DXGI_FORMAT MakeSRGB(_In_ DXGI_FORMAT format)
{
switch (format)
{
case DXGI_FORMAT_R8G8B8A8_UNORM:
return DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
case DXGI_FORMAT_BC1_UNORM:
return DXGI_FORMAT_BC1_UNORM_SRGB;
case DXGI_FORMAT_BC2_UNORM:
return DXGI_FORMAT_BC2_UNORM_SRGB;
case DXGI_FORMAT_BC3_UNORM:
return DXGI_FORMAT_BC3_UNORM_SRGB;
case DXGI_FORMAT_B8G8R8A8_UNORM:
return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
case DXGI_FORMAT_B8G8R8X8_UNORM:
return DXGI_FORMAT_B8G8R8X8_UNORM_SRGB;
case DXGI_FORMAT_BC7_UNORM:
return DXGI_FORMAT_BC7_UNORM_SRGB;
default:
return format;
}
}
//--------------------------------------------------------------------------------------
inline bool IsCompressed(_In_ DXGI_FORMAT fmt)
{
switch (fmt)
{
case DXGI_FORMAT_BC1_TYPELESS:
case DXGI_FORMAT_BC1_UNORM:
case DXGI_FORMAT_BC1_UNORM_SRGB:
case DXGI_FORMAT_BC2_TYPELESS:
case DXGI_FORMAT_BC2_UNORM:
case DXGI_FORMAT_BC2_UNORM_SRGB:
case DXGI_FORMAT_BC3_TYPELESS:
case DXGI_FORMAT_BC3_UNORM:
case DXGI_FORMAT_BC3_UNORM_SRGB:
case DXGI_FORMAT_BC4_TYPELESS:
case DXGI_FORMAT_BC4_UNORM:
case DXGI_FORMAT_BC4_SNORM:
case DXGI_FORMAT_BC5_TYPELESS:
case DXGI_FORMAT_BC5_UNORM:
case DXGI_FORMAT_BC5_SNORM:
case DXGI_FORMAT_BC6H_TYPELESS:
case DXGI_FORMAT_BC6H_UF16:
case DXGI_FORMAT_BC6H_SF16:
case DXGI_FORMAT_BC7_TYPELESS:
case DXGI_FORMAT_BC7_UNORM:
case DXGI_FORMAT_BC7_UNORM_SRGB:
return true;
default:
return false;
}
}
//--------------------------------------------------------------------------------------
inline DXGI_FORMAT EnsureNotTypeless(DXGI_FORMAT fmt)
{
// Assumes UNORM or FLOAT; doesn't use UINT or SINT
switch (fmt)
{
case DXGI_FORMAT_R32G32B32A32_TYPELESS: return DXGI_FORMAT_R32G32B32A32_FLOAT;
case DXGI_FORMAT_R32G32B32_TYPELESS: return DXGI_FORMAT_R32G32B32_FLOAT;
case DXGI_FORMAT_R16G16B16A16_TYPELESS: return DXGI_FORMAT_R16G16B16A16_UNORM;
case DXGI_FORMAT_R32G32_TYPELESS: return DXGI_FORMAT_R32G32_FLOAT;
case DXGI_FORMAT_R10G10B10A2_TYPELESS: return DXGI_FORMAT_R10G10B10A2_UNORM;
case DXGI_FORMAT_R8G8B8A8_TYPELESS: return DXGI_FORMAT_R8G8B8A8_UNORM;
case DXGI_FORMAT_R16G16_TYPELESS: return DXGI_FORMAT_R16G16_UNORM;
case DXGI_FORMAT_R32_TYPELESS: return DXGI_FORMAT_R32_FLOAT;
case DXGI_FORMAT_R8G8_TYPELESS: return DXGI_FORMAT_R8G8_UNORM;
case DXGI_FORMAT_R16_TYPELESS: return DXGI_FORMAT_R16_UNORM;
case DXGI_FORMAT_R8_TYPELESS: return DXGI_FORMAT_R8_UNORM;
case DXGI_FORMAT_BC1_TYPELESS: return DXGI_FORMAT_BC1_UNORM;
case DXGI_FORMAT_BC2_TYPELESS: return DXGI_FORMAT_BC2_UNORM;
case DXGI_FORMAT_BC3_TYPELESS: return DXGI_FORMAT_BC3_UNORM;
case DXGI_FORMAT_BC4_TYPELESS: return DXGI_FORMAT_BC4_UNORM;
case DXGI_FORMAT_BC5_TYPELESS: return DXGI_FORMAT_BC5_UNORM;
case DXGI_FORMAT_B8G8R8A8_TYPELESS: return DXGI_FORMAT_B8G8R8A8_UNORM;
case DXGI_FORMAT_B8G8R8X8_TYPELESS: return DXGI_FORMAT_B8G8R8X8_UNORM;
case DXGI_FORMAT_BC7_TYPELESS: return DXGI_FORMAT_BC7_UNORM;
default: return fmt;
}
}
//--------------------------------------------------------------------------------------
inline HRESULT LoadTextureDataFromFile(_In_z_ const wchar_t* fileName,
std::unique_ptr<uint8_t[]>& ddsData,
const DDS_HEADER** header,
const uint8_t** bitData,
size_t* bitSize
)
{
if (!header || !bitData || !bitSize)
{
return E_POINTER;
}
// open the file
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile(safe_handle(CreateFile2(fileName,
GENERIC_READ,
FILE_SHARE_READ,
OPEN_EXISTING,
nullptr)));
#else
ScopedHandle hFile(safe_handle(CreateFileW(fileName,
GENERIC_READ,
FILE_SHARE_READ,
nullptr,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
nullptr)));
#endif
if (!hFile)
{
return HRESULT_FROM_WIN32(GetLastError());
}
// Get the file size
FILE_STANDARD_INFO fileInfo;
if (!GetFileInformationByHandleEx(hFile.get(), FileStandardInfo, &fileInfo, sizeof(fileInfo)))
{
return HRESULT_FROM_WIN32(GetLastError());
}
// File is too big for 32-bit allocation, so reject read
if (fileInfo.EndOfFile.HighPart > 0)
{
return E_FAIL;
}
// Need at least enough data to fill the header and magic number to be a valid DDS
if (fileInfo.EndOfFile.LowPart < (sizeof(DDS_HEADER) + sizeof(uint32_t)))
{
return E_FAIL;
}
// create enough space for the file data
ddsData.reset(new (std::nothrow) uint8_t[fileInfo.EndOfFile.LowPart]);
if (!ddsData)
{
return E_OUTOFMEMORY;
}
// read the data in
DWORD BytesRead = 0;
if (!ReadFile(hFile.get(),
ddsData.get(),
fileInfo.EndOfFile.LowPart,
&BytesRead,
nullptr
))
{
return HRESULT_FROM_WIN32(GetLastError());
}
if (BytesRead < fileInfo.EndOfFile.LowPart)
{
return E_FAIL;
}
// DDS files always start with the same magic number ("DDS ")
uint32_t dwMagicNumber = *reinterpret_cast<const uint32_t*>(ddsData.get());
if (dwMagicNumber != DDS_MAGIC)
{
return E_FAIL;
}
auto hdr = reinterpret_cast<const DDS_HEADER*>(ddsData.get() + sizeof(uint32_t));
// Verify header to validate DDS file
if (hdr->size != sizeof(DDS_HEADER) ||
hdr->ddspf.size != sizeof(DDS_PIXELFORMAT))
{
return E_FAIL;
}
// Check for DX10 extension
bool bDXT10Header = false;
if ((hdr->ddspf.flags & DDS_FOURCC) &&
(MAKEFOURCC('D', 'X', '1', '0') == hdr->ddspf.fourCC))
{
// Must be long enough for both headers and magic value
if (fileInfo.EndOfFile.LowPart < (sizeof(DDS_HEADER) + sizeof(uint32_t) + sizeof(DDS_HEADER_DXT10)))
{
return E_FAIL;
}
bDXT10Header = true;
}
// setup the pointers in the process request
*header = hdr;
ptrdiff_t offset = sizeof(uint32_t) + sizeof(DDS_HEADER)
+ (bDXT10Header ? sizeof(DDS_HEADER_DXT10) : 0);
*bitData = ddsData.get() + offset;
*bitSize = fileInfo.EndOfFile.LowPart - offset;
return S_OK;
}
//--------------------------------------------------------------------------------------
// Get surface information for a particular format
//--------------------------------------------------------------------------------------
inline void GetSurfaceInfo(_In_ size_t width,
_In_ size_t height,
_In_ DXGI_FORMAT fmt,
_Out_opt_ size_t* outNumBytes,
_Out_opt_ size_t* outRowBytes,
_Out_opt_ size_t* outNumRows)
{
size_t numBytes = 0;
size_t rowBytes = 0;
size_t numRows = 0;
bool bc = false;
bool packed = false;
bool planar = false;
size_t bpe = 0;
switch (fmt)
{
case DXGI_FORMAT_BC1_TYPELESS:
case DXGI_FORMAT_BC1_UNORM:
case DXGI_FORMAT_BC1_UNORM_SRGB:
case DXGI_FORMAT_BC4_TYPELESS:
case DXGI_FORMAT_BC4_UNORM:
case DXGI_FORMAT_BC4_SNORM:
bc = true;
bpe = 8;
break;
case DXGI_FORMAT_BC2_TYPELESS:
case DXGI_FORMAT_BC2_UNORM:
case DXGI_FORMAT_BC2_UNORM_SRGB:
case DXGI_FORMAT_BC3_TYPELESS:
case DXGI_FORMAT_BC3_UNORM:
case DXGI_FORMAT_BC3_UNORM_SRGB:
case DXGI_FORMAT_BC5_TYPELESS:
case DXGI_FORMAT_BC5_UNORM:
case DXGI_FORMAT_BC5_SNORM:
case DXGI_FORMAT_BC6H_TYPELESS:
case DXGI_FORMAT_BC6H_UF16:
case DXGI_FORMAT_BC6H_SF16:
case DXGI_FORMAT_BC7_TYPELESS:
case DXGI_FORMAT_BC7_UNORM:
case DXGI_FORMAT_BC7_UNORM_SRGB:
bc = true;
bpe = 16;
break;
case DXGI_FORMAT_R8G8_B8G8_UNORM:
case DXGI_FORMAT_G8R8_G8B8_UNORM:
case DXGI_FORMAT_YUY2:
packed = true;
bpe = 4;
break;
case DXGI_FORMAT_Y210:
case DXGI_FORMAT_Y216:
packed = true;
bpe = 8;
break;
case DXGI_FORMAT_NV12:
case DXGI_FORMAT_420_OPAQUE:
planar = true;
bpe = 2;
break;
case DXGI_FORMAT_P010:
case DXGI_FORMAT_P016:
planar = true;
bpe = 4;
break;
#if defined(_XBOX_ONE) && defined(_TITLE)
case DXGI_FORMAT_D16_UNORM_S8_UINT:
case DXGI_FORMAT_R16_UNORM_X8_TYPELESS:
case DXGI_FORMAT_X16_TYPELESS_G8_UINT:
planar = true;
bpe = 4;
break;
#endif
default:
break;
}
if (bc)
{
size_t numBlocksWide = 0;
if (width > 0)
{
numBlocksWide = std::max<size_t>(1, (width + 3) / 4);
}
size_t numBlocksHigh = 0;
if (height > 0)
{
numBlocksHigh = std::max<size_t>(1, (height + 3) / 4);
}
rowBytes = numBlocksWide * bpe;
numRows = numBlocksHigh;
numBytes = rowBytes * numBlocksHigh;
}
else if (packed)
{
rowBytes = ((width + 1) >> 1) * bpe;
numRows = height;
numBytes = rowBytes * height;
}
else if (fmt == DXGI_FORMAT_NV11)
{
rowBytes = ((width + 3) >> 2) * 4;
numRows = height * 2; // Direct3D makes this simplifying assumption, although it is larger than the 4:1:1 data
numBytes = rowBytes * numRows;
}
else if (planar)
{
rowBytes = ((width + 1) >> 1) * bpe;
numBytes = (rowBytes * height) + ((rowBytes * height + 1) >> 1);
numRows = height + ((height + 1) >> 1);
}
else
{
size_t bpp = BitsPerPixel(fmt);
rowBytes = (width * bpp + 7) / 8; // round up to nearest byte
numRows = height;
numBytes = rowBytes * height;
}
if (outNumBytes)
{
*outNumBytes = numBytes;
}
if (outRowBytes)
{
*outRowBytes = rowBytes;
}
if (outNumRows)
{
*outNumRows = numRows;
}
}
//--------------------------------------------------------------------------------------
#define ISBITMASK( r,g,b,a ) ( ddpf.RBitMask == r && ddpf.GBitMask == g && ddpf.BBitMask == b && ddpf.ABitMask == a )
inline DXGI_FORMAT GetDXGIFormat(const DDS_PIXELFORMAT& ddpf)
{
if (ddpf.flags & DDS_RGB)
{
// Note that sRGB formats are written using the "DX10" extended header
switch (ddpf.RGBBitCount)
{
case 32:
if (ISBITMASK(0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000))
{
return DXGI_FORMAT_R8G8B8A8_UNORM;
}
if (ISBITMASK(0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000))
{
return DXGI_FORMAT_B8G8R8A8_UNORM;
}
if (ISBITMASK(0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000))
{
return DXGI_FORMAT_B8G8R8X8_UNORM;
}
// No DXGI format maps to ISBITMASK(0x000000ff,0x0000ff00,0x00ff0000,0x00000000) aka D3DFMT_X8B8G8R8
// Note that many common DDS reader/writers (including D3DX) swap the
// the RED/BLUE masks for 10:10:10:2 formats. We assume
// below that the 'backwards' header mask is being used since it is most
// likely written by D3DX. The more robust solution is to use the 'DX10'
// header extension and specify the DXGI_FORMAT_R10G10B10A2_UNORM format directly
// For 'correct' writers, this should be 0x000003ff,0x000ffc00,0x3ff00000 for RGB data
if (ISBITMASK(0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000))
{
return DXGI_FORMAT_R10G10B10A2_UNORM;
}
// No DXGI format maps to ISBITMASK(0x000003ff,0x000ffc00,0x3ff00000,0xc0000000) aka D3DFMT_A2R10G10B10
if (ISBITMASK(0x0000ffff, 0xffff0000, 0x00000000, 0x00000000))
{
return DXGI_FORMAT_R16G16_UNORM;
}
if (ISBITMASK(0xffffffff, 0x00000000, 0x00000000, 0x00000000))
{
// Only 32-bit color channel format in D3D9 was R32F
return DXGI_FORMAT_R32_FLOAT; // D3DX writes this out as a FourCC of 114
}
break;
case 24:
// No 24bpp DXGI formats aka D3DFMT_R8G8B8
break;
case 16:
if (ISBITMASK(0x7c00, 0x03e0, 0x001f, 0x8000))
{
return DXGI_FORMAT_B5G5R5A1_UNORM;
}
if (ISBITMASK(0xf800, 0x07e0, 0x001f, 0x0000))
{
return DXGI_FORMAT_B5G6R5_UNORM;
}
// No DXGI format maps to ISBITMASK(0x7c00,0x03e0,0x001f,0x0000) aka D3DFMT_X1R5G5B5
if (ISBITMASK(0x0f00, 0x00f0, 0x000f, 0xf000))
{
return DXGI_FORMAT_B4G4R4A4_UNORM;
}
// No DXGI format maps to ISBITMASK(0x0f00,0x00f0,0x000f,0x0000) aka D3DFMT_X4R4G4B4
// No 3:3:2, 3:3:2:8, or paletted DXGI formats aka D3DFMT_A8R3G3B2, D3DFMT_R3G3B2, D3DFMT_P8, D3DFMT_A8P8, etc.
break;
}
}
else if (ddpf.flags & DDS_LUMINANCE)
{
if (8 == ddpf.RGBBitCount)
{
if (ISBITMASK(0x000000ff, 0x00000000, 0x00000000, 0x00000000))
{
return DXGI_FORMAT_R8_UNORM; // D3DX10/11 writes this out as DX10 extension
}
// No DXGI format maps to ISBITMASK(0x0f,0x00,0x00,0xf0) aka D3DFMT_A4L4
if (ISBITMASK(0x000000ff, 0x00000000, 0x00000000, 0x0000ff00))
{
return DXGI_FORMAT_R8G8_UNORM; // Some DDS writers assume the bitcount should be 8 instead of 16
}
}
if (16 == ddpf.RGBBitCount)
{
if (ISBITMASK(0x0000ffff, 0x00000000, 0x00000000, 0x00000000))
{
return DXGI_FORMAT_R16_UNORM; // D3DX10/11 writes this out as DX10 extension
}
if (ISBITMASK(0x000000ff, 0x00000000, 0x00000000, 0x0000ff00))
{
return DXGI_FORMAT_R8G8_UNORM; // D3DX10/11 writes this out as DX10 extension
}
}
}
else if (ddpf.flags & DDS_ALPHA)
{
if (8 == ddpf.RGBBitCount)
{
return DXGI_FORMAT_A8_UNORM;
}
}
else if (ddpf.flags & DDS_BUMPDUDV)
{
if (16 == ddpf.RGBBitCount)
{
if (ISBITMASK(0x00ff, 0xff00, 0x0000, 0x0000))
{
return DXGI_FORMAT_R8G8_SNORM; // D3DX10/11 writes this out as DX10 extension
}
}
if (32 == ddpf.RGBBitCount)
{
if (ISBITMASK(0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000))
{
return DXGI_FORMAT_R8G8B8A8_SNORM; // D3DX10/11 writes this out as DX10 extension
}
if (ISBITMASK(0x0000ffff, 0xffff0000, 0x00000000, 0x00000000))
{
return DXGI_FORMAT_R16G16_SNORM; // D3DX10/11 writes this out as DX10 extension
}
// No DXGI format maps to ISBITMASK(0x3ff00000, 0x000ffc00, 0x000003ff, 0xc0000000) aka D3DFMT_A2W10V10U10
}
}
else if (ddpf.flags & DDS_FOURCC)
{
if (MAKEFOURCC('D', 'X', 'T', '1') == ddpf.fourCC)
{
return DXGI_FORMAT_BC1_UNORM;
}
if (MAKEFOURCC('D', 'X', 'T', '3') == ddpf.fourCC)
{
return DXGI_FORMAT_BC2_UNORM;
}
if (MAKEFOURCC('D', 'X', 'T', '5') == ddpf.fourCC)
{
return DXGI_FORMAT_BC3_UNORM;
}
// While pre-multiplied alpha isn't directly supported by the DXGI formats,
// they are basically the same as these BC formats so they can be mapped
if (MAKEFOURCC('D', 'X', 'T', '2') == ddpf.fourCC)
{
return DXGI_FORMAT_BC2_UNORM;
}
if (MAKEFOURCC('D', 'X', 'T', '4') == ddpf.fourCC)
{
return DXGI_FORMAT_BC3_UNORM;
}
if (MAKEFOURCC('A', 'T', 'I', '1') == ddpf.fourCC)
{
return DXGI_FORMAT_BC4_UNORM;
}
if (MAKEFOURCC('B', 'C', '4', 'U') == ddpf.fourCC)
{
return DXGI_FORMAT_BC4_UNORM;
}
if (MAKEFOURCC('B', 'C', '4', 'S') == ddpf.fourCC)
{
return DXGI_FORMAT_BC4_SNORM;
}
if (MAKEFOURCC('A', 'T', 'I', '2') == ddpf.fourCC)
{
return DXGI_FORMAT_BC5_UNORM;
}
if (MAKEFOURCC('B', 'C', '5', 'U') == ddpf.fourCC)
{
return DXGI_FORMAT_BC5_UNORM;
}
if (MAKEFOURCC('B', 'C', '5', 'S') == ddpf.fourCC)
{
return DXGI_FORMAT_BC5_SNORM;
}
// BC6H and BC7 are written using the "DX10" extended header
if (MAKEFOURCC('R', 'G', 'B', 'G') == ddpf.fourCC)
{
return DXGI_FORMAT_R8G8_B8G8_UNORM;
}
if (MAKEFOURCC('G', 'R', 'G', 'B') == ddpf.fourCC)
{
return DXGI_FORMAT_G8R8_G8B8_UNORM;
}
if (MAKEFOURCC('Y', 'U', 'Y', '2') == ddpf.fourCC)
{
return DXGI_FORMAT_YUY2;
}
// Check for D3DFORMAT enums being set here
switch (ddpf.fourCC)
{
case 36: // D3DFMT_A16B16G16R16
return DXGI_FORMAT_R16G16B16A16_UNORM;
case 110: // D3DFMT_Q16W16V16U16
return DXGI_FORMAT_R16G16B16A16_SNORM;
case 111: // D3DFMT_R16F
return DXGI_FORMAT_R16_FLOAT;
case 112: // D3DFMT_G16R16F
return DXGI_FORMAT_R16G16_FLOAT;
case 113: // D3DFMT_A16B16G16R16F
return DXGI_FORMAT_R16G16B16A16_FLOAT;
case 114: // D3DFMT_R32F
return DXGI_FORMAT_R32_FLOAT;
case 115: // D3DFMT_G32R32F
return DXGI_FORMAT_R32G32_FLOAT;
case 116: // D3DFMT_A32B32G32R32F
return DXGI_FORMAT_R32G32B32A32_FLOAT;
}
}
return DXGI_FORMAT_UNKNOWN;
}
#undef ISBITMASK
//--------------------------------------------------------------------------------------
inline DirectX::DDS_ALPHA_MODE GetAlphaMode(_In_ const DDS_HEADER* header)
{
if (header->ddspf.flags & DDS_FOURCC)
{
if (MAKEFOURCC('D', 'X', '1', '0') == header->ddspf.fourCC)
{
auto d3d10ext = reinterpret_cast<const DDS_HEADER_DXT10*>((const char*)header + sizeof(DDS_HEADER));
auto mode = static_cast<DDS_ALPHA_MODE>(d3d10ext->miscFlags2 & DDS_MISC_FLAGS2_ALPHA_MODE_MASK);
switch (mode)
{
case DDS_ALPHA_MODE_STRAIGHT:
case DDS_ALPHA_MODE_PREMULTIPLIED:
case DDS_ALPHA_MODE_OPAQUE:
case DDS_ALPHA_MODE_CUSTOM:
return mode;
default:
break;
}
}
else if ((MAKEFOURCC('D', 'X', 'T', '2') == header->ddspf.fourCC)
|| (MAKEFOURCC('D', 'X', 'T', '4') == header->ddspf.fourCC))
{
return DDS_ALPHA_MODE_PREMULTIPLIED;
}
}
return DDS_ALPHA_MODE_UNKNOWN;
}
//--------------------------------------------------------------------------------------
class auto_delete_file
{
public:
auto_delete_file(HANDLE hFile) : m_handle(hFile) {}
auto_delete_file(const auto_delete_file&) = delete;
auto_delete_file& operator=(const auto_delete_file&) = delete;
~auto_delete_file()
{
if (m_handle)
{
FILE_DISPOSITION_INFO info = {};
info.DeleteFile = TRUE;
(void)SetFileInformationByHandle(m_handle, FileDispositionInfo, &info, sizeof(info));
}
}
void clear() { m_handle = 0; }
private:
HANDLE m_handle;
};
class auto_delete_file_wic
{
public:
auto_delete_file_wic(Microsoft::WRL::ComPtr<IWICStream>& hFile, LPCWSTR szFile) : m_filename(szFile), m_handle(hFile) {}
auto_delete_file_wic(const auto_delete_file_wic&) = delete;
auto_delete_file_wic& operator=(const auto_delete_file_wic&) = delete;
~auto_delete_file_wic()
{
if (m_filename)
{
m_handle.Reset();
DeleteFileW(m_filename);
}
}
void clear() { m_filename = 0; }
private:
LPCWSTR m_filename;
Microsoft::WRL::ComPtr<IWICStream>& m_handle;
};
}
}

302
DirectXTK/Src/Model.cpp Normal file
View File

@@ -0,0 +1,302 @@
//--------------------------------------------------------------------------------------
// File: Model.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Model.h"
#include "CommonStates.h"
#include "DirectXHelpers.h"
#include "Effects.h"
#include "PlatformHelpers.h"
using namespace DirectX;
#ifndef _CPPRTTI
#error Model requires RTTI
#endif
//--------------------------------------------------------------------------------------
// ModelMeshPart
//--------------------------------------------------------------------------------------
ModelMeshPart::ModelMeshPart() :
indexCount(0),
startIndex(0),
vertexOffset(0),
vertexStride(0),
primitiveType(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST),
indexFormat(DXGI_FORMAT_R16_UINT),
isAlpha(false)
{
}
ModelMeshPart::~ModelMeshPart()
{
}
_Use_decl_annotations_
void ModelMeshPart::Draw(
ID3D11DeviceContext* deviceContext,
IEffect* ieffect,
ID3D11InputLayout* iinputLayout,
std::function<void()> setCustomState) const
{
deviceContext->IASetInputLayout(iinputLayout);
auto vb = vertexBuffer.Get();
UINT vbStride = vertexStride;
UINT vbOffset = 0;
deviceContext->IASetVertexBuffers(0, 1, &vb, &vbStride, &vbOffset);
// Note that if indexFormat is DXGI_FORMAT_R32_UINT, this model mesh part requires a Feature Level 9.2 or greater device
deviceContext->IASetIndexBuffer(indexBuffer.Get(), indexFormat, 0);
assert(ieffect != 0);
ieffect->Apply(deviceContext);
// Hook lets the caller replace our shaders or state settings with whatever else they see fit.
if (setCustomState)
{
setCustomState();
}
// Draw the primitive.
deviceContext->IASetPrimitiveTopology(primitiveType);
deviceContext->DrawIndexed(indexCount, startIndex, vertexOffset);
}
_Use_decl_annotations_
void ModelMeshPart::CreateInputLayout(ID3D11Device* d3dDevice, IEffect* ieffect, ID3D11InputLayout** iinputLayout) const
{
if (!vbDecl || vbDecl->empty())
throw std::exception("Model mesh part missing vertex buffer input elements data");
void const* shaderByteCode;
size_t byteCodeLength;
assert(ieffect != 0);
ieffect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
assert(d3dDevice != 0);
ThrowIfFailed(
d3dDevice->CreateInputLayout(vbDecl->data(),
static_cast<UINT>(vbDecl->size()),
shaderByteCode, byteCodeLength,
iinputLayout)
);
_Analysis_assume_(*iinputLayout != 0);
}
_Use_decl_annotations_
void ModelMeshPart::ModifyEffect(ID3D11Device* d3dDevice, std::shared_ptr<IEffect>& ieffect, bool isalpha)
{
if (!vbDecl || vbDecl->empty())
throw std::exception("Model mesh part missing vertex buffer input elements data");
assert(ieffect != 0);
this->effect = ieffect;
this->isAlpha = isalpha;
void const* shaderByteCode;
size_t byteCodeLength;
effect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
assert(d3dDevice != 0);
ThrowIfFailed(
d3dDevice->CreateInputLayout(vbDecl->data(),
static_cast<UINT>(vbDecl->size()),
shaderByteCode, byteCodeLength,
&inputLayout)
);
}
//--------------------------------------------------------------------------------------
// ModelMesh
//--------------------------------------------------------------------------------------
ModelMesh::ModelMesh() :
ccw(true),
pmalpha(true)
{
}
ModelMesh::~ModelMesh()
{
}
_Use_decl_annotations_
void ModelMesh::PrepareForRendering(
ID3D11DeviceContext* deviceContext,
const CommonStates& states,
bool alpha,
bool wireframe) const
{
assert(deviceContext != 0);
// Set the blend and depth stencil state.
ID3D11BlendState* blendState;
ID3D11DepthStencilState* depthStencilState;
if (alpha)
{
if (pmalpha)
{
blendState = states.AlphaBlend();
depthStencilState = states.DepthRead();
}
else
{
blendState = states.NonPremultiplied();
depthStencilState = states.DepthRead();
}
}
else
{
blendState = states.Opaque();
depthStencilState = states.DepthDefault();
}
deviceContext->OMSetBlendState(blendState, nullptr, 0xFFFFFFFF);
deviceContext->OMSetDepthStencilState(depthStencilState, 0);
// Set the rasterizer state.
if (wireframe)
deviceContext->RSSetState(states.Wireframe());
else
deviceContext->RSSetState(ccw ? states.CullCounterClockwise() : states.CullClockwise());
// Set sampler state.
ID3D11SamplerState* samplers[] =
{
states.LinearWrap(),
states.LinearWrap(),
};
deviceContext->PSSetSamplers(0, 2, samplers);
}
_Use_decl_annotations_
void XM_CALLCONV ModelMesh::Draw(
ID3D11DeviceContext* deviceContext,
FXMMATRIX world,
CXMMATRIX view,
CXMMATRIX projection,
bool alpha,
std::function<void()> setCustomState) const
{
assert(deviceContext != 0);
for (auto it = meshParts.cbegin(); it != meshParts.cend(); ++it)
{
auto part = (*it).get();
assert(part != 0);
if (part->isAlpha != alpha)
{
// Skip alpha parts when drawing opaque or skip opaque parts if drawing alpha
continue;
}
auto imatrices = dynamic_cast<IEffectMatrices*>(part->effect.get());
if (imatrices)
{
imatrices->SetMatrices(world, view, projection);
}
part->Draw(deviceContext, part->effect.get(), part->inputLayout.Get(), setCustomState);
}
}
//--------------------------------------------------------------------------------------
// Model
//--------------------------------------------------------------------------------------
Model::~Model()
{
}
_Use_decl_annotations_
void XM_CALLCONV Model::Draw(
ID3D11DeviceContext* deviceContext,
const CommonStates& states,
FXMMATRIX world,
CXMMATRIX view,
CXMMATRIX projection,
bool wireframe, std::function<void()> setCustomState) const
{
assert(deviceContext != 0);
// Draw opaque parts
for (auto it = meshes.cbegin(); it != meshes.cend(); ++it)
{
auto mesh = it->get();
assert(mesh != 0);
mesh->PrepareForRendering(deviceContext, states, false, wireframe);
mesh->Draw(deviceContext, world, view, projection, false, setCustomState);
}
// Draw alpha parts
for (auto it = meshes.cbegin(); it != meshes.cend(); ++it)
{
auto mesh = it->get();
assert(mesh != 0);
mesh->PrepareForRendering(deviceContext, states, true, wireframe);
mesh->Draw(deviceContext, world, view, projection, true, setCustomState);
}
}
void Model::UpdateEffects(_In_ std::function<void(IEffect*)> setEffect)
{
if (mEffectCache.empty())
{
// This cache ensures we only set each effect once (could be shared)
for (auto mit = meshes.cbegin(); mit != meshes.cend(); ++mit)
{
auto mesh = mit->get();
assert(mesh != 0);
for (auto it = mesh->meshParts.cbegin(); it != mesh->meshParts.cend(); ++it)
{
if ((*it)->effect != 0)
mEffectCache.insert((*it)->effect.get());
}
}
}
assert(setEffect != 0);
for (auto it = mEffectCache.begin(); it != mEffectCache.end(); ++it)
{
setEffect(*it);
}
}

View File

@@ -0,0 +1,874 @@
//--------------------------------------------------------------------------------------
// File: ModelLoadCMO.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Model.h"
#include "DDSTextureLoader.h"
#include "Effects.h"
#include "VertexTypes.h"
#include "DirectXHelpers.h"
#include "PlatformHelpers.h"
#include "BinaryReader.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
//--------------------------------------------------------------------------------------
// .CMO files are built by Visual Studio 2012 and an example renderer is provided
// in the VS Direct3D Starter Kit
// http://code.msdn.microsoft.com/Visual-Studio-3D-Starter-455a15f1
//--------------------------------------------------------------------------------------
namespace VSD3DStarter
{
// .CMO files
// UINT - Mesh count
// { [Mesh count]
// UINT - Length of name
// wchar_t[] - Name of mesh (if length > 0)
// UINT - Material count
// { [Material count]
// UINT - Length of material name
// wchar_t[] - Name of material (if length > 0)
// Material structure
// UINT - Length of pixel shader name
// wchar_t[] - Name of pixel shader (if length > 0)
// { [8]
// UINT - Length of texture name
// wchar_t[] - Name of texture (if length > 0)
// }
// }
// BYTE - 1 if there is skeletal animation data present
// UINT - SubMesh count
// { [SubMesh count]
// SubMesh structure
// }
// UINT - IB Count
// { [IB Count]
// UINT - Number of USHORTs in IB
// USHORT[] - Array of indices
// }
// UINT - VB Count
// { [VB Count]
// UINT - Number of verts in VB
// Vertex[] - Array of vertices
// }
// UINT - Skinning VB Count
// { [Skinning VB Count]
// UINT - Number of verts in Skinning VB
// SkinningVertex[] - Array of skinning verts
// }
// MeshExtents structure
// [If skeleton animation data is not present, file ends here]
// UINT - Bone count
// { [Bone count]
// UINT - Length of bone name
// wchar_t[] - Bone name (if length > 0)
// Bone structure
// }
// UINT - Animation clip count
// { [Animation clip count]
// UINT - Length of clip name
// wchar_t[] - Clip name (if length > 0)
// float - Start time
// float - End time
// UINT - Keyframe count
// { [Keyframe count]
// Keyframe structure
// }
// }
// }
#pragma pack(push,1)
struct Material
{
DirectX::XMFLOAT4 Ambient;
DirectX::XMFLOAT4 Diffuse;
DirectX::XMFLOAT4 Specular;
float SpecularPower;
DirectX::XMFLOAT4 Emissive;
DirectX::XMFLOAT4X4 UVTransform;
};
const uint32_t MAX_TEXTURE = 8;
struct SubMesh
{
UINT MaterialIndex;
UINT IndexBufferIndex;
UINT VertexBufferIndex;
UINT StartIndex;
UINT PrimCount;
};
const uint32_t NUM_BONE_INFLUENCES = 4;
static_assert( sizeof(VertexPositionNormalTangentColorTexture) == 52, "mismatch with CMO vertex type" );
struct SkinningVertex
{
UINT boneIndex[NUM_BONE_INFLUENCES];
float boneWeight[NUM_BONE_INFLUENCES];
};
struct MeshExtents
{
float CenterX, CenterY, CenterZ;
float Radius;
float MinX, MinY, MinZ;
float MaxX, MaxY, MaxZ;
};
struct Bone
{
INT ParentIndex;
DirectX::XMFLOAT4X4 InvBindPos;
DirectX::XMFLOAT4X4 BindPos;
DirectX::XMFLOAT4X4 LocalTransform;
};
struct Clip
{
float StartTime;
float EndTime;
UINT keys;
};
struct Keyframe
{
UINT BoneIndex;
float Time;
DirectX::XMFLOAT4X4 Transform;
};
#pragma pack(pop)
const Material s_defMaterial =
{
{ 0.2f, 0.2f, 0.2f, 1.f },
{ 0.8f, 0.8f, 0.8f, 1.f },
{ 0.0f, 0.0f, 0.0f, 1.f },
1.f,
{ 0.0f, 0.0f, 0.0f, 1.0f },
{ 1.f, 0.f, 0.f, 0.f,
0.f, 1.f, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f,
0.f, 0.f, 0.f, 1.f },
};
}; // namespace
static_assert( sizeof(VSD3DStarter::Material) == 132, "CMO Mesh structure size incorrect" );
static_assert( sizeof(VSD3DStarter::SubMesh) == 20, "CMO Mesh structure size incorrect" );
static_assert( sizeof(VSD3DStarter::SkinningVertex)== 32, "CMO Mesh structure size incorrect" );
static_assert( sizeof(VSD3DStarter::MeshExtents)== 40, "CMO Mesh structure size incorrect" );
static_assert( sizeof(VSD3DStarter::Bone) == 196, "CMO Mesh structure size incorrect" );
static_assert( sizeof(VSD3DStarter::Clip) == 12, "CMO Mesh structure size incorrect" );
static_assert( sizeof(VSD3DStarter::Keyframe)== 72, "CMO Mesh structure size incorrect" );
//--------------------------------------------------------------------------------------
struct MaterialRecordCMO
{
const VSD3DStarter::Material* pMaterial;
std::wstring name;
std::wstring pixelShader;
std::wstring texture[VSD3DStarter::MAX_TEXTURE];
std::shared_ptr<IEffect> effect;
ComPtr<ID3D11InputLayout> il;
};
// Helper for creating a D3D input layout.
static void CreateInputLayout(_In_ ID3D11Device* device, IEffect* effect, _Out_ ID3D11InputLayout** pInputLayout, bool skinning )
{
void const* shaderByteCode;
size_t byteCodeLength;
effect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
if ( skinning )
{
ThrowIfFailed(
device->CreateInputLayout( VertexPositionNormalTangentColorTextureSkinning::InputElements,
VertexPositionNormalTangentColorTextureSkinning::InputElementCount,
shaderByteCode, byteCodeLength,
pInputLayout)
);
}
else
{
ThrowIfFailed(
device->CreateInputLayout( VertexPositionNormalTangentColorTexture::InputElements,
VertexPositionNormalTangentColorTexture::InputElementCount,
shaderByteCode, byteCodeLength,
pInputLayout)
);
}
_Analysis_assume_(*pInputLayout != 0);
SetDebugObjectName(*pInputLayout, "ModelCMO");
}
// Shared VB input element description
static INIT_ONCE g_InitOnce = INIT_ONCE_STATIC_INIT;
static std::shared_ptr<std::vector<D3D11_INPUT_ELEMENT_DESC>> g_vbdecl;
static std::shared_ptr<std::vector<D3D11_INPUT_ELEMENT_DESC>> g_vbdeclSkinning;
static BOOL CALLBACK InitializeDecl( PINIT_ONCE initOnce, PVOID Parameter, PVOID *lpContext )
{
UNREFERENCED_PARAMETER( initOnce );
UNREFERENCED_PARAMETER( Parameter );
UNREFERENCED_PARAMETER( lpContext );
g_vbdecl = std::make_shared<std::vector<D3D11_INPUT_ELEMENT_DESC>>( VertexPositionNormalTangentColorTexture::InputElements,
VertexPositionNormalTangentColorTexture::InputElements + VertexPositionNormalTangentColorTexture::InputElementCount );
g_vbdeclSkinning = std::make_shared<std::vector<D3D11_INPUT_ELEMENT_DESC>>( VertexPositionNormalTangentColorTextureSkinning::InputElements,
VertexPositionNormalTangentColorTextureSkinning::InputElements + VertexPositionNormalTangentColorTextureSkinning::InputElementCount );
return TRUE;
}
//======================================================================================
// Model Loader
//======================================================================================
_Use_decl_annotations_
std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, const uint8_t* meshData, size_t dataSize, IEffectFactory& fxFactory, bool ccw, bool pmalpha )
{
if ( !InitOnceExecuteOnce( &g_InitOnce, InitializeDecl, nullptr, nullptr ) )
throw std::exception("One-time initialization failed");
if ( !d3dDevice || !meshData )
throw std::exception("Device and meshData cannot be null");
auto fxFactoryDGSL = dynamic_cast<DGSLEffectFactory*>( &fxFactory );
// Meshes
auto nMesh = reinterpret_cast<const UINT*>( meshData );
size_t usedSize = sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nMesh )
throw std::exception("No meshes found");
std::unique_ptr<Model> model(new Model());
for( UINT meshIndex = 0; meshIndex < *nMesh; ++meshIndex )
{
// Mesh name
auto nName = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto meshName = reinterpret_cast<const wchar_t*>( meshData + usedSize );
usedSize += sizeof(wchar_t)*(*nName);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto mesh = std::make_shared<ModelMesh>();
mesh->name.assign( meshName, *nName );
mesh->ccw = ccw;
mesh->pmalpha = pmalpha;
// Materials
auto nMats = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
std::vector<MaterialRecordCMO> materials;
materials.reserve( *nMats );
for( UINT j = 0; j < *nMats; ++j )
{
MaterialRecordCMO m;
// Material name
nName = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto matName = reinterpret_cast<const wchar_t*>( meshData + usedSize );
usedSize += sizeof(wchar_t)*(*nName);
if ( dataSize < usedSize )
throw std::exception("End of file");
m.name.assign( matName, *nName );
// Material settings
auto matSetting = reinterpret_cast<const VSD3DStarter::Material*>( meshData + usedSize );
usedSize += sizeof(VSD3DStarter::Material);
if ( dataSize < usedSize )
throw std::exception("End of file");
m.pMaterial = matSetting;
// Pixel shader name
nName = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto psName = reinterpret_cast<const wchar_t*>( meshData + usedSize );
usedSize += sizeof(wchar_t)*(*nName);
if ( dataSize < usedSize )
throw std::exception("End of file");
m.pixelShader.assign( psName, *nName );
for( UINT t = 0; t < VSD3DStarter::MAX_TEXTURE; ++t )
{
nName = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto txtName = reinterpret_cast<const wchar_t*>( meshData + usedSize );
usedSize += sizeof(wchar_t)*(*nName);
if ( dataSize < usedSize )
throw std::exception("End of file");
m.texture[t].assign( txtName, *nName );
}
materials.emplace_back( m );
}
assert( materials.size() == *nMats );
if (materials.empty())
{
// Add default material if none defined
MaterialRecordCMO m;
m.pMaterial = &VSD3DStarter::s_defMaterial;
m.name = L"Default";
materials.emplace_back(m);
}
// Skeletal data?
auto bSkeleton = reinterpret_cast<const BYTE*>( meshData + usedSize );
usedSize += sizeof(BYTE);
if ( dataSize < usedSize )
throw std::exception("End of file");
// Submeshes
auto nSubmesh = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nSubmesh )
throw std::exception("No submeshes found\n");
auto subMesh = reinterpret_cast<const VSD3DStarter::SubMesh*>( meshData + usedSize );
usedSize += sizeof(VSD3DStarter::SubMesh) * (*nSubmesh);
if ( dataSize < usedSize )
throw std::exception("End of file");
// Index buffers
auto nIBs = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nIBs )
throw std::exception("No index buffers found\n");
struct IBData
{
size_t nIndices;
const USHORT* ptr;
};
std::vector<IBData> ibData;
ibData.reserve( *nIBs );
std::vector<ComPtr<ID3D11Buffer>> ibs;
ibs.resize( *nIBs );
for( UINT j = 0; j < *nIBs; ++j )
{
auto nIndexes = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nIndexes )
throw std::exception("Empty index buffer found\n");
size_t ibBytes = sizeof(USHORT) * (*(nIndexes));
auto indexes = reinterpret_cast<const USHORT*>( meshData + usedSize );
usedSize += ibBytes;
if ( dataSize < usedSize )
throw std::exception("End of file");
IBData ib;
ib.nIndices = *nIndexes;
ib.ptr = indexes;
ibData.emplace_back( ib );
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = static_cast<UINT>( ibBytes );
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = indexes;
ThrowIfFailed(
d3dDevice->CreateBuffer( &desc, &initData, &ibs[j] )
);
SetDebugObjectName( ibs[j].Get(), "ModelCMO" );
}
assert( ibData.size() == *nIBs );
assert( ibs.size() == *nIBs );
// Vertex buffers
auto nVBs = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nVBs )
throw std::exception("No vertex buffers found\n");
struct VBData
{
size_t nVerts;
const VertexPositionNormalTangentColorTexture* ptr;
const VSD3DStarter::SkinningVertex* skinPtr;
};
std::vector<VBData> vbData;
vbData.reserve( *nVBs );
for( UINT j = 0; j < *nVBs; ++j )
{
auto nVerts = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nVerts )
throw std::exception("Empty vertex buffer found\n");
size_t vbBytes = sizeof(VertexPositionNormalTangentColorTexture) * (*(nVerts));
auto verts = reinterpret_cast<const VertexPositionNormalTangentColorTexture*>( meshData + usedSize );
usedSize += vbBytes;
if ( dataSize < usedSize )
throw std::exception("End of file");
VBData vb;
vb.nVerts = *nVerts;
vb.ptr = verts;
vb.skinPtr = nullptr;
vbData.emplace_back( vb );
}
assert( vbData.size() == *nVBs );
// Skinning vertex buffers
auto nSkinVBs = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( *nSkinVBs )
{
if ( *nSkinVBs != *nVBs )
throw std::exception("Number of VBs not equal to number of skin VBs");
for( UINT j = 0; j < *nSkinVBs; ++j )
{
auto nVerts = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nVerts )
throw std::exception("Empty skinning vertex buffer found\n");
if ( vbData[ j ].nVerts != *nVerts )
throw std::exception("Mismatched number of verts for skin VBs");
size_t vbBytes = sizeof(VSD3DStarter::SkinningVertex) * (*(nVerts));
auto verts = reinterpret_cast<const VSD3DStarter::SkinningVertex*>( meshData + usedSize );
usedSize += vbBytes;
if ( dataSize < usedSize )
throw std::exception("End of file");
vbData[j].skinPtr = verts;
}
}
// Extents
auto extents = reinterpret_cast<const VSD3DStarter::MeshExtents*>( meshData + usedSize );
usedSize += sizeof(VSD3DStarter::MeshExtents);
if ( dataSize < usedSize )
throw std::exception("End of file");
mesh->boundingSphere.Center.x = extents->CenterX;
mesh->boundingSphere.Center.y = extents->CenterY;
mesh->boundingSphere.Center.z = extents->CenterZ;
mesh->boundingSphere.Radius = extents->Radius;
XMVECTOR min = XMVectorSet( extents->MinX, extents->MinY, extents->MinZ, 0.f );
XMVECTOR max = XMVectorSet( extents->MaxX, extents->MaxY, extents->MaxZ, 0.f );
BoundingBox::CreateFromPoints( mesh->boundingBox, min, max );
#if 0
// Animation data
if ( *bSkeleton )
{
// Bones
auto nBones = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !*nBones )
throw std::exception("Animation bone data is missing\n");
for( UINT j = 0; j < *nBones; ++j )
{
// Bone name
nName = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto boneName = reinterpret_cast<const wchar_t*>( meshData + usedSize );
usedSize += sizeof(wchar_t)*(*nName);
if ( dataSize < usedSize )
throw std::exception("End of file");
// TODO - What to do with bone name?
boneName;
// Bone settings
auto bones = reinterpret_cast<const VSD3DStarter::Bone*>( meshData + usedSize );
usedSize += sizeof(VSD3DStarter::Bone);
if ( dataSize < usedSize )
throw std::exception("End of file");
// TODO - What to do with bone data?
bones;
}
// Animation Clips
auto nClips = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
for( UINT j = 0; j < *nClips; ++j )
{
// Clip name
nName = reinterpret_cast<const UINT*>( meshData + usedSize );
usedSize += sizeof(UINT);
if ( dataSize < usedSize )
throw std::exception("End of file");
auto clipName = reinterpret_cast<const wchar_t*>( meshData + usedSize );
usedSize += sizeof(wchar_t)*(*nName);
if ( dataSize < usedSize )
throw std::exception("End of file");
// TODO - What to do with clip name?
clipName;
auto clip = reinterpret_cast<const VSD3DStarter::Clip*>( meshData + usedSize );
usedSize += sizeof(VSD3DStarter::Clip);
if ( dataSize < usedSize )
throw std::exception("End of file");
if ( !clip->keys )
throw std::exception("Keyframes missing in clip");
auto keys = reinterpret_cast<const VSD3DStarter::Keyframe*>( meshData + usedSize );
usedSize += sizeof(VSD3DStarter::Keyframe) * clip->keys;
if ( dataSize < usedSize )
throw std::exception("End of file");
// TODO - What to do with keys and clip->StartTime, clip->EndTime?
keys;
}
}
#else
UNREFERENCED_PARAMETER(bSkeleton);
#endif
bool enableSkinning = ( *nSkinVBs ) != 0;
// Build vertex buffers
std::vector<ComPtr<ID3D11Buffer>> vbs;
vbs.resize( *nVBs );
const size_t stride = enableSkinning ? sizeof(VertexPositionNormalTangentColorTextureSkinning)
: sizeof(VertexPositionNormalTangentColorTexture);
for( UINT j = 0; j < *nVBs; ++j )
{
size_t nVerts = vbData[ j ].nVerts;
size_t bytes = stride * nVerts;
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = static_cast<UINT>( bytes );
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
if ( fxFactoryDGSL && !enableSkinning )
{
// Can use CMO vertex data directly
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = vbData[j].ptr;
ThrowIfFailed(
d3dDevice->CreateBuffer( &desc, &initData, &vbs[j] )
);
}
else
{
std::unique_ptr<uint8_t[]> temp( new uint8_t[ bytes + ( sizeof(UINT) * nVerts ) ] );
auto visited = reinterpret_cast<UINT*>( temp.get() + bytes );
memset( visited, 0xff, sizeof(UINT) * nVerts );
assert( vbData[j].ptr != 0 );
if ( enableSkinning )
{
// Combine CMO multi-stream data into a single stream
auto skinptr = vbData[j].skinPtr;
assert( skinptr != 0 );
uint8_t* ptr = temp.get();
auto sptr = vbData[j].ptr;
for( size_t v = 0; v < nVerts; ++v )
{
*reinterpret_cast<VertexPositionNormalTangentColorTexture*>( ptr ) = *sptr;
++sptr;
auto skinv = reinterpret_cast<VertexPositionNormalTangentColorTextureSkinning*>( ptr );
skinv->SetBlendIndices( *reinterpret_cast<const XMUINT4*>( skinptr->boneIndex ) );
skinv->SetBlendWeights( *reinterpret_cast<const XMFLOAT4*>( skinptr->boneWeight ) );
ptr += stride;
}
}
else
{
memcpy( temp.get(), vbData[j].ptr, bytes );
}
if ( !fxFactoryDGSL )
{
// Need to fix up VB tex coords for UV transform which is not supported by basic effects
for( UINT k = 0; k < *nSubmesh; ++k )
{
auto& sm = subMesh[ k ];
if ( sm.VertexBufferIndex != j )
continue;
if ( (sm.IndexBufferIndex >= *nIBs)
|| (sm.MaterialIndex >= materials.size()) )
throw std::exception("Invalid submesh found\n");
XMMATRIX uvTransform = XMLoadFloat4x4( &materials[ sm.MaterialIndex ].pMaterial->UVTransform );
auto ib = ibData[ sm.IndexBufferIndex ].ptr;
size_t count = ibData[ sm.IndexBufferIndex ].nIndices;
for( size_t q = 0; q < count; ++q )
{
size_t v = ib[ q ];
if ( v >= nVerts )
throw std::exception("Invalid index found\n");
auto verts = reinterpret_cast<VertexPositionNormalTangentColorTexture*>( temp.get() + ( v * stride ) );
if ( visited[v] == UINT(-1) )
{
visited[v] = sm.MaterialIndex;
XMVECTOR t = XMLoadFloat2( &verts->textureCoordinate );
t = XMVectorSelect( g_XMIdentityR3, t, g_XMSelect1110 );
t = XMVector4Transform( t, uvTransform );
XMStoreFloat2( &verts->textureCoordinate, t );
}
else if ( visited[v] != sm.MaterialIndex )
{
#ifdef _DEBUG
XMMATRIX uv2 = XMLoadFloat4x4( &materials[ visited[v] ].pMaterial->UVTransform );
if ( XMVector4NotEqual( uvTransform.r[0], uv2.r[0] )
|| XMVector4NotEqual( uvTransform.r[1], uv2.r[1] )
|| XMVector4NotEqual( uvTransform.r[2], uv2.r[2] )
|| XMVector4NotEqual( uvTransform.r[3], uv2.r[3] ) )
{
DebugTrace( "WARNING: %ls - mismatched UV transforms for the same vertex; texture coordinates may not be correct\n", mesh->name.c_str() );
}
#endif
}
}
}
}
// Create vertex buffer from temporary buffer
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = temp.get();
ThrowIfFailed(
d3dDevice->CreateBuffer( &desc, &initData, &vbs[j] )
);
}
SetDebugObjectName( vbs[j].Get(), "ModelCMO" );
}
assert( vbs.size() == *nVBs );
// Create Effects
for( size_t j = 0; j < materials.size(); ++j )
{
auto& m = materials[ j ];
if ( fxFactoryDGSL )
{
DGSLEffectFactory::DGSLEffectInfo info;
info.name = m.name.c_str();
info.specularPower = m.pMaterial->SpecularPower;
info.perVertexColor = true;
info.enableSkinning = enableSkinning;
info.alpha = m.pMaterial->Diffuse.w;
info.ambientColor = XMFLOAT3( m.pMaterial->Ambient.x, m.pMaterial->Ambient.y, m.pMaterial->Ambient.z );
info.diffuseColor = XMFLOAT3( m.pMaterial->Diffuse.x, m.pMaterial->Diffuse.y, m.pMaterial->Diffuse.z );
info.specularColor = XMFLOAT3( m.pMaterial->Specular.x, m.pMaterial->Specular.y, m.pMaterial->Specular.z );
info.emissiveColor = XMFLOAT3( m.pMaterial->Emissive.x, m.pMaterial->Emissive.y, m.pMaterial->Emissive.z );
info.diffuseTexture = m.texture[0].empty() ? nullptr : m.texture[0].c_str();
info.specularTexture = m.texture[1].empty() ? nullptr : m.texture[1].c_str();
info.normalTexture = m.texture[2].empty() ? nullptr : m.texture[2].c_str();
info.pixelShader = m.pixelShader.c_str();
const int offset = DGSLEffectFactory::DGSLEffectInfo::BaseTextureOffset;
for( int i = 0; i < (DGSLEffect::MaxTextures - offset); ++i )
{
info.textures[i] = m.texture[ i + offset ].empty() ? nullptr : m.texture[ i + offset ].c_str();
}
m.effect = fxFactoryDGSL->CreateDGSLEffect( info, nullptr );
auto dgslEffect = static_cast<DGSLEffect*>( m.effect.get() );
dgslEffect->SetUVTransform( XMLoadFloat4x4( &m.pMaterial->UVTransform ) );
}
else
{
EffectFactory::EffectInfo info;
info.name = m.name.c_str();
info.specularPower = m.pMaterial->SpecularPower;
info.perVertexColor = true;
info.enableSkinning = enableSkinning;
info.alpha = m.pMaterial->Diffuse.w;
info.ambientColor = XMFLOAT3( m.pMaterial->Ambient.x, m.pMaterial->Ambient.y, m.pMaterial->Ambient.z );
info.diffuseColor = XMFLOAT3( m.pMaterial->Diffuse.x, m.pMaterial->Diffuse.y, m.pMaterial->Diffuse.z );
info.specularColor = XMFLOAT3( m.pMaterial->Specular.x, m.pMaterial->Specular.y, m.pMaterial->Specular.z );
info.emissiveColor = XMFLOAT3( m.pMaterial->Emissive.x, m.pMaterial->Emissive.y, m.pMaterial->Emissive.z );
info.diffuseTexture = m.texture[0].c_str();
m.effect = fxFactory.CreateEffect( info, nullptr );
}
CreateInputLayout( d3dDevice, m.effect.get(), &m.il, enableSkinning );
}
// Build mesh parts
for( UINT j = 0; j < *nSubmesh; ++j )
{
auto& sm = subMesh[j];
if ( (sm.IndexBufferIndex >= *nIBs)
|| (sm.VertexBufferIndex >= *nVBs)
|| (sm.MaterialIndex >= materials.size()) )
throw std::exception("Invalid submesh found\n");
auto& mat = materials[ sm.MaterialIndex ];
auto part = new ModelMeshPart();
if ( mat.pMaterial->Diffuse.w < 1 )
part->isAlpha = true;
part->indexCount = sm.PrimCount * 3;
part->startIndex = sm.StartIndex;
part->vertexStride = static_cast<UINT>( stride );
part->inputLayout = mat.il;
part->indexBuffer = ibs[ sm.IndexBufferIndex ];
part->vertexBuffer = vbs[ sm.VertexBufferIndex ];
part->effect = mat.effect;
part->vbDecl = enableSkinning ? g_vbdeclSkinning : g_vbdecl;
mesh->meshParts.emplace_back( part );
}
model->meshes.emplace_back( mesh );
}
return model;
}
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<Model> DirectX::Model::CreateFromCMO( ID3D11Device* d3dDevice, const wchar_t* szFileName, IEffectFactory& fxFactory, bool ccw, bool pmalpha )
{
size_t dataSize = 0;
std::unique_ptr<uint8_t[]> data;
HRESULT hr = BinaryReader::ReadEntireFile( szFileName, data, &dataSize );
if ( FAILED(hr) )
{
DebugTrace( "CreateFromCMO failed (%08X) loading '%ls'\n", hr, szFileName );
throw std::exception( "CreateFromCMO" );
}
auto model = CreateFromCMO( d3dDevice, data.get(), dataSize, fxFactory, ccw, pmalpha );
model->name = szFileName;
return model;
}

View File

@@ -0,0 +1,632 @@
//--------------------------------------------------------------------------------------
// File: ModelLoadSDKMESH.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Model.h"
#include "Effects.h"
#include "VertexTypes.h"
#include "DirectXHelpers.h"
#include "PlatformHelpers.h"
#include "BinaryReader.h"
#include "SDKMesh.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
namespace
{
enum
{
PER_VERTEX_COLOR = 0x1,
SKINNING = 0x2,
DUAL_TEXTURE = 0x4,
NORMAL_MAPS = 0x8,
BIASED_VERTEX_NORMALS = 0x10,
};
struct MaterialRecordSDKMESH
{
std::shared_ptr<IEffect> effect;
bool alpha;
};
void LoadMaterial(const DXUT::SDKMESH_MATERIAL& mh,
unsigned int flags,
IEffectFactory& fxFactory,
MaterialRecordSDKMESH& m)
{
wchar_t matName[DXUT::MAX_MATERIAL_NAME];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.Name, -1, matName, DXUT::MAX_MATERIAL_NAME);
wchar_t diffuseName[DXUT::MAX_TEXTURE_NAME];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.DiffuseTexture, -1, diffuseName, DXUT::MAX_TEXTURE_NAME);
wchar_t specularName[DXUT::MAX_TEXTURE_NAME];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.SpecularTexture, -1, specularName, DXUT::MAX_TEXTURE_NAME);
wchar_t normalName[DXUT::MAX_TEXTURE_NAME];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.NormalTexture, -1, normalName, DXUT::MAX_TEXTURE_NAME);
if (flags & DUAL_TEXTURE && !mh.SpecularTexture[0])
{
DebugTrace("WARNING: Material '%s' has multiple texture coords but not multiple textures\n", mh.Name);
flags &= ~DUAL_TEXTURE;
}
if (flags & NORMAL_MAPS)
{
if (!mh.NormalTexture[0])
{
flags &= ~NORMAL_MAPS;
*normalName = 0;
}
}
else if (mh.NormalTexture[0])
{
DebugTrace("WARNING: Material '%s' has a normal map, but vertex buffer is missing tangents\n", mh.Name);
*normalName = 0;
}
EffectFactory::EffectInfo info;
info.name = matName;
info.perVertexColor = (flags & PER_VERTEX_COLOR) != 0;
info.enableSkinning = (flags & SKINNING) != 0;
info.enableDualTexture = (flags & DUAL_TEXTURE) != 0;
info.enableNormalMaps = (flags & NORMAL_MAPS) != 0;
info.biasedVertexNormals = (flags & BIASED_VERTEX_NORMALS) != 0;
if (mh.Ambient.x == 0 && mh.Ambient.y == 0 && mh.Ambient.z == 0 && mh.Ambient.w == 0
&& mh.Diffuse.x == 0 && mh.Diffuse.y == 0 && mh.Diffuse.z == 0 && mh.Diffuse.w == 0)
{
// SDKMESH material color block is uninitalized; assume defaults
info.diffuseColor = XMFLOAT3(1.f, 1.f, 1.f);
info.alpha = 1.f;
}
else
{
info.ambientColor = XMFLOAT3(mh.Ambient.x, mh.Ambient.y, mh.Ambient.z);
info.diffuseColor = XMFLOAT3(mh.Diffuse.x, mh.Diffuse.y, mh.Diffuse.z);
info.emissiveColor = XMFLOAT3(mh.Emissive.x, mh.Emissive.y, mh.Emissive.z);
if (mh.Diffuse.w != 1.f && mh.Diffuse.w != 0.f)
{
info.alpha = mh.Diffuse.w;
}
else
info.alpha = 1.f;
if (mh.Power)
{
info.specularPower = mh.Power;
info.specularColor = XMFLOAT3(mh.Specular.x, mh.Specular.y, mh.Specular.z);
}
}
info.diffuseTexture = diffuseName;
info.specularTexture = specularName;
info.normalTexture = normalName;
m.effect = fxFactory.CreateEffect(info, nullptr);
m.alpha = (info.alpha < 1.f);
}
//--------------------------------------------------------------------------------------
// Direct3D 9 Vertex Declaration to Direct3D 11 Input Layout mapping
unsigned int GetInputLayoutDesc(
_In_reads_(32) const DXUT::D3DVERTEXELEMENT9 decl[],
std::vector<D3D11_INPUT_ELEMENT_DESC>& inputDesc)
{
static const D3D11_INPUT_ELEMENT_DESC s_elements[] =
{
{ "SV_Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BINORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BLENDINDICES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "BLENDWEIGHT", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
using namespace DXUT;
uint32_t offset = 0;
uint32_t texcoords = 0;
unsigned int flags = 0;
bool posfound = false;
for (uint32_t index = 0; index < DXUT::MAX_VERTEX_ELEMENTS; ++index)
{
if (decl[index].Usage == 0xFF)
break;
if (decl[index].Type == D3DDECLTYPE_UNUSED)
break;
if (decl[index].Offset != offset)
break;
if (decl[index].Usage == D3DDECLUSAGE_POSITION)
{
if (decl[index].Type == D3DDECLTYPE_FLOAT3)
{
inputDesc.push_back(s_elements[0]);
offset += 12;
posfound = true;
}
else
break;
}
else if (decl[index].Usage == D3DDECLUSAGE_NORMAL
|| decl[index].Usage == D3DDECLUSAGE_TANGENT
|| decl[index].Usage == D3DDECLUSAGE_BINORMAL)
{
size_t base = 1;
if (decl[index].Usage == D3DDECLUSAGE_TANGENT)
base = 3;
else if (decl[index].Usage == D3DDECLUSAGE_BINORMAL)
base = 4;
D3D11_INPUT_ELEMENT_DESC desc = s_elements[base];
bool unk = false;
switch (decl[index].Type)
{
case D3DDECLTYPE_FLOAT3: assert(desc.Format == DXGI_FORMAT_R32G32B32_FLOAT); offset += 12; break;
case D3DDECLTYPE_UBYTE4N: desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; flags |= BIASED_VERTEX_NORMALS; offset += 4; break;
case D3DDECLTYPE_SHORT4N: desc.Format = DXGI_FORMAT_R16G16B16A16_SNORM; offset += 8; break;
case D3DDECLTYPE_FLOAT16_4: desc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT; offset += 8; break;
case D3DDECLTYPE_DXGI_R10G10B10A2_UNORM: desc.Format = DXGI_FORMAT_R10G10B10A2_UNORM; flags |= BIASED_VERTEX_NORMALS; offset += 4; break;
case D3DDECLTYPE_DXGI_R11G11B10_FLOAT: desc.Format = DXGI_FORMAT_R11G11B10_FLOAT; flags |= BIASED_VERTEX_NORMALS; offset += 4; break;
case D3DDECLTYPE_DXGI_R8G8B8A8_SNORM: desc.Format = DXGI_FORMAT_R8G8B8A8_SNORM; offset += 4; break;
#if defined(_XBOX_ONE) && defined(_TITLE)
case (32 + DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM): desc.Format = DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM; offset += 4; break;
#endif
default:
unk = true;
break;
}
if (unk)
break;
if (decl[index].Usage == D3DDECLUSAGE_TANGENT)
{
flags |= NORMAL_MAPS;
}
inputDesc.push_back(desc);
}
else if (decl[index].Usage == D3DDECLUSAGE_COLOR)
{
D3D11_INPUT_ELEMENT_DESC desc = s_elements[2];
bool unk = false;
switch (decl[index].Type)
{
case D3DDECLTYPE_FLOAT4: desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; offset += 16; break;
case D3DDECLTYPE_D3DCOLOR: assert(desc.Format == DXGI_FORMAT_B8G8R8A8_UNORM); offset += 4; break;
case D3DDECLTYPE_UBYTE4N: desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; offset += 4; break;
case D3DDECLTYPE_FLOAT16_4: desc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT; offset += 8; break;
case D3DDECLTYPE_DXGI_R10G10B10A2_UNORM: desc.Format = DXGI_FORMAT_R10G10B10A2_UNORM; offset += 4; break;
case D3DDECLTYPE_DXGI_R11G11B10_FLOAT: desc.Format = DXGI_FORMAT_R11G11B10_FLOAT; offset += 4; break;
default:
unk = true;
break;
}
if (unk)
break;
flags |= PER_VERTEX_COLOR;
inputDesc.push_back(desc);
}
else if (decl[index].Usage == D3DDECLUSAGE_TEXCOORD)
{
D3D11_INPUT_ELEMENT_DESC desc = s_elements[5];
desc.SemanticIndex = decl[index].UsageIndex;
bool unk = false;
switch (decl[index].Type)
{
case D3DDECLTYPE_FLOAT1: desc.Format = DXGI_FORMAT_R32_FLOAT; offset += 4; break;
case D3DDECLTYPE_FLOAT2: assert(desc.Format == DXGI_FORMAT_R32G32_FLOAT); offset += 8; break;
case D3DDECLTYPE_FLOAT3: desc.Format = DXGI_FORMAT_R32G32B32_FLOAT; offset += 12; break;
case D3DDECLTYPE_FLOAT4: desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; offset += 16; break;
case D3DDECLTYPE_FLOAT16_2: desc.Format = DXGI_FORMAT_R16G16_FLOAT; offset += 4; break;
case D3DDECLTYPE_FLOAT16_4: desc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT; offset += 8; break;
default:
unk = true;
break;
}
if (unk)
break;
++texcoords;
inputDesc.push_back(desc);
}
else if (decl[index].Usage == D3DDECLUSAGE_BLENDINDICES)
{
if (decl[index].Type == D3DDECLTYPE_UBYTE4)
{
flags |= SKINNING;
inputDesc.push_back(s_elements[6]);
offset += 4;
}
else
break;
}
else if (decl[index].Usage == D3DDECLUSAGE_BLENDWEIGHT)
{
if (decl[index].Type == D3DDECLTYPE_UBYTE4N)
{
flags |= SKINNING;
inputDesc.push_back(s_elements[7]);
offset += 4;
}
else
break;
}
else
break;
}
if (!posfound)
throw std::exception("SV_Position is required");
if (texcoords == 2)
{
flags |= DUAL_TEXTURE;
}
return flags;
}
// Helper for creating a D3D input layout.
void CreateInputLayout(_In_ ID3D11Device* device, _In_ IEffect* effect, std::vector<D3D11_INPUT_ELEMENT_DESC>& inputDesc, _Out_ ID3D11InputLayout** pInputLayout)
{
void const* shaderByteCode;
size_t byteCodeLength;
effect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
ThrowIfFailed(
device->CreateInputLayout(inputDesc.data(),
static_cast<UINT>(inputDesc.size()),
shaderByteCode, byteCodeLength,
pInputLayout)
);
_Analysis_assume_(*pInputLayout != 0);
SetDebugObjectName(*pInputLayout, "ModelSDKMESH");
}
}
//======================================================================================
// Model Loader
//======================================================================================
_Use_decl_annotations_
std::unique_ptr<Model> DirectX::Model::CreateFromSDKMESH( ID3D11Device* d3dDevice, const uint8_t* meshData, size_t dataSize, IEffectFactory& fxFactory, bool ccw, bool pmalpha )
{
if ( !d3dDevice || !meshData )
throw std::exception("Device and meshData cannot be null");
// File Headers
if ( dataSize < sizeof(DXUT::SDKMESH_HEADER) )
throw std::exception("End of file");
auto header = reinterpret_cast<const DXUT::SDKMESH_HEADER*>( meshData );
size_t headerSize = sizeof( DXUT::SDKMESH_HEADER )
+ header->NumVertexBuffers * sizeof(DXUT::SDKMESH_VERTEX_BUFFER_HEADER)
+ header->NumIndexBuffers * sizeof(DXUT::SDKMESH_INDEX_BUFFER_HEADER);
if ( header->HeaderSize != headerSize )
throw std::exception("Not a valid SDKMESH file");
if ( dataSize < header->HeaderSize )
throw std::exception("End of file");
if( header->Version != DXUT::SDKMESH_FILE_VERSION )
throw std::exception("Not a supported SDKMESH version");
if ( header->IsBigEndian )
throw std::exception("Loading BigEndian SDKMESH files not supported");
if ( !header->NumMeshes )
throw std::exception("No meshes found");
if ( !header->NumVertexBuffers )
throw std::exception("No vertex buffers found");
if ( !header->NumIndexBuffers )
throw std::exception("No index buffers found");
if ( !header->NumTotalSubsets )
throw std::exception("No subsets found");
if ( !header->NumMaterials )
throw std::exception("No materials found");
// Sub-headers
if ( dataSize < header->VertexStreamHeadersOffset
|| ( dataSize < (header->VertexStreamHeadersOffset + header->NumVertexBuffers * sizeof(DXUT::SDKMESH_VERTEX_BUFFER_HEADER) ) ) )
throw std::exception("End of file");
auto vbArray = reinterpret_cast<const DXUT::SDKMESH_VERTEX_BUFFER_HEADER*>( meshData + header->VertexStreamHeadersOffset );
if ( dataSize < header->IndexStreamHeadersOffset
|| ( dataSize < (header->IndexStreamHeadersOffset + header->NumIndexBuffers * sizeof(DXUT::SDKMESH_INDEX_BUFFER_HEADER) ) ) )
throw std::exception("End of file");
auto ibArray = reinterpret_cast<const DXUT::SDKMESH_INDEX_BUFFER_HEADER*>( meshData + header->IndexStreamHeadersOffset );
if ( dataSize < header->MeshDataOffset
|| ( dataSize < (header->MeshDataOffset + header->NumMeshes * sizeof(DXUT::SDKMESH_MESH) ) ) )
throw std::exception("End of file");
auto meshArray = reinterpret_cast<const DXUT::SDKMESH_MESH*>( meshData + header->MeshDataOffset );
if ( dataSize < header->SubsetDataOffset
|| ( dataSize < (header->SubsetDataOffset + header->NumTotalSubsets * sizeof(DXUT::SDKMESH_SUBSET) ) ) )
throw std::exception("End of file");
auto subsetArray = reinterpret_cast<const DXUT::SDKMESH_SUBSET*>( meshData + header->SubsetDataOffset );
if ( dataSize < header->FrameDataOffset
|| (dataSize < (header->FrameDataOffset + header->NumFrames * sizeof(DXUT::SDKMESH_FRAME) ) ) )
throw std::exception("End of file");
// TODO - auto frameArray = reinterpret_cast<const DXUT::SDKMESH_FRAME*>( meshData + header->FrameDataOffset );
if ( dataSize < header->MaterialDataOffset
|| (dataSize < (header->MaterialDataOffset + header->NumMaterials * sizeof(DXUT::SDKMESH_MATERIAL) ) ) )
throw std::exception("End of file");
auto materialArray = reinterpret_cast<const DXUT::SDKMESH_MATERIAL*>( meshData + header->MaterialDataOffset );
// Buffer data
uint64_t bufferDataOffset = header->HeaderSize + header->NonBufferDataSize;
if ( ( dataSize < bufferDataOffset )
|| ( dataSize < bufferDataOffset + header->BufferDataSize ) )
throw std::exception("End of file");
const uint8_t* bufferData = meshData + bufferDataOffset;
// Create vertex buffers
std::vector<ComPtr<ID3D11Buffer>> vbs;
vbs.resize( header->NumVertexBuffers );
std::vector<std::shared_ptr<std::vector<D3D11_INPUT_ELEMENT_DESC>>> vbDecls;
vbDecls.resize( header->NumVertexBuffers );
std::vector<unsigned int> materialFlags;
materialFlags.resize( header->NumVertexBuffers );
for( UINT j=0; j < header->NumVertexBuffers; ++j )
{
auto& vh = vbArray[j];
if ( dataSize < vh.DataOffset
|| ( dataSize < vh.DataOffset + vh.SizeBytes ) )
throw std::exception("End of file");
vbDecls[j] = std::make_shared<std::vector<D3D11_INPUT_ELEMENT_DESC>>();
unsigned int flags = GetInputLayoutDesc(vh.Decl, *vbDecls[j].get());
if (flags & SKINNING)
{
flags &= ~(DUAL_TEXTURE | NORMAL_MAPS);
}
if (flags & DUAL_TEXTURE)
{
flags &= ~NORMAL_MAPS;
}
materialFlags[j] = flags;
auto verts = reinterpret_cast<const uint8_t*>( bufferData + (vh.DataOffset - bufferDataOffset) );
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = static_cast<UINT>( vh.SizeBytes );
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = verts;
ThrowIfFailed(
d3dDevice->CreateBuffer( &desc, &initData, &vbs[j] )
);
SetDebugObjectName( vbs[j].Get(), "ModelSDKMESH" );
}
// Create index buffers
std::vector<ComPtr<ID3D11Buffer>> ibs;
ibs.resize( header->NumIndexBuffers );
for( UINT j=0; j < header->NumIndexBuffers; ++j )
{
auto& ih = ibArray[j];
if ( dataSize < ih.DataOffset
|| ( dataSize < ih.DataOffset + ih.SizeBytes ) )
throw std::exception("End of file");
if ( ih.IndexType != DXUT::IT_16BIT && ih.IndexType != DXUT::IT_32BIT )
throw std::exception("Invalid index buffer type found");
auto indices = reinterpret_cast<const uint8_t*>( bufferData + (ih.DataOffset - bufferDataOffset) );
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = static_cast<UINT>( ih.SizeBytes );
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = indices;
ThrowIfFailed(
d3dDevice->CreateBuffer( &desc, &initData, &ibs[j] )
);
SetDebugObjectName( ibs[j].Get(), "ModelSDKMESH" );
}
// Create meshes
std::vector<MaterialRecordSDKMESH> materials;
materials.resize( header->NumMaterials );
std::unique_ptr<Model> model(new Model());
model->meshes.reserve( header->NumMeshes );
for( UINT meshIndex = 0; meshIndex < header->NumMeshes; ++meshIndex )
{
auto& mh = meshArray[ meshIndex ];
if ( !mh.NumSubsets
|| !mh.NumVertexBuffers
|| mh.IndexBuffer >= header->NumIndexBuffers
|| mh.VertexBuffers[0] >= header->NumVertexBuffers )
throw std::exception("Invalid mesh found");
// mh.NumVertexBuffers is sometimes not what you'd expect, so we skip validating it
if ( dataSize < mh.SubsetOffset
|| (dataSize < mh.SubsetOffset + mh.NumSubsets*sizeof(UINT) ) )
throw std::exception("End of file");
auto subsets = reinterpret_cast<const UINT*>( meshData + mh.SubsetOffset );
if ( mh.NumFrameInfluences > 0 )
{
if ( dataSize < mh.FrameInfluenceOffset
|| (dataSize < mh.FrameInfluenceOffset + mh.NumFrameInfluences*sizeof(UINT) ) )
throw std::exception("End of file");
// TODO - auto influences = reinterpret_cast<const UINT*>( meshData + mh.FrameInfluenceOffset );
}
auto mesh = std::make_shared<ModelMesh>();
wchar_t meshName[ DXUT::MAX_MESH_NAME ];
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, mh.Name, -1, meshName, DXUT::MAX_MESH_NAME );
mesh->name = meshName;
mesh->ccw = ccw;
mesh->pmalpha = pmalpha;
// Extents
mesh->boundingBox.Center = mh.BoundingBoxCenter;
mesh->boundingBox.Extents = mh.BoundingBoxExtents;
BoundingSphere::CreateFromBoundingBox( mesh->boundingSphere, mesh->boundingBox );
// Create subsets
mesh->meshParts.reserve( mh.NumSubsets );
for( UINT j = 0; j < mh.NumSubsets; ++j )
{
auto sIndex = subsets[ j ];
if ( sIndex >= header->NumTotalSubsets )
throw std::exception("Invalid mesh found");
auto& subset = subsetArray[ sIndex ];
D3D11_PRIMITIVE_TOPOLOGY primType;
switch( subset.PrimitiveType )
{
case DXUT::PT_TRIANGLE_LIST: primType = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; break;
case DXUT::PT_TRIANGLE_STRIP: primType = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; break;
case DXUT::PT_LINE_LIST: primType = D3D11_PRIMITIVE_TOPOLOGY_LINELIST; break;
case DXUT::PT_LINE_STRIP: primType = D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP; break;
case DXUT::PT_POINT_LIST: primType = D3D11_PRIMITIVE_TOPOLOGY_POINTLIST; break;
case DXUT::PT_TRIANGLE_LIST_ADJ: primType = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ; break;
case DXUT::PT_TRIANGLE_STRIP_ADJ: primType = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ; break;
case DXUT::PT_LINE_LIST_ADJ: primType = D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ; break;
case DXUT::PT_LINE_STRIP_ADJ: primType = D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ; break;
case DXUT::PT_QUAD_PATCH_LIST:
case DXUT::PT_TRIANGLE_PATCH_LIST:
throw std::exception("Direct3D9 era tessellation not supported");
default:
throw std::exception("Unknown primitive type");
}
if ( subset.MaterialID >= header->NumMaterials )
throw std::exception("Invalid mesh found");
auto& mat = materials[ subset.MaterialID ];
if ( !mat.effect )
{
size_t vi = mh.VertexBuffers[0];
LoadMaterial(
materialArray[ subset.MaterialID ],
materialFlags[vi],
fxFactory,
mat );
}
ComPtr<ID3D11InputLayout> il;
CreateInputLayout( d3dDevice, mat.effect.get(), *vbDecls[ mh.VertexBuffers[0] ].get(), &il );
auto part = new ModelMeshPart();
part->isAlpha = mat.alpha;
part->indexCount = static_cast<uint32_t>( subset.IndexCount );
part->startIndex = static_cast<uint32_t>( subset.IndexStart );
part->vertexOffset = static_cast<uint32_t>( subset.VertexStart );
part->vertexStride = static_cast<uint32_t>( vbArray[ mh.VertexBuffers[0] ].StrideBytes );
part->indexFormat = ( ibArray[ mh.IndexBuffer ].IndexType == DXUT::IT_32BIT ) ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT;
part->primitiveType = primType;
part->inputLayout = il;
part->indexBuffer = ibs[ mh.IndexBuffer ];
part->vertexBuffer = vbs[ mh.VertexBuffers[0] ];
part->effect = mat.effect;
part->vbDecl = vbDecls[ mh.VertexBuffers[0] ];
mesh->meshParts.emplace_back( part );
}
model->meshes.emplace_back( mesh );
}
return model;
}
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<Model> DirectX::Model::CreateFromSDKMESH( ID3D11Device* d3dDevice, const wchar_t* szFileName, IEffectFactory& fxFactory, bool ccw, bool pmalpha )
{
size_t dataSize = 0;
std::unique_ptr<uint8_t[]> data;
HRESULT hr = BinaryReader::ReadEntireFile( szFileName, data, &dataSize );
if ( FAILED(hr) )
{
DebugTrace( "CreateFromSDKMESH failed (%08X) loading '%ls'\n", hr, szFileName );
throw std::exception( "CreateFromSDKMESH" );
}
auto model = CreateFromSDKMESH( d3dDevice, data.get(), dataSize, fxFactory, ccw, pmalpha );
model->name = szFileName;
return model;
}

View File

@@ -0,0 +1,188 @@
//--------------------------------------------------------------------------------------
// File: ModelLoadVBO.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "Model.h"
#include "Effects.h"
#include "VertexTypes.h"
#include "DirectXHelpers.h"
#include "PlatformHelpers.h"
#include "BinaryReader.h"
#include "vbo.h"
using namespace DirectX;
using Microsoft::WRL::ComPtr;
static_assert(sizeof(VertexPositionNormalTexture) == 32, "VBO vertex size mismatch");
namespace
{
//--------------------------------------------------------------------------------------
// Shared VB input element description
INIT_ONCE g_InitOnce = INIT_ONCE_STATIC_INIT;
std::shared_ptr<std::vector<D3D11_INPUT_ELEMENT_DESC>> g_vbdecl;
BOOL CALLBACK InitializeDecl(PINIT_ONCE initOnce, PVOID Parameter, PVOID *lpContext)
{
UNREFERENCED_PARAMETER(initOnce);
UNREFERENCED_PARAMETER(Parameter);
UNREFERENCED_PARAMETER(lpContext);
g_vbdecl = std::make_shared<std::vector<D3D11_INPUT_ELEMENT_DESC>>(VertexPositionNormalTexture::InputElements,
VertexPositionNormalTexture::InputElements + VertexPositionNormalTexture::InputElementCount);
return TRUE;
}
}
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<Model> DirectX::Model::CreateFromVBO(ID3D11Device* d3dDevice, const uint8_t* meshData, size_t dataSize,
std::shared_ptr<IEffect> ieffect, bool ccw, bool pmalpha)
{
if (!InitOnceExecuteOnce(&g_InitOnce, InitializeDecl, nullptr, nullptr))
throw std::exception("One-time initialization failed");
if ( !d3dDevice || !meshData )
throw std::exception("Device and meshData cannot be null");
// File Header
if ( dataSize < sizeof(VBO::header_t) )
throw std::exception("End of file");
auto header = reinterpret_cast<const VBO::header_t*>( meshData );
if ( !header->numVertices || !header->numIndices )
throw std::exception("No vertices or indices found");
size_t vertSize = sizeof(VertexPositionNormalTexture) * header->numVertices;
if (dataSize < (vertSize + sizeof(VBO::header_t)))
throw std::exception("End of file");
auto verts = reinterpret_cast<const VertexPositionNormalTexture*>( meshData + sizeof(VBO::header_t) );
size_t indexSize = sizeof(uint16_t) * header->numIndices;
if (dataSize < (sizeof(VBO::header_t) + vertSize + indexSize))
throw std::exception("End of file");
auto indices = reinterpret_cast<const uint16_t*>( meshData + sizeof(VBO::header_t) + vertSize );
// Create vertex buffer
ComPtr<ID3D11Buffer> vb;
{
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = static_cast<UINT>(vertSize);
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = verts;
ThrowIfFailed(
d3dDevice->CreateBuffer(&desc, &initData, vb.GetAddressOf())
);
SetDebugObjectName(vb.Get(), "ModelVBO");
}
// Create index buffer
ComPtr<ID3D11Buffer> ib;
{
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = static_cast<UINT>(indexSize);
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
D3D11_SUBRESOURCE_DATA initData = {};
initData.pSysMem = indices;
ThrowIfFailed(
d3dDevice->CreateBuffer(&desc, &initData, ib.GetAddressOf())
);
SetDebugObjectName(ib.Get(), "ModelVBO");
}
// Create input layout and effect
if (!ieffect)
{
auto effect = std::make_shared<BasicEffect>(d3dDevice);
effect->EnableDefaultLighting();
effect->SetLightingEnabled(true);
ieffect = effect;
}
ComPtr<ID3D11InputLayout> il;
{
void const* shaderByteCode;
size_t byteCodeLength;
ieffect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
ThrowIfFailed(
d3dDevice->CreateInputLayout(VertexPositionNormalTexture::InputElements,
VertexPositionNormalTexture::InputElementCount,
shaderByteCode, byteCodeLength,
il.GetAddressOf()));
SetDebugObjectName(il.Get(), "ModelVBO");
}
auto part = new ModelMeshPart();
part->indexCount = header->numIndices;
part->startIndex = 0;
part->vertexStride = static_cast<UINT>( sizeof(VertexPositionNormalTexture) );
part->inputLayout = il;
part->indexBuffer = ib;
part->vertexBuffer = vb;
part->effect = ieffect;
part->vbDecl = g_vbdecl;
auto mesh = std::make_shared<ModelMesh>();
mesh->ccw = ccw;
mesh->pmalpha = pmalpha;
BoundingSphere::CreateFromPoints(mesh->boundingSphere, header->numVertices, &verts->position, sizeof(VertexPositionNormalTexture));
BoundingBox::CreateFromPoints(mesh->boundingBox, header->numVertices, &verts->position, sizeof(VertexPositionNormalTexture));
mesh->meshParts.emplace_back(part);
std::unique_ptr<Model> model(new Model());
model->meshes.emplace_back(mesh);
return model;
}
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
std::unique_ptr<Model> DirectX::Model::CreateFromVBO(ID3D11Device* d3dDevice, const wchar_t* szFileName,
std::shared_ptr<IEffect> ieffect, bool ccw, bool pmalpha)
{
size_t dataSize = 0;
std::unique_ptr<uint8_t[]> data;
HRESULT hr = BinaryReader::ReadEntireFile( szFileName, data, &dataSize );
if ( FAILED(hr) )
{
DebugTrace( "CreateFromVBO failed (%08X) loading '%ls'\n", hr, szFileName );
throw std::exception( "CreateFromVBO" );
}
auto model = CreateFromVBO( d3dDevice, data.get(), dataSize, ieffect, ccw, pmalpha );
model->name = szFileName;
return model;
}

1031
DirectXTK/Src/Mouse.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,506 @@
//--------------------------------------------------------------------------------------
// File: NormalMapEffect.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "EffectCommon.h"
using namespace DirectX;
// Constant buffer layout. Must match the shader!
struct NormalMapEffectConstants
{
XMVECTOR diffuseColor;
XMVECTOR emissiveColor;
XMVECTOR specularColorAndPower;
XMVECTOR lightDirection[IEffectLights::MaxDirectionalLights];
XMVECTOR lightDiffuseColor[IEffectLights::MaxDirectionalLights];
XMVECTOR lightSpecularColor[IEffectLights::MaxDirectionalLights];
XMVECTOR eyePosition;
XMVECTOR fogColor;
XMVECTOR fogVector;
XMMATRIX world;
XMVECTOR worldInverseTranspose[3];
XMMATRIX worldViewProj;
};
static_assert( ( sizeof(NormalMapEffectConstants) % 16 ) == 0, "CB size not padded correctly" );
// Traits type describes our characteristics to the EffectBase template.
struct NormalMapEffectTraits
{
typedef NormalMapEffectConstants ConstantBufferType;
static const int VertexShaderCount = 4;
static const int PixelShaderCount = 4;
static const int ShaderPermutationCount = 16;
};
// Internal NormalMapEffect implementation class.
class NormalMapEffect::Impl : public EffectBase<NormalMapEffectTraits>
{
public:
Impl(_In_ ID3D11Device* device);
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> specularTexture;
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> normalTexture;
bool vertexColorEnabled;
bool biasedVertexNormals;
EffectLights lights;
int GetCurrentShaderPermutation() const;
void Apply(_In_ ID3D11DeviceContext* deviceContext);
};
// Include the precompiled shader code.
namespace
{
#if defined(_XBOX_ONE) && defined(_TITLE)
#include "Shaders/Compiled/XboxOneNormalMapEffect_VSNormalPixelLightingTx.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_VSNormalPixelLightingTxVc.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_VSNormalPixelLightingTxBn.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_VSNormalPixelLightingTxVcBn.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_PSNormalPixelLightingTx.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_PSNormalPixelLightingTxNoFog.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_PSNormalPixelLightingTxNoSpec.inc"
#include "Shaders/Compiled/XboxOneNormalMapEffect_PSNormalPixelLightingTxNoFogSpec.inc"
#else
#include "Shaders/Compiled/NormalMapEffect_VSNormalPixelLightingTx.inc"
#include "Shaders/Compiled/NormalMapEffect_VSNormalPixelLightingTxVc.inc"
#include "Shaders/Compiled/NormalMapEffect_VSNormalPixelLightingTxBn.inc"
#include "Shaders/Compiled/NormalMapEffect_VSNormalPixelLightingTxVcBn.inc"
#include "Shaders/Compiled/NormalMapEffect_PSNormalPixelLightingTx.inc"
#include "Shaders/Compiled/NormalMapEffect_PSNormalPixelLightingTxNoFog.inc"
#include "Shaders/Compiled/NormalMapEffect_PSNormalPixelLightingTxNoSpec.inc"
#include "Shaders/Compiled/NormalMapEffect_PSNormalPixelLightingTxNoFogSpec.inc"
#endif
}
template<>
const ShaderBytecode EffectBase<NormalMapEffectTraits>::VertexShaderBytecode[] =
{
{ NormalMapEffect_VSNormalPixelLightingTx, sizeof(NormalMapEffect_VSNormalPixelLightingTx) },
{ NormalMapEffect_VSNormalPixelLightingTxVc, sizeof(NormalMapEffect_VSNormalPixelLightingTxVc) },
{ NormalMapEffect_VSNormalPixelLightingTxBn, sizeof(NormalMapEffect_VSNormalPixelLightingTxBn) },
{ NormalMapEffect_VSNormalPixelLightingTxVcBn, sizeof(NormalMapEffect_VSNormalPixelLightingTxVcBn) },
};
template<>
const int EffectBase<NormalMapEffectTraits>::VertexShaderIndices[] =
{
0, // pixel lighting + texture
0, // pixel lighting + texture, no fog
1, // pixel lighting + texture + vertex color
1, // pixel lighting + texture + vertex color, no fog
0, // pixel lighting + texture, no specular
0, // pixel lighting + texture, no fog or specular
1, // pixel lighting + texture + vertex color, no specular
1, // pixel lighting + texture + vertex color, no fog or specular
2, // pixel lighting (biased vertex normal/tangent) + texture
2, // pixel lighting (biased vertex normal/tangent) + texture, no fog
3, // pixel lighting (biased vertex normal/tangent) + texture + vertex color
3, // pixel lighting (biased vertex normal/tangent) + texture + vertex color, no fog
2, // pixel lighting (biased vertex normal/tangent) + texture, no specular
2, // pixel lighting (biased vertex normal/tangent) + texture, no fog or specular
3, // pixel lighting (biased vertex normal/tangent) + texture + vertex color, no specular
3, // pixel lighting (biased vertex normal/tangent) + texture + vertex color, no fog or specular
};
template<>
const ShaderBytecode EffectBase<NormalMapEffectTraits>::PixelShaderBytecode[] =
{
{ NormalMapEffect_PSNormalPixelLightingTx, sizeof(NormalMapEffect_PSNormalPixelLightingTx) },
{ NormalMapEffect_PSNormalPixelLightingTxNoFog, sizeof(NormalMapEffect_PSNormalPixelLightingTxNoFog) },
{ NormalMapEffect_PSNormalPixelLightingTxNoSpec, sizeof(NormalMapEffect_PSNormalPixelLightingTxNoSpec) },
{ NormalMapEffect_PSNormalPixelLightingTxNoFogSpec, sizeof(NormalMapEffect_PSNormalPixelLightingTxNoFogSpec) },
};
template<>
const int EffectBase<NormalMapEffectTraits>::PixelShaderIndices[] =
{
0, // pixel lighting + texture
1, // pixel lighting + texture, no fog
0, // pixel lighting + texture + vertex color
1, // pixel lighting + texture + vertex color, no fog
2, // pixel lighting + texture, no specular
3, // pixel lighting + texture, no fog or specular
2, // pixel lighting + texture + vertex color, no specular
3, // pixel lighting + texture + vertex color, no fog or specular
0, // pixel lighting (biased vertex normal/tangent) + texture
1, // pixel lighting (biased vertex normal/tangent) + texture, no fog
0, // pixel lighting (biased vertex normal/tangent) + texture + vertex color
1, // pixel lighting (biased vertex normal/tangent) + texture + vertex color, no fog
2, // pixel lighting (biased vertex normal/tangent) + texture, no specular
3, // pixel lighting (biased vertex normal/tangent) + texture, no fog or specular
2, // pixel lighting (biased vertex normal/tangent) + texture + vertex color, no specular
3, // pixel lighting (biased vertex normal/tangent) + texture + vertex color, no fog or specular
};
// Global pool of per-device NormalMapEffect resources.
template<>
SharedResourcePool<ID3D11Device*, EffectBase<NormalMapEffectTraits>::DeviceResources> EffectBase<NormalMapEffectTraits>::deviceResourcesPool;
// Constructor.
NormalMapEffect::Impl::Impl(_In_ ID3D11Device* device)
: EffectBase(device),
vertexColorEnabled(false),
biasedVertexNormals(false)
{
static_assert( _countof(EffectBase<NormalMapEffectTraits>::VertexShaderIndices) == NormalMapEffectTraits::ShaderPermutationCount, "array/max mismatch" );
static_assert( _countof(EffectBase<NormalMapEffectTraits>::VertexShaderBytecode) == NormalMapEffectTraits::VertexShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<NormalMapEffectTraits>::PixelShaderBytecode) == NormalMapEffectTraits::PixelShaderCount, "array/max mismatch" );
static_assert( _countof(EffectBase<NormalMapEffectTraits>::PixelShaderIndices) == NormalMapEffectTraits::ShaderPermutationCount, "array/max mismatch" );
lights.InitializeConstants(constants.specularColorAndPower, constants.lightDirection, constants.lightDiffuseColor, constants.lightSpecularColor);
}
int NormalMapEffect::Impl::GetCurrentShaderPermutation() const
{
int permutation = 0;
// Use optimized shaders if fog is disabled.
if (!fog.enabled)
{
permutation += 1;
}
// Support vertex coloring?
if (vertexColorEnabled)
{
permutation += 2;
}
// Specular map?
if (!specularTexture)
{
permutation += 4;
}
if (biasedVertexNormals)
{
// Compressed normals & tangents need to be scaled and biased in the vertex shader.
permutation += 8;
}
return permutation;
}
// Sets our state onto the D3D device.
void NormalMapEffect::Impl::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
// Compute derived parameter values.
matrices.SetConstants(dirtyFlags, constants.worldViewProj);
fog.SetConstants(dirtyFlags, matrices.worldView, constants.fogVector);
lights.SetConstants(dirtyFlags, matrices, constants.world, constants.worldInverseTranspose, constants.eyePosition, constants.diffuseColor, constants.emissiveColor, true);
// Set the textures
ID3D11ShaderResourceView* textures[] = { texture.Get(), specularTexture.Get(), normalTexture.Get()};
deviceContext->PSSetShaderResources(0, _countof(textures), textures);
// Set shaders and constant buffers.
ApplyShaders(deviceContext, GetCurrentShaderPermutation());
}
// Public constructor.
NormalMapEffect::NormalMapEffect(_In_ ID3D11Device* device)
: pImpl(new Impl(device))
{
}
// Move constructor.
NormalMapEffect::NormalMapEffect(NormalMapEffect&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
NormalMapEffect& NormalMapEffect::operator= (NormalMapEffect&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
NormalMapEffect::~NormalMapEffect()
{
}
// IEffect methods.
void NormalMapEffect::Apply(_In_ ID3D11DeviceContext* deviceContext)
{
pImpl->Apply(deviceContext);
}
void NormalMapEffect::GetVertexShaderBytecode(_Out_ void const** pShaderByteCode, _Out_ size_t* pByteCodeLength)
{
pImpl->GetVertexShaderBytecode(pImpl->GetCurrentShaderPermutation(), pShaderByteCode, pByteCodeLength);
}
// Camera settings.
void XM_CALLCONV NormalMapEffect::SetWorld(FXMMATRIX value)
{
pImpl->matrices.world = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV NormalMapEffect::SetView(FXMMATRIX value)
{
pImpl->matrices.view = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
void XM_CALLCONV NormalMapEffect::SetProjection(FXMMATRIX value)
{
pImpl->matrices.projection = value;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj;
}
void XM_CALLCONV NormalMapEffect::SetMatrices(FXMMATRIX world, CXMMATRIX view, CXMMATRIX projection)
{
pImpl->matrices.world = world;
pImpl->matrices.view = view;
pImpl->matrices.projection = projection;
pImpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector;
}
// Material settings.
void XM_CALLCONV NormalMapEffect::SetDiffuseColor(FXMVECTOR value)
{
pImpl->lights.diffuseColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV NormalMapEffect::SetEmissiveColor(FXMVECTOR value)
{
pImpl->lights.emissiveColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV NormalMapEffect::SetSpecularColor(FXMVECTOR value)
{
// Set xyz to new value, but preserve existing w (specular power).
pImpl->constants.specularColorAndPower = XMVectorSelect(pImpl->constants.specularColorAndPower, value, g_XMSelect1110);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void NormalMapEffect::SetSpecularPower(float value)
{
// Set w to new value, but preserve existing xyz (specular color).
pImpl->constants.specularColorAndPower = XMVectorSetW(pImpl->constants.specularColorAndPower, value);
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void NormalMapEffect::DisableSpecular()
{
// Set specular color to black, power to 1
// Note: Don't use a power of 0 or the shader will generate strange highlights on non-specular materials
pImpl->constants.specularColorAndPower = g_XMIdentityR3;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void NormalMapEffect::SetAlpha(float value)
{
pImpl->lights.alpha = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void XM_CALLCONV NormalMapEffect::SetColorAndAlpha(FXMVECTOR value)
{
pImpl->lights.diffuseColor = value;
pImpl->lights.alpha = XMVectorGetW(value);
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
// Light settings.
void NormalMapEffect::SetLightingEnabled(bool value)
{
if (!value)
{
throw std::exception("NormalMapEffect does not support turning off lighting");
}
}
void NormalMapEffect::SetPerPixelLighting(bool)
{
// Unsupported interface method.
}
void XM_CALLCONV NormalMapEffect::SetAmbientLightColor(FXMVECTOR value)
{
pImpl->lights.ambientLightColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::MaterialColor;
}
void NormalMapEffect::SetLightEnabled(int whichLight, bool value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightEnabled(whichLight, value, pImpl->constants.lightDiffuseColor, pImpl->constants.lightSpecularColor);
}
void XM_CALLCONV NormalMapEffect::SetLightDirection(int whichLight, FXMVECTOR value)
{
EffectLights::ValidateLightIndex(whichLight);
pImpl->constants.lightDirection[whichLight] = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
void XM_CALLCONV NormalMapEffect::SetLightDiffuseColor(int whichLight, FXMVECTOR value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightDiffuseColor(whichLight, value, pImpl->constants.lightDiffuseColor);
}
void XM_CALLCONV NormalMapEffect::SetLightSpecularColor(int whichLight, FXMVECTOR value)
{
pImpl->dirtyFlags |= pImpl->lights.SetLightSpecularColor(whichLight, value, pImpl->constants.lightSpecularColor);
}
void NormalMapEffect::EnableDefaultLighting()
{
EffectLights::EnableDefaultLighting(this);
}
// Fog settings.
void NormalMapEffect::SetFogEnabled(bool value)
{
pImpl->fog.enabled = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogEnable;
}
void NormalMapEffect::SetFogStart(float value)
{
pImpl->fog.start = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void NormalMapEffect::SetFogEnd(float value)
{
pImpl->fog.end = value;
pImpl->dirtyFlags |= EffectDirtyFlags::FogVector;
}
void XM_CALLCONV NormalMapEffect::SetFogColor(FXMVECTOR value)
{
pImpl->constants.fogColor = value;
pImpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer;
}
// Vertex color setting.
void NormalMapEffect::SetVertexColorEnabled(bool value)
{
pImpl->vertexColorEnabled = value;
}
// Texture settings.
void NormalMapEffect::SetTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->texture = value;
}
void NormalMapEffect::SetNormalTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->normalTexture = value;
}
void NormalMapEffect::SetSpecularTexture(_In_opt_ ID3D11ShaderResourceView* value)
{
pImpl->specularTexture = value;
}
// Normal compression settings.
void NormalMapEffect::SetBiasedVertexNormalsAndTangents(bool value)
{
pImpl->biasedVertexNormals = value;
}

View File

@@ -0,0 +1,152 @@
//--------------------------------------------------------------------------------------
// File: PlatformHelpers.h
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
#pragma warning(disable : 4324)
#include <exception>
#include <memory>
namespace DirectX
{
// Helper class for COM exceptions
class com_exception : public std::exception
{
public:
com_exception(HRESULT hr) : result(hr) {}
virtual const char* what() const override
{
static char s_str[64] = {};
sprintf_s(s_str, "Failure with HRESULT of %08X", static_cast<unsigned int>(result));
return s_str;
}
private:
HRESULT result;
};
// Helper utility converts D3D API failures into exceptions.
inline void ThrowIfFailed(HRESULT hr)
{
if (FAILED(hr))
{
throw com_exception(hr);
}
}
// Helper for output debug tracing
inline void DebugTrace( _In_z_ _Printf_format_string_ const char* format, ... )
{
#ifdef _DEBUG
va_list args;
va_start( args, format );
char buff[1024] = {};
vsprintf_s( buff, format, args );
OutputDebugStringA( buff );
va_end( args );
#else
UNREFERENCED_PARAMETER( format );
#endif
}
// Helper smart-pointers
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) || (defined(_XBOX_ONE) && defined(_TITLE)) || !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
struct virtual_deleter { void operator()(void* p) { if (p) VirtualFree(p, 0, MEM_RELEASE); } };
#endif
struct aligned_deleter { void operator()(void* p) { _aligned_free(p); } };
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
}
#ifdef DIRECTX_EMULATE_MUTEX
// Emulate the C++0x mutex and lock_guard types when building with Visual Studio CRT versions < 2012.
namespace std
{
class mutex
{
public:
mutex() { InitializeCriticalSection(&mCriticalSection); }
~mutex() { DeleteCriticalSection(&mCriticalSection); }
void lock() { EnterCriticalSection(&mCriticalSection); }
void unlock() { LeaveCriticalSection(&mCriticalSection); }
bool try_lock() { return TryEnterCriticalSection(&mCriticalSection) != 0; }
private:
CRITICAL_SECTION mCriticalSection;
mutex(mutex const&);
mutex& operator= (mutex const&);
};
template<typename Mutex>
class lock_guard
{
public:
typedef Mutex mutex_type;
explicit lock_guard(mutex_type& mutex)
: mMutex(mutex)
{
mMutex.lock();
}
~lock_guard()
{
mMutex.unlock();
}
private:
mutex_type& mMutex;
lock_guard(lock_guard const&);
lock_guard& operator= (lock_guard const&);
};
}
#else
#include <mutex>
#endif
#ifdef DIRECTX_EMULATE_MAKE_UNIQUE
// Emulate make_unique when building with Visual Studio CRT versions < 2012.
namespace std
{
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
}
#endif

View File

@@ -0,0 +1,436 @@
//--------------------------------------------------------------------------------------
// File: PrimitiveBatch.cpp
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#include "pch.h"
#include "PrimitiveBatch.h"
#include "DirectXHelpers.h"
#include "GraphicsMemory.h"
#include "PlatformHelpers.h"
using namespace DirectX;
using namespace DirectX::Internal;
using Microsoft::WRL::ComPtr;
// Internal PrimitiveBatch implementation class.
class PrimitiveBatchBase::Impl
{
public:
Impl(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices, size_t maxVertices, size_t vertexSize);
void Begin();
void End();
void Draw(D3D11_PRIMITIVE_TOPOLOGY topology, bool isIndexed, _In_opt_count_(indexCount) uint16_t const* indices, size_t indexCount, size_t vertexCount, _Out_ void** pMappedVertices);
private:
void FlushBatch();
#if defined(_XBOX_ONE) && defined(_TITLE)
ComPtr<ID3D11DeviceContextX> mDeviceContext;
#else
ComPtr<ID3D11DeviceContext> mDeviceContext;
#endif
ComPtr<ID3D11Buffer> mIndexBuffer;
ComPtr<ID3D11Buffer> mVertexBuffer;
size_t mMaxIndices;
size_t mMaxVertices;
size_t mVertexSize;
D3D11_PRIMITIVE_TOPOLOGY mCurrentTopology;
bool mInBeginEndPair;
bool mCurrentlyIndexed;
size_t mCurrentIndex;
size_t mCurrentVertex;
size_t mBaseIndex;
size_t mBaseVertex;
#if defined(_XBOX_ONE) && defined(_TITLE)
void *grfxMemoryIB;
void *grfxMemoryVB;
#else
D3D11_MAPPED_SUBRESOURCE mMappedIndices;
D3D11_MAPPED_SUBRESOURCE mMappedVertices;
#endif
};
// Helper for creating a D3D vertex or index buffer.
#if defined(_XBOX_ONE) && defined(_TITLE)
static void CreateBuffer(_In_ ID3D11DeviceX* device, size_t bufferSize, D3D11_BIND_FLAG bindFlag, _Out_ ID3D11Buffer** pBuffer)
{
D3D11_BUFFER_DESC desc = {};
desc.ByteWidth = (UINT)bufferSize;
desc.BindFlags = bindFlag;
desc.Usage = D3D11_USAGE_DEFAULT;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
ThrowIfFailed(
device->CreatePlacementBuffer(&desc, nullptr, pBuffer)
);
SetDebugObjectName(*pBuffer, "DirectXTK:PrimitiveBatch");
}
#else
static void CreateBuffer(_In_ ID3D11Device* device, size_t bufferSize, D3D11_BIND_FLAG bindFlag, _Out_ ID3D11Buffer** pBuffer)
{
D3D11_BUFFER_DESC desc = {};
desc.ByteWidth = (UINT)bufferSize;
desc.BindFlags = bindFlag;
desc.Usage = D3D11_USAGE_DYNAMIC;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
ThrowIfFailed(
device->CreateBuffer(&desc, nullptr, pBuffer)
);
_Analysis_assume_(*pBuffer != 0);
SetDebugObjectName(*pBuffer, "DirectXTK:PrimitiveBatch");
}
#endif
// Constructor.
PrimitiveBatchBase::Impl::Impl(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices, size_t maxVertices, size_t vertexSize)
: mMaxIndices(maxIndices),
mMaxVertices(maxVertices),
mVertexSize(vertexSize),
mCurrentTopology(D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED),
mInBeginEndPair(false),
mCurrentlyIndexed(false),
mCurrentIndex(0),
mCurrentVertex(0),
mBaseIndex(0),
mBaseVertex(0)
{
ComPtr<ID3D11Device> device;
deviceContext->GetDevice(&device);
#if defined(_XBOX_ONE) && defined(_TITLE)
ThrowIfFailed(deviceContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(mDeviceContext.GetAddressOf())));
ComPtr<ID3D11DeviceX> deviceX;
ThrowIfFailed(device.As(&deviceX));
// If you only intend to draw non-indexed geometry, specify maxIndices = 0 to skip creating the index buffer.
if (maxIndices > 0)
{
CreateBuffer(deviceX.Get(), maxIndices * sizeof(uint16_t), D3D11_BIND_INDEX_BUFFER, &mIndexBuffer);
}
// Create the vertex buffer.
CreateBuffer(deviceX.Get(), maxVertices * vertexSize, D3D11_BIND_VERTEX_BUFFER, &mVertexBuffer);
grfxMemoryIB = grfxMemoryVB = nullptr;
#else
mDeviceContext = deviceContext;
// If you only intend to draw non-indexed geometry, specify maxIndices = 0 to skip creating the index buffer.
if (maxIndices > 0)
{
CreateBuffer(device.Get(), maxIndices * sizeof(uint16_t), D3D11_BIND_INDEX_BUFFER, &mIndexBuffer);
}
// Create the vertex buffer.
CreateBuffer(device.Get(), maxVertices * vertexSize, D3D11_BIND_VERTEX_BUFFER, &mVertexBuffer);
#endif
}
// Begins a batch of primitive drawing operations.
void PrimitiveBatchBase::Impl::Begin()
{
if (mInBeginEndPair)
throw std::exception("Cannot nest Begin calls");
#if defined(_XBOX_ONE) && defined(_TITLE)
mDeviceContext->IASetIndexBuffer(nullptr, DXGI_FORMAT_UNKNOWN, 0);
#else
// Bind the index buffer.
if (mMaxIndices > 0)
{
mDeviceContext->IASetIndexBuffer(mIndexBuffer.Get(), DXGI_FORMAT_R16_UINT, 0);
}
// Bind the vertex buffer.
auto vertexBuffer = mVertexBuffer.Get();
UINT vertexStride = (UINT)mVertexSize;
UINT vertexOffset = 0;
mDeviceContext->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &vertexOffset);
#endif
// If this is a deferred D3D context, reset position so the first Map calls will use D3D11_MAP_WRITE_DISCARD.
if (mDeviceContext->GetType() == D3D11_DEVICE_CONTEXT_DEFERRED)
{
mCurrentIndex = 0;
mCurrentVertex = 0;
}
mInBeginEndPair = true;
}
// Ends a batch of primitive drawing operations.
void PrimitiveBatchBase::Impl::End()
{
if (!mInBeginEndPair)
throw std::exception("Begin must be called before End");
FlushBatch();
mInBeginEndPair = false;
}
// Can we combine adjacent primitives using this topology into a single draw call?
static bool CanBatchPrimitives(D3D11_PRIMITIVE_TOPOLOGY topology)
{
switch (topology)
{
case D3D11_PRIMITIVE_TOPOLOGY_POINTLIST:
case D3D11_PRIMITIVE_TOPOLOGY_LINELIST:
case D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST:
// Lists can easily be merged.
return true;
default:
// Strips cannot.
return false;
}
// We could also merge indexed strips by inserting degenerates,
// but that's not always a perf win, so let's keep things simple.
}
#if !defined(_XBOX_ONE) || !defined(_TITLE)
// Helper for locking a vertex or index buffer.
static void LockBuffer(_In_ ID3D11DeviceContext* deviceContext, _In_ ID3D11Buffer* buffer, size_t currentPosition, _Out_ size_t* basePosition, _Out_ D3D11_MAPPED_SUBRESOURCE* mappedResource)
{
D3D11_MAP mapType = (currentPosition == 0) ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE;
ThrowIfFailed(
deviceContext->Map(buffer, 0, mapType, 0, mappedResource)
);
*basePosition = currentPosition;
}
#endif
// Adds new geometry to the batch.
_Use_decl_annotations_
void PrimitiveBatchBase::Impl::Draw(D3D11_PRIMITIVE_TOPOLOGY topology, bool isIndexed, uint16_t const* indices, size_t indexCount, size_t vertexCount, void** pMappedVertices)
{
if (isIndexed && !indices)
throw std::exception("Indices cannot be null");
if (indexCount >= mMaxIndices)
throw std::exception("Too many indices");
if (vertexCount >= mMaxVertices)
throw std::exception("Too many vertices");
if (!mInBeginEndPair)
throw std::exception("Begin must be called before Draw");
// Can we merge this primitive in with an existing batch, or must we flush first?
bool wrapIndexBuffer = (mCurrentIndex + indexCount > mMaxIndices);
bool wrapVertexBuffer = (mCurrentVertex + vertexCount > mMaxVertices);
if ((topology != mCurrentTopology) ||
(isIndexed != mCurrentlyIndexed) ||
!CanBatchPrimitives(topology) ||
wrapIndexBuffer || wrapVertexBuffer)
{
FlushBatch();
}
#if defined(_XBOX_ONE) && defined(_TITLE)
if (mCurrentTopology == D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED)
{
auto& grfxMem = GraphicsMemory::Get();
if (isIndexed)
{
grfxMemoryIB = grfxMem.Allocate(mDeviceContext.Get(), mMaxIndices * sizeof(uint16_t), 64);
}
grfxMemoryVB = grfxMem.Allocate(mDeviceContext.Get(), mMaxVertices * mVertexSize, 64);
mCurrentTopology = topology;
mCurrentlyIndexed = isIndexed;
mCurrentIndex = mCurrentVertex = 0;
}
// Copy over the index data.
if (isIndexed)
{
assert(grfxMemoryIB != 0);
auto outputIndices = reinterpret_cast<uint16_t*>(grfxMemoryIB) + mCurrentIndex;
for (size_t i = 0; i < indexCount; i++)
{
outputIndices[i] = (uint16_t)(indices[i] + mCurrentVertex);
}
mCurrentIndex += indexCount;
}
// Return the output vertex data location.
assert(grfxMemoryVB != 0);
*pMappedVertices = reinterpret_cast<uint8_t*>(grfxMemoryVB) + (mCurrentVertex * mVertexSize);
mCurrentVertex += vertexCount;
#else
if (wrapIndexBuffer)
mCurrentIndex = 0;
if (wrapVertexBuffer)
mCurrentVertex = 0;
// If we are not already in a batch, lock the buffers.
if (mCurrentTopology == D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED)
{
if (isIndexed)
{
LockBuffer(mDeviceContext.Get(), mIndexBuffer.Get(), mCurrentIndex, &mBaseIndex, &mMappedIndices);
}
LockBuffer(mDeviceContext.Get(), mVertexBuffer.Get(), mCurrentVertex, &mBaseVertex, &mMappedVertices);
mCurrentTopology = topology;
mCurrentlyIndexed = isIndexed;
}
// Copy over the index data.
if (isIndexed)
{
auto outputIndices = reinterpret_cast<uint16_t*>(mMappedIndices.pData) + mCurrentIndex;
for (size_t i = 0; i < indexCount; i++)
{
outputIndices[i] = (uint16_t)(indices[i] + mCurrentVertex - mBaseVertex);
}
mCurrentIndex += indexCount;
}
// Return the output vertex data location.
*pMappedVertices = reinterpret_cast<uint8_t*>(mMappedVertices.pData) + (mCurrentVertex * mVertexSize);
mCurrentVertex += vertexCount;
#endif
}
// Sends queued primitives to the graphics device.
void PrimitiveBatchBase::Impl::FlushBatch()
{
// Early out if there is nothing to flush.
if (mCurrentTopology == D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED)
return;
mDeviceContext->IASetPrimitiveTopology(mCurrentTopology);
#if defined(_XBOX_ONE) && defined(_TITLE)
if (mCurrentlyIndexed)
{
// Draw indexed geometry.
mDeviceContext->IASetPlacementIndexBuffer(mIndexBuffer.Get(), grfxMemoryIB, DXGI_FORMAT_R16_UINT);
mDeviceContext->IASetPlacementVertexBuffer(0, mVertexBuffer.Get(), grfxMemoryVB, (UINT)mVertexSize);
mDeviceContext->DrawIndexed((UINT)mCurrentIndex, 0, 0);
}
else
{
// Draw non-indexed geometry.
mDeviceContext->IASetPlacementVertexBuffer(0, mVertexBuffer.Get(), grfxMemoryVB, (UINT)mVertexSize);
mDeviceContext->Draw((UINT)mCurrentVertex, 0);
}
grfxMemoryIB = grfxMemoryVB = nullptr;
#else
mDeviceContext->Unmap(mVertexBuffer.Get(), 0);
if (mCurrentlyIndexed)
{
// Draw indexed geometry.
mDeviceContext->Unmap(mIndexBuffer.Get(), 0);
mDeviceContext->DrawIndexed((UINT)(mCurrentIndex - mBaseIndex), (UINT)mBaseIndex, (UINT)mBaseVertex);
}
else
{
// Draw non-indexed geometry.
mDeviceContext->Draw((UINT)(mCurrentVertex - mBaseVertex), (UINT)mBaseVertex);
}
#endif
mCurrentTopology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
}
// Public constructor.
PrimitiveBatchBase::PrimitiveBatchBase(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices, size_t maxVertices, size_t vertexSize)
: pImpl(new Impl(deviceContext, maxIndices, maxVertices, vertexSize))
{
}
// Move constructor.
PrimitiveBatchBase::PrimitiveBatchBase(PrimitiveBatchBase&& moveFrom)
: pImpl(std::move(moveFrom.pImpl))
{
}
// Move assignment.
PrimitiveBatchBase& PrimitiveBatchBase::operator= (PrimitiveBatchBase&& moveFrom)
{
pImpl = std::move(moveFrom.pImpl);
return *this;
}
// Public destructor.
PrimitiveBatchBase::~PrimitiveBatchBase()
{
}
void PrimitiveBatchBase::Begin()
{
pImpl->Begin();
}
void PrimitiveBatchBase::End()
{
pImpl->End();
}
_Use_decl_annotations_
void PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY topology, bool isIndexed, uint16_t const* indices, size_t indexCount, size_t vertexCount, void** pMappedVertices)
{
pImpl->Draw(topology, isIndexed, indices, indexCount, vertexCount, pMappedVertices);
}

345
DirectXTK/Src/SDKMesh.h Normal file
View File

@@ -0,0 +1,345 @@
//--------------------------------------------------------------------------------------
// File: SDKMesh.h
//
// SDKMESH format is generated by the legacy DirectX SDK's Content Exporter and
// originally rendered by the DXUT helper class SDKMesh
//
// http://go.microsoft.com/fwlink/?LinkId=226208
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
#pragma once
namespace DXUT
{
// .SDKMESH files
// SDKMESH_HEADER
// SDKMESH_VERTEX_BUFFER_HEADER header->VertexStreamHeadersOffset
// SDKMESH_INDEX_BUFFER_HEADER header->IndexStreamHeadersOffset
// SDKMESH_MESH header->MeshDataOffset
// SDKMESH_SUBSET header->SubsetDataOffset
// SDKMESH_FRAME header->FrameDataOffset
// SDKMESH_MATERIAL header->MaterialDataOffset
// [header->NonBufferDataSize]
// { [ header->NumVertexBuffers]
// VB data
// }
// { [ header->NumIndexBuffers]
// IB data
// }
// .SDDKANIM files
// SDKANIMATION_FILE_HEADER
// uint8_t[] - Length of fileheader->AnimationDataSize
// .SDKMESH uses Direct3D 9 decls, but only a subset of these is ever generated by the legacy DirectX SDK Content Exporter
// D3DDECLUSAGE_POSITION / D3DDECLTYPE_FLOAT3
// (D3DDECLUSAGE_BLENDWEIGHT / D3DDECLTYPE_UBYTE4N
// D3DDECLUSAGE_BLENDINDICES / D3DDECLTYPE_UBYTE4)?
// (D3DDECLUSAGE_NORMAL / D3DDECLTYPE_FLOAT3, D3DDECLTYPE_FLOAT16_4, D3DDECLTYPE_SHORT4N, D3DDECLTYPE_UBYTE4N, or D3DDECLTYPE_DEC3N [not supported])?
// (D3DDECLUSAGE_COLOR / D3DDECLTYPE_D3DCOLOR)?
// (D3DDECLUSAGE_TEXCOORD / D3DDECLTYPE_FLOAT1, D3DDECLTYPE_FLOAT2 or D3DDECLTYPE_FLOAT16_2, D3DDECLTYPE_FLOAT3 or D3DDECLTYPE_FLOAT16_4, D3DDECLTYPE_FLOAT4 or D3DDECLTYPE_FLOAT16_4)*
// (D3DDECLUSAGE_TANGENT / same as D3DDECLUSAGE_NORMAL)?
// (D3DDECLUSAGE_BINORMAL / same as D3DDECLUSAGE_NORMAL)?
enum D3DDECLUSAGE
{
D3DDECLUSAGE_POSITION = 0,
D3DDECLUSAGE_BLENDWEIGHT =1,
D3DDECLUSAGE_BLENDINDICES =2,
D3DDECLUSAGE_NORMAL =3,
D3DDECLUSAGE_TEXCOORD = 5,
D3DDECLUSAGE_TANGENT = 6,
D3DDECLUSAGE_BINORMAL = 7,
D3DDECLUSAGE_COLOR = 10,
};
enum D3DDECLTYPE
{
D3DDECLTYPE_FLOAT1 = 0, // 1D float expanded to (value, 0., 0., 1.)
D3DDECLTYPE_FLOAT2 = 1, // 2D float expanded to (value, value, 0., 1.)
D3DDECLTYPE_FLOAT3 = 2, // 3D float expanded to (value, value, value, 1.)
D3DDECLTYPE_FLOAT4 = 3, // 4D float
D3DDECLTYPE_D3DCOLOR = 4, // 4D packed unsigned bytes mapped to 0. to 1. range
// Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A)
D3DDECLTYPE_UBYTE4 = 5, // 4D unsigned uint8_t
D3DDECLTYPE_UBYTE4N = 8, // Each of 4 bytes is normalized by dividing to 255.0
D3DDECLTYPE_SHORT4N = 10, // 4D signed short normalized (v[0]/32767.0,v[1]/32767.0,v[2]/32767.0,v[3]/32767.0)
// Note: There is no equivalent to D3DDECLTYPE_DEC3N (14) as a DXGI_FORMAT
D3DDECLTYPE_FLOAT16_2 = 15, // Two 16-bit floating point values, expanded to (value, value, 0, 1)
D3DDECLTYPE_FLOAT16_4 = 16, // Four 16-bit floating point values
D3DDECLTYPE_UNUSED = 17, // When the type field in a decl is unused.
// These are extensions for DXGI-based versions of Direct3D
D3DDECLTYPE_DXGI_R10G10B10A2_UNORM = 32 + DXGI_FORMAT_R10G10B10A2_UNORM,
D3DDECLTYPE_DXGI_R11G11B10_FLOAT = 32 + DXGI_FORMAT_R11G11B10_FLOAT,
D3DDECLTYPE_DXGI_R8G8B8A8_SNORM = 32 + DXGI_FORMAT_R8G8B8A8_SNORM,
};
#pragma pack(push,4)
struct D3DVERTEXELEMENT9
{
uint16_t Stream; // Stream index
uint16_t Offset; // Offset in the stream in bytes
uint8_t Type; // Data type
uint8_t Method; // Processing method
uint8_t Usage; // Semantics
uint8_t UsageIndex; // Semantic index
};
#pragma pack(pop)
//--------------------------------------------------------------------------------------
// Hard Defines for the various structures
//--------------------------------------------------------------------------------------
const uint32_t SDKMESH_FILE_VERSION = 101;
const uint32_t MAX_VERTEX_ELEMENTS = 32;
const uint32_t MAX_VERTEX_STREAMS = 16;
const uint32_t MAX_FRAME_NAME = 100;
const uint32_t MAX_MESH_NAME = 100;
const uint32_t MAX_SUBSET_NAME = 100;
const uint32_t MAX_MATERIAL_NAME = 100;
const uint32_t MAX_TEXTURE_NAME = MAX_PATH;
const uint32_t MAX_MATERIAL_PATH = MAX_PATH;
const uint32_t INVALID_FRAME = uint32_t(-1);
const uint32_t INVALID_MESH = uint32_t(-1);
const uint32_t INVALID_MATERIAL = uint32_t(-1);
const uint32_t INVALID_SUBSET = uint32_t(-1);
const uint32_t INVALID_ANIMATION_DATA = uint32_t(-1);
const uint32_t INVALID_SAMPLER_SLOT = uint32_t(-1);
const uint32_t ERROR_RESOURCE_VALUE = 1;
//--------------------------------------------------------------------------------------
// Enumerated Types.
//--------------------------------------------------------------------------------------
enum SDKMESH_PRIMITIVE_TYPE
{
PT_TRIANGLE_LIST = 0,
PT_TRIANGLE_STRIP,
PT_LINE_LIST,
PT_LINE_STRIP,
PT_POINT_LIST,
PT_TRIANGLE_LIST_ADJ,
PT_TRIANGLE_STRIP_ADJ,
PT_LINE_LIST_ADJ,
PT_LINE_STRIP_ADJ,
PT_QUAD_PATCH_LIST,
PT_TRIANGLE_PATCH_LIST,
};
enum SDKMESH_INDEX_TYPE
{
IT_16BIT = 0,
IT_32BIT,
};
enum FRAME_TRANSFORM_TYPE
{
FTT_RELATIVE = 0,
FTT_ABSOLUTE, //This is not currently used but is here to support absolute transformations in the future
};
//--------------------------------------------------------------------------------------
// Structures.
//--------------------------------------------------------------------------------------
#pragma pack(push,8)
struct SDKMESH_HEADER
{
//Basic Info and sizes
uint32_t Version;
uint8_t IsBigEndian;
uint64_t HeaderSize;
uint64_t NonBufferDataSize;
uint64_t BufferDataSize;
//Stats
uint32_t NumVertexBuffers;
uint32_t NumIndexBuffers;
uint32_t NumMeshes;
uint32_t NumTotalSubsets;
uint32_t NumFrames;
uint32_t NumMaterials;
//Offsets to Data
uint64_t VertexStreamHeadersOffset;
uint64_t IndexStreamHeadersOffset;
uint64_t MeshDataOffset;
uint64_t SubsetDataOffset;
uint64_t FrameDataOffset;
uint64_t MaterialDataOffset;
};
struct SDKMESH_VERTEX_BUFFER_HEADER
{
uint64_t NumVertices;
uint64_t SizeBytes;
uint64_t StrideBytes;
D3DVERTEXELEMENT9 Decl[MAX_VERTEX_ELEMENTS];
union
{
uint64_t DataOffset;
};
};
struct SDKMESH_INDEX_BUFFER_HEADER
{
uint64_t NumIndices;
uint64_t SizeBytes;
uint32_t IndexType;
union
{
uint64_t DataOffset;
};
};
struct SDKMESH_MESH
{
char Name[MAX_MESH_NAME];
uint8_t NumVertexBuffers;
uint32_t VertexBuffers[MAX_VERTEX_STREAMS];
uint32_t IndexBuffer;
uint32_t NumSubsets;
uint32_t NumFrameInfluences; //aka bones
DirectX::XMFLOAT3 BoundingBoxCenter;
DirectX::XMFLOAT3 BoundingBoxExtents;
union
{
uint64_t SubsetOffset;
INT* pSubsets;
};
union
{
uint64_t FrameInfluenceOffset;
uint32_t* pFrameInfluences;
};
};
struct SDKMESH_SUBSET
{
char Name[MAX_SUBSET_NAME];
uint32_t MaterialID;
uint32_t PrimitiveType;
uint64_t IndexStart;
uint64_t IndexCount;
uint64_t VertexStart;
uint64_t VertexCount;
};
struct SDKMESH_FRAME
{
char Name[MAX_FRAME_NAME];
uint32_t Mesh;
uint32_t ParentFrame;
uint32_t ChildFrame;
uint32_t SiblingFrame;
DirectX::XMFLOAT4X4 Matrix;
uint32_t AnimationDataIndex; //Used to index which set of keyframes transforms this frame
};
struct SDKMESH_MATERIAL
{
char Name[MAX_MATERIAL_NAME];
// Use MaterialInstancePath
char MaterialInstancePath[MAX_MATERIAL_PATH];
// Or fall back to d3d8-type materials
char DiffuseTexture[MAX_TEXTURE_NAME];
char NormalTexture[MAX_TEXTURE_NAME];
char SpecularTexture[MAX_TEXTURE_NAME];
DirectX::XMFLOAT4 Diffuse;
DirectX::XMFLOAT4 Ambient;
DirectX::XMFLOAT4 Specular;
DirectX::XMFLOAT4 Emissive;
float Power;
union
{
uint64_t Force64_1; //Force the union to 64bits
};
union
{
uint64_t Force64_2; //Force the union to 64bits
};
union
{
uint64_t Force64_3; //Force the union to 64bits
};
union
{
uint64_t Force64_4; //Force the union to 64bits
};
union
{
uint64_t Force64_5; //Force the union to 64bits
};
union
{
uint64_t Force64_6; //Force the union to 64bits
};
};
struct SDKANIMATION_FILE_HEADER
{
uint32_t Version;
uint8_t IsBigEndian;
uint32_t FrameTransformType;
uint32_t NumFrames;
uint32_t NumAnimationKeys;
uint32_t AnimationFPS;
uint64_t AnimationDataSize;
uint64_t AnimationDataOffset;
};
struct SDKANIMATION_DATA
{
DirectX::XMFLOAT3 Translation;
DirectX::XMFLOAT4 Orientation;
DirectX::XMFLOAT3 Scaling;
};
struct SDKANIMATION_FRAME_DATA
{
char FrameName[MAX_FRAME_NAME];
union
{
uint64_t DataOffset;
SDKANIMATION_DATA* pAnimationData;
};
};
#pragma pack(pop)
} // namespace
static_assert( sizeof(DXUT::D3DVERTEXELEMENT9) == 8, "Direct3D9 Decl structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_HEADER)== 104, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_VERTEX_BUFFER_HEADER) == 288, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_INDEX_BUFFER_HEADER) == 32, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_MESH) == 224, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_SUBSET) == 144, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_FRAME) == 184, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKMESH_MATERIAL) == 1256, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKANIMATION_FILE_HEADER) == 40, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKANIMATION_DATA) == 40, "SDK Mesh structure size incorrect" );
static_assert( sizeof(DXUT::SDKANIMATION_FRAME_DATA) == 112, "SDK Mesh structure size incorrect" );

View File

@@ -0,0 +1,658 @@
//--------------------------------------------------------------------------------------
// File: ScreenGrab.cpp
//
// Function for capturing a 2D texture and saving it to a file (aka a 'screenshot'
// when used on a Direct3D Render Target).
//
// Note these functions are useful as a light-weight runtime screen grabber. For
// full-featured texture capture, DDS writer, and texture processing pipeline,
// see the 'Texconv' sample and the 'DirectXTex' library.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248926
// http://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------
// Does not capture 1D textures or 3D textures (volume maps)
// Does not capture mipmap chains, only the top-most texture level is saved
// For 2D array textures and cubemaps, it captures only the first image in the array
#include "pch.h"
#include "ScreenGrab.h"
#include "DirectXHelpers.h"
#include "dds.h"
#include "PlatformHelpers.h"
#include "LoaderHelpers.h"
using Microsoft::WRL::ComPtr;
using namespace DirectX;
using namespace DirectX::LoaderHelpers;
namespace
{
//--------------------------------------------------------------------------------------
HRESULT CaptureTexture(_In_ ID3D11DeviceContext* pContext,
_In_ ID3D11Resource* pSource,
D3D11_TEXTURE2D_DESC& desc,
ComPtr<ID3D11Texture2D>& pStaging)
{
if (!pContext || !pSource)
return E_INVALIDARG;
D3D11_RESOURCE_DIMENSION resType = D3D11_RESOURCE_DIMENSION_UNKNOWN;
pSource->GetType(&resType);
if (resType != D3D11_RESOURCE_DIMENSION_TEXTURE2D)
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
ComPtr<ID3D11Texture2D> pTexture;
HRESULT hr = pSource->QueryInterface(IID_GRAPHICS_PPV_ARGS(pTexture.GetAddressOf()));
if (FAILED(hr))
return hr;
assert(pTexture);
pTexture->GetDesc(&desc);
ComPtr<ID3D11Device> d3dDevice;
pContext->GetDevice(d3dDevice.GetAddressOf());
if (desc.SampleDesc.Count > 1)
{
// MSAA content must be resolved before being copied to a staging texture
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
ComPtr<ID3D11Texture2D> pTemp;
hr = d3dDevice->CreateTexture2D(&desc, 0, pTemp.GetAddressOf());
if (FAILED(hr))
return hr;
assert(pTemp);
DXGI_FORMAT fmt = EnsureNotTypeless(desc.Format);
UINT support = 0;
hr = d3dDevice->CheckFormatSupport(fmt, &support);
if (FAILED(hr))
return hr;
if (!(support & D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE))
return E_FAIL;
for (UINT item = 0; item < desc.ArraySize; ++item)
{
for (UINT level = 0; level < desc.MipLevels; ++level)
{
UINT index = D3D11CalcSubresource(level, item, desc.MipLevels);
pContext->ResolveSubresource(pTemp.Get(), index, pSource, index, fmt);
}
}
desc.BindFlags = 0;
desc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
desc.Usage = D3D11_USAGE_STAGING;
hr = d3dDevice->CreateTexture2D(&desc, 0, pStaging.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
assert(pStaging);
pContext->CopyResource(pStaging.Get(), pTemp.Get());
}
else if ((desc.Usage == D3D11_USAGE_STAGING) && (desc.CPUAccessFlags & D3D11_CPU_ACCESS_READ))
{
// Handle case where the source is already a staging texture we can use directly
pStaging = pTexture;
}
else
{
// Otherwise, create a staging texture from the non-MSAA source
desc.BindFlags = 0;
desc.MiscFlags &= D3D11_RESOURCE_MISC_TEXTURECUBE;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
desc.Usage = D3D11_USAGE_STAGING;
hr = d3dDevice->CreateTexture2D(&desc, 0, pStaging.ReleaseAndGetAddressOf());
if (FAILED(hr))
return hr;
assert(pStaging);
pContext->CopyResource(pStaging.Get(), pSource);
}
#if defined(_XBOX_ONE) && defined(_TITLE)
if (d3dDevice->GetCreationFlags() & D3D11_CREATE_DEVICE_IMMEDIATE_CONTEXT_FAST_SEMANTICS)
{
ComPtr<ID3D11DeviceX> d3dDeviceX;
hr = d3dDevice.As(&d3dDeviceX);
if (FAILED(hr))
return hr;
ComPtr<ID3D11DeviceContextX> d3dContextX;
hr = pContext->QueryInterface(IID_GRAPHICS_PPV_ARGS(d3dContextX.GetAddressOf()));
if (FAILED(hr))
return hr;
UINT64 copyFence = d3dContextX->InsertFence(0);
while (d3dDeviceX->IsFencePending(copyFence))
{
SwitchToThread();
}
}
#endif
return S_OK;
}
} // anonymous namespace
//--------------------------------------------------------------------------------------
_Use_decl_annotations_
HRESULT DirectX::SaveDDSTextureToFile( ID3D11DeviceContext* pContext,
ID3D11Resource* pSource,
const wchar_t* fileName )
{
if ( !fileName )
return E_INVALIDARG;
D3D11_TEXTURE2D_DESC desc = {};
ComPtr<ID3D11Texture2D> pStaging;
HRESULT hr = CaptureTexture( pContext, pSource, desc, pStaging );
if ( FAILED(hr) )
return hr;
// Create file
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
ScopedHandle hFile( safe_handle( CreateFile2( fileName, GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr ) ) );
#else
ScopedHandle hFile( safe_handle( CreateFileW( fileName, GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, 0, nullptr ) ) );
#endif
if ( !hFile )
return HRESULT_FROM_WIN32( GetLastError() );
auto_delete_file delonfail(hFile.get());
// Setup header
const size_t MAX_HEADER_SIZE = sizeof(uint32_t) + sizeof(DDS_HEADER) + sizeof(DDS_HEADER_DXT10);
uint8_t fileHeader[ MAX_HEADER_SIZE ];
*reinterpret_cast<uint32_t*>(&fileHeader[0]) = DDS_MAGIC;
auto header = reinterpret_cast<DDS_HEADER*>( &fileHeader[0] + sizeof(uint32_t) );
size_t headerSize = sizeof(uint32_t) + sizeof(DDS_HEADER);
memset( header, 0, sizeof(DDS_HEADER) );
header->size = sizeof( DDS_HEADER );
header->flags = DDS_HEADER_FLAGS_TEXTURE | DDS_HEADER_FLAGS_MIPMAP;
header->height = desc.Height;
header->width = desc.Width;
header->mipMapCount = 1;
header->caps = DDS_SURFACE_FLAGS_TEXTURE;
// Try to use a legacy .DDS pixel format for better tools support, otherwise fallback to 'DX10' header extension
DDS_HEADER_DXT10* extHeader = nullptr;
switch( desc.Format )
{
case DXGI_FORMAT_R8G8B8A8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_A8B8G8R8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R16G16_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_G16R16, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R8G8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_A8L8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R16_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_L16, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_L8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_A8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_A8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R8G8_B8G8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_R8G8_B8G8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_G8R8_G8B8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_G8R8_G8B8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC1_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_DXT1, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC2_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_DXT3, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC3_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_DXT5, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC4_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_BC4_UNORM, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC4_SNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_BC4_SNORM, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC5_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_BC5_UNORM, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_BC5_SNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_BC5_SNORM, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_B5G6R5_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_R5G6B5, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_B5G5R5A1_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_A1R5G5B5, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R8G8_SNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_V8U8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R8G8B8A8_SNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_Q8W8V8U8, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_R16G16_SNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_V16U16, sizeof(DDS_PIXELFORMAT) ); break;
case DXGI_FORMAT_B8G8R8A8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_A8R8G8B8, sizeof(DDS_PIXELFORMAT) ); break; // DXGI 1.1
case DXGI_FORMAT_B8G8R8X8_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_X8R8G8B8, sizeof(DDS_PIXELFORMAT) ); break; // DXGI 1.1
case DXGI_FORMAT_YUY2: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_YUY2, sizeof(DDS_PIXELFORMAT) ); break; // DXGI 1.2
case DXGI_FORMAT_B4G4R4A4_UNORM: memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_A4R4G4B4, sizeof(DDS_PIXELFORMAT) ); break; // DXGI 1.2
// Legacy D3DX formats using D3DFMT enum value as FourCC
case DXGI_FORMAT_R32G32B32A32_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 116; break; // D3DFMT_A32B32G32R32F
case DXGI_FORMAT_R16G16B16A16_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 113; break; // D3DFMT_A16B16G16R16F
case DXGI_FORMAT_R16G16B16A16_UNORM: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 36; break; // D3DFMT_A16B16G16R16
case DXGI_FORMAT_R16G16B16A16_SNORM: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 110; break; // D3DFMT_Q16W16V16U16
case DXGI_FORMAT_R32G32_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 115; break; // D3DFMT_G32R32F
case DXGI_FORMAT_R16G16_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 112; break; // D3DFMT_G16R16F
case DXGI_FORMAT_R32_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 114; break; // D3DFMT_R32F
case DXGI_FORMAT_R16_FLOAT: header->ddspf.size = sizeof(DDS_PIXELFORMAT); header->ddspf.flags = DDS_FOURCC; header->ddspf.fourCC = 111; break; // D3DFMT_R16F
case DXGI_FORMAT_AI44:
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
default:
memcpy_s( &header->ddspf, sizeof(header->ddspf), &DDSPF_DX10, sizeof(DDS_PIXELFORMAT) );
headerSize += sizeof(DDS_HEADER_DXT10);
extHeader = reinterpret_cast<DDS_HEADER_DXT10*>( reinterpret_cast<uint8_t*>(&fileHeader[0]) + sizeof(uint32_t) + sizeof(DDS_HEADER) );
memset( extHeader, 0, sizeof(DDS_HEADER_DXT10) );
extHeader->dxgiFormat = desc.Format;
extHeader->resourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
extHeader->arraySize = 1;
break;
}
size_t rowPitch, slicePitch, rowCount;
GetSurfaceInfo( desc.Width, desc.Height, desc.Format, &slicePitch, &rowPitch, &rowCount );
if ( IsCompressed( desc.Format ) )
{
header->flags |= DDS_HEADER_FLAGS_LINEARSIZE;
header->pitchOrLinearSize = static_cast<uint32_t>( slicePitch );
}
else
{
header->flags |= DDS_HEADER_FLAGS_PITCH;
header->pitchOrLinearSize = static_cast<uint32_t>( rowPitch );
}
// Setup pixels
std::unique_ptr<uint8_t[]> pixels( new (std::nothrow) uint8_t[ slicePitch ] );
if (!pixels)
return E_OUTOFMEMORY;
D3D11_MAPPED_SUBRESOURCE mapped;
hr = pContext->Map( pStaging.Get(), 0, D3D11_MAP_READ, 0, &mapped );
if ( FAILED(hr) )
return hr;
auto sptr = reinterpret_cast<const uint8_t*>( mapped.pData );
if ( !sptr )
{
pContext->Unmap( pStaging.Get(), 0 );
return E_POINTER;
}
uint8_t* dptr = pixels.get();
size_t msize = std::min<size_t>( rowPitch, mapped.RowPitch );
for( size_t h = 0; h < rowCount; ++h )
{
memcpy_s( dptr, rowPitch, sptr, msize );
sptr += mapped.RowPitch;
dptr += rowPitch;
}
pContext->Unmap( pStaging.Get(), 0 );
// Write header & pixels
DWORD bytesWritten;
if ( !WriteFile( hFile.get(), fileHeader, static_cast<DWORD>( headerSize ), &bytesWritten, nullptr ) )
return HRESULT_FROM_WIN32( GetLastError() );
if ( bytesWritten != headerSize )
return E_FAIL;
if ( !WriteFile( hFile.get(), pixels.get(), static_cast<DWORD>( slicePitch ), &bytesWritten, nullptr ) )
return HRESULT_FROM_WIN32( GetLastError() );
if ( bytesWritten != slicePitch )
return E_FAIL;
delonfail.clear();
return S_OK;
}
//--------------------------------------------------------------------------------------
namespace DirectX
{
extern bool _IsWIC2();
extern IWICImagingFactory* _GetWIC();
}
_Use_decl_annotations_
HRESULT DirectX::SaveWICTextureToFile( ID3D11DeviceContext* pContext,
ID3D11Resource* pSource,
REFGUID guidContainerFormat,
const wchar_t* fileName,
const GUID* targetFormat,
std::function<void(IPropertyBag2*)> setCustomProps )
{
if ( !fileName )
return E_INVALIDARG;
D3D11_TEXTURE2D_DESC desc = {};
ComPtr<ID3D11Texture2D> pStaging;
HRESULT hr = CaptureTexture( pContext, pSource, desc, pStaging );
if ( FAILED(hr) )
return hr;
// Determine source format's WIC equivalent
WICPixelFormatGUID pfGuid;
bool sRGB = false;
switch ( desc.Format )
{
case DXGI_FORMAT_R32G32B32A32_FLOAT: pfGuid = GUID_WICPixelFormat128bppRGBAFloat; break;
case DXGI_FORMAT_R16G16B16A16_FLOAT: pfGuid = GUID_WICPixelFormat64bppRGBAHalf; break;
case DXGI_FORMAT_R16G16B16A16_UNORM: pfGuid = GUID_WICPixelFormat64bppRGBA; break;
case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM: pfGuid = GUID_WICPixelFormat32bppRGBA1010102XR; break; // DXGI 1.1
case DXGI_FORMAT_R10G10B10A2_UNORM: pfGuid = GUID_WICPixelFormat32bppRGBA1010102; break;
case DXGI_FORMAT_B5G5R5A1_UNORM: pfGuid = GUID_WICPixelFormat16bppBGRA5551; break;
case DXGI_FORMAT_B5G6R5_UNORM: pfGuid = GUID_WICPixelFormat16bppBGR565; break;
case DXGI_FORMAT_R32_FLOAT: pfGuid = GUID_WICPixelFormat32bppGrayFloat; break;
case DXGI_FORMAT_R16_FLOAT: pfGuid = GUID_WICPixelFormat16bppGrayHalf; break;
case DXGI_FORMAT_R16_UNORM: pfGuid = GUID_WICPixelFormat16bppGray; break;
case DXGI_FORMAT_R8_UNORM: pfGuid = GUID_WICPixelFormat8bppGray; break;
case DXGI_FORMAT_A8_UNORM: pfGuid = GUID_WICPixelFormat8bppAlpha; break;
case DXGI_FORMAT_R8G8B8A8_UNORM:
pfGuid = GUID_WICPixelFormat32bppRGBA;
break;
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
pfGuid = GUID_WICPixelFormat32bppRGBA;
sRGB = true;
break;
case DXGI_FORMAT_B8G8R8A8_UNORM: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGRA;
break;
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGRA;
sRGB = true;
break;
case DXGI_FORMAT_B8G8R8X8_UNORM: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGR;
break;
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB: // DXGI 1.1
pfGuid = GUID_WICPixelFormat32bppBGR;
sRGB = true;
break;
default:
return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
}
auto pWIC = _GetWIC();
if ( !pWIC )
return E_NOINTERFACE;
ComPtr<IWICStream> stream;
hr = pWIC->CreateStream( stream.GetAddressOf() );
if ( FAILED(hr) )
return hr;
hr = stream->InitializeFromFilename( fileName, GENERIC_WRITE );
if ( FAILED(hr) )
return hr;
auto_delete_file_wic delonfail(stream, fileName);
ComPtr<IWICBitmapEncoder> encoder;
hr = pWIC->CreateEncoder( guidContainerFormat, 0, encoder.GetAddressOf() );
if ( FAILED(hr) )
return hr;
hr = encoder->Initialize( stream.Get(), WICBitmapEncoderNoCache );
if ( FAILED(hr) )
return hr;
ComPtr<IWICBitmapFrameEncode> frame;
ComPtr<IPropertyBag2> props;
hr = encoder->CreateNewFrame( frame.GetAddressOf(), props.GetAddressOf() );
if ( FAILED(hr) )
return hr;
if ( targetFormat && memcmp( &guidContainerFormat, &GUID_ContainerFormatBmp, sizeof(WICPixelFormatGUID) ) == 0 && _IsWIC2() )
{
// Opt-in to the WIC2 support for writing 32-bit Windows BMP files with an alpha channel
PROPBAG2 option = {};
option.pstrName = const_cast<wchar_t*>(L"EnableV5Header32bppBGRA");
VARIANT varValue;
varValue.vt = VT_BOOL;
varValue.boolVal = VARIANT_TRUE;
(void)props->Write( 1, &option, &varValue );
}
if ( setCustomProps )
{
setCustomProps( props.Get() );
}
hr = frame->Initialize( props.Get() );
if ( FAILED(hr) )
return hr;
hr = frame->SetSize( desc.Width , desc.Height );
if ( FAILED(hr) )
return hr;
hr = frame->SetResolution( 72, 72 );
if ( FAILED(hr) )
return hr;
// Pick a target format
WICPixelFormatGUID targetGuid;
if ( targetFormat )
{
targetGuid = *targetFormat;
}
else
{
// Screenshots don<6F>t typically include the alpha channel of the render target
switch ( desc.Format )
{
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
case DXGI_FORMAT_R32G32B32A32_FLOAT:
case DXGI_FORMAT_R16G16B16A16_FLOAT:
if ( _IsWIC2() )
{
targetGuid = GUID_WICPixelFormat96bppRGBFloat;
}
else
{
targetGuid = GUID_WICPixelFormat24bppBGR;
}
break;
#endif
case DXGI_FORMAT_R16G16B16A16_UNORM: targetGuid = GUID_WICPixelFormat48bppBGR; break;
case DXGI_FORMAT_B5G5R5A1_UNORM: targetGuid = GUID_WICPixelFormat16bppBGR555; break;
case DXGI_FORMAT_B5G6R5_UNORM: targetGuid = GUID_WICPixelFormat16bppBGR565; break;
case DXGI_FORMAT_R32_FLOAT:
case DXGI_FORMAT_R16_FLOAT:
case DXGI_FORMAT_R16_UNORM:
case DXGI_FORMAT_R8_UNORM:
case DXGI_FORMAT_A8_UNORM:
targetGuid = GUID_WICPixelFormat8bppGray;
break;
default:
targetGuid = GUID_WICPixelFormat24bppBGR;
break;
}
}
hr = frame->SetPixelFormat( &targetGuid );
if ( FAILED(hr) )
return hr;
if ( targetFormat && memcmp( targetFormat, &targetGuid, sizeof(WICPixelFormatGUID) ) != 0 )
{
// Requested output pixel format is not supported by the WIC codec
return E_FAIL;
}
// Encode WIC metadata
ComPtr<IWICMetadataQueryWriter> metawriter;
if ( SUCCEEDED( frame->GetMetadataQueryWriter( metawriter.GetAddressOf() ) ) )
{
PROPVARIANT value;
PropVariantInit( &value );
value.vt = VT_LPSTR;
value.pszVal = const_cast<char*>("DirectXTK");
if ( memcmp( &guidContainerFormat, &GUID_ContainerFormatPng, sizeof(GUID) ) == 0 )
{
// Set Software name
(void)metawriter->SetMetadataByName( L"/tEXt/{str=Software}", &value );
// Set sRGB chunk
if (sRGB)
{
value.vt = VT_UI1;
value.bVal = 0;
(void)metawriter->SetMetadataByName(L"/sRGB/RenderingIntent", &value);
}
else
{
// add gAMA chunk with gamma 1.0
value.vt = VT_UI4;
value.uintVal = 100000; // gama value * 100,000 -- i.e. gamma 1.0
(void)metawriter->SetMetadataByName(L"/gAMA/ImageGamma", &value);
// remove sRGB chunk which is added by default.
(void)metawriter->RemoveMetadataByName(L"/sRGB/RenderingIntent");
}
}
#if defined(_XBOX_ONE) && defined(_TITLE)
else if ( memcmp( &guidContainerFormat, &GUID_ContainerFormatJpeg, sizeof(GUID) ) == 0 )
{
// Set Software name
(void)metawriter->SetMetadataByName( L"/app1/ifd/{ushort=305}", &value );
if ( sRGB )
{
// Set EXIF Colorspace of sRGB
value.vt = VT_UI2;
value.uiVal = 1;
(void)metawriter->SetMetadataByName( L"/app1/ifd/exif/{ushort=40961}", &value );
}
}
else if ( memcmp( &guidContainerFormat, &GUID_ContainerFormatTiff, sizeof(GUID) ) == 0 )
{
// Set Software name
(void)metawriter->SetMetadataByName( L"/ifd/{ushort=305}", &value );
if ( sRGB )
{
// Set EXIF Colorspace of sRGB
value.vt = VT_UI2;
value.uiVal = 1;
(void)metawriter->SetMetadataByName( L"/ifd/exif/{ushort=40961}", &value );
}
}
#else
else
{
// Set Software name
(void)metawriter->SetMetadataByName( L"System.ApplicationName", &value );
if ( sRGB )
{
// Set EXIF Colorspace of sRGB
value.vt = VT_UI2;
value.uiVal = 1;
(void)metawriter->SetMetadataByName( L"System.Image.ColorSpace", &value );
}
}
#endif
}
D3D11_MAPPED_SUBRESOURCE mapped;
hr = pContext->Map( pStaging.Get(), 0, D3D11_MAP_READ, 0, &mapped );
if ( FAILED(hr) )
return hr;
if ( memcmp( &targetGuid, &pfGuid, sizeof(WICPixelFormatGUID) ) != 0 )
{
// Conversion required to write
ComPtr<IWICBitmap> source;
hr = pWIC->CreateBitmapFromMemory( desc.Width, desc.Height, pfGuid,
mapped.RowPitch, mapped.RowPitch * desc.Height,
reinterpret_cast<BYTE*>( mapped.pData ), source.GetAddressOf() );
if ( FAILED(hr) )
{
pContext->Unmap( pStaging.Get(), 0 );
return hr;
}
ComPtr<IWICFormatConverter> FC;
hr = pWIC->CreateFormatConverter( FC.GetAddressOf() );
if ( FAILED(hr) )
{
pContext->Unmap( pStaging.Get(), 0 );
return hr;
}
BOOL canConvert = FALSE;
hr = FC->CanConvert( pfGuid, targetGuid, &canConvert );
if ( FAILED(hr) || !canConvert )
{
return E_UNEXPECTED;
}
hr = FC->Initialize( source.Get(), targetGuid, WICBitmapDitherTypeNone, nullptr, 0, WICBitmapPaletteTypeMedianCut );
if ( FAILED(hr) )
{
pContext->Unmap( pStaging.Get(), 0 );
return hr;
}
WICRect rect = { 0, 0, static_cast<INT>( desc.Width ), static_cast<INT>( desc.Height ) };
hr = frame->WriteSource( FC.Get(), &rect );
if ( FAILED(hr) )
{
pContext->Unmap( pStaging.Get(), 0 );
return hr;
}
}
else
{
// No conversion required
hr = frame->WritePixels( desc.Height, mapped.RowPitch, mapped.RowPitch * desc.Height, reinterpret_cast<BYTE*>( mapped.pData ) );
if ( FAILED(hr) )
return hr;
}
pContext->Unmap( pStaging.Get(), 0 );
hr = frame->Commit();
if ( FAILED(hr) )
return hr;
hr = encoder->Commit();
if ( FAILED(hr) )
return hr;
delonfail.clear();
return S_OK;
}

View File

@@ -0,0 +1,133 @@
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
Texture2D<float4> Texture : register(t0);
sampler Sampler : register(s0);
cbuffer Parameters : register(b0)
{
float4 DiffuseColor : packoffset(c0);
float4 AlphaTest : packoffset(c1);
float3 FogColor : packoffset(c2);
float4 FogVector : packoffset(c3);
float4x4 WorldViewProj : packoffset(c4);
};
#include "Structures.fxh"
#include "Common.fxh"
// Vertex shader: basic.
VSOutputTx VSAlphaTest(VSInputTx vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: no fog.
VSOutputTxNoFog VSAlphaTestNoFog(VSInputTx vin)
{
VSOutputTxNoFog vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParamsNoFog;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: vertex color.
VSOutputTx VSAlphaTestVc(VSInputTxVc vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: vertex color, no fog.
VSOutputTxNoFog VSAlphaTestVcNoFog(VSInputTxVc vin)
{
VSOutputTxNoFog vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParamsNoFog;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
// Pixel shader: less/greater compare function.
float4 PSAlphaTestLtGt(PSInputTx pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
clip((color.a < AlphaTest.x) ? AlphaTest.z : AlphaTest.w);
ApplyFog(color, pin.Specular.w);
return color;
}
// Pixel shader: less/greater compare function, no fog.
float4 PSAlphaTestLtGtNoFog(PSInputTxNoFog pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
clip((color.a < AlphaTest.x) ? AlphaTest.z : AlphaTest.w);
return color;
}
// Pixel shader: equal/notequal compare function.
float4 PSAlphaTestEqNe(PSInputTx pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
clip((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w);
ApplyFog(color, pin.Specular.w);
return color;
}
// Pixel shader: equal/notequal compare function, no fog.
float4 PSAlphaTestEqNeNoFog(PSInputTxNoFog pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
clip((abs(color.a - AlphaTest.x) < AlphaTest.y) ? AlphaTest.z : AlphaTest.w);
return color;
}

View File

@@ -0,0 +1,610 @@
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
Texture2D<float4> Texture : register(t0);
sampler Sampler : register(s0);
cbuffer Parameters : register(b0)
{
float4 DiffuseColor : packoffset(c0);
float3 EmissiveColor : packoffset(c1);
float3 SpecularColor : packoffset(c2);
float SpecularPower : packoffset(c2.w);
float3 LightDirection[3] : packoffset(c3);
float3 LightDiffuseColor[3] : packoffset(c6);
float3 LightSpecularColor[3] : packoffset(c9);
float3 EyePosition : packoffset(c12);
float3 FogColor : packoffset(c13);
float4 FogVector : packoffset(c14);
float4x4 World : packoffset(c15);
float3x3 WorldInverseTranspose : packoffset(c19);
float4x4 WorldViewProj : packoffset(c22);
};
#include "Structures.fxh"
#include "Common.fxh"
#include "Lighting.fxh"
// Vertex shader: basic.
VSOutput VSBasic(VSInput vin)
{
VSOutput vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParams;
return vout;
}
// Vertex shader: no fog.
VSOutputNoFog VSBasicNoFog(VSInput vin)
{
VSOutputNoFog vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParamsNoFog;
return vout;
}
// Vertex shader: vertex color.
VSOutput VSBasicVc(VSInputVc vin)
{
VSOutput vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParams;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: vertex color, no fog.
VSOutputNoFog VSBasicVcNoFog(VSInputVc vin)
{
VSOutputNoFog vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParamsNoFog;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: texture.
VSOutputTx VSBasicTx(VSInputTx vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: texture, no fog.
VSOutputTxNoFog VSBasicTxNoFog(VSInputTx vin)
{
VSOutputTxNoFog vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParamsNoFog;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: texture + vertex color.
VSOutputTx VSBasicTxVc(VSInputTxVc vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: texture + vertex color, no fog.
VSOutputTxNoFog VSBasicTxVcNoFog(VSInputTxVc vin)
{
VSOutputTxNoFog vout;
CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
SetCommonVSOutputParamsNoFog;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: vertex lighting.
VSOutput VSBasicVertexLighting(VSInputNm vin)
{
VSOutput vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 3);
SetCommonVSOutputParams;
return vout;
}
VSOutput VSBasicVertexLightingBn(VSInputNm vin)
{
VSOutput vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 3);
SetCommonVSOutputParams;
return vout;
}
// Vertex shader: vertex lighting + vertex color.
VSOutput VSBasicVertexLightingVc(VSInputNmVc vin)
{
VSOutput vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 3);
SetCommonVSOutputParams;
vout.Diffuse *= vin.Color;
return vout;
}
VSOutput VSBasicVertexLightingVcBn(VSInputNmVc vin)
{
VSOutput vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 3);
SetCommonVSOutputParams;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: vertex lighting + texture.
VSOutputTx VSBasicVertexLightingTx(VSInputNmTx vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 3);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
return vout;
}
VSOutputTx VSBasicVertexLightingTxBn(VSInputNmTx vin)
{
VSOutputTx vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 3);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: vertex lighting + texture + vertex color.
VSOutputTx VSBasicVertexLightingTxVc(VSInputNmTxVc vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 3);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
VSOutputTx VSBasicVertexLightingTxVcBn(VSInputNmTxVc vin)
{
VSOutputTx vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 3);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: one light.
VSOutput VSBasicOneLight(VSInputNm vin)
{
VSOutput vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 1);
SetCommonVSOutputParams;
return vout;
}
VSOutput VSBasicOneLightBn(VSInputNm vin)
{
VSOutput vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 1);
SetCommonVSOutputParams;
return vout;
}
// Vertex shader: one light + vertex color.
VSOutput VSBasicOneLightVc(VSInputNmVc vin)
{
VSOutput vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 1);
SetCommonVSOutputParams;
vout.Diffuse *= vin.Color;
return vout;
}
VSOutput VSBasicOneLightVcBn(VSInputNmVc vin)
{
VSOutput vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 1);
SetCommonVSOutputParams;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: one light + texture.
VSOutputTx VSBasicOneLightTx(VSInputNmTx vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 1);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
return vout;
}
VSOutputTx VSBasicOneLightTxBn(VSInputNmTx vin)
{
VSOutputTx vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 1);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: one light + texture + vertex color.
VSOutputTx VSBasicOneLightTxVc(VSInputNmTxVc vin)
{
VSOutputTx vout;
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal, 1);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
VSOutputTx VSBasicOneLightTxVcBn(VSInputNmTxVc vin)
{
VSOutputTx vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, normal, 1);
SetCommonVSOutputParams;
vout.TexCoord = vin.TexCoord;
vout.Diffuse *= vin.Color;
return vout;
}
// Vertex shader: pixel lighting.
VSOutputPixelLighting VSBasicPixelLighting(VSInputNm vin)
{
VSOutputPixelLighting vout;
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, vin.Normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse = float4(1, 1, 1, DiffuseColor.a);
return vout;
}
VSOutputPixelLighting VSBasicPixelLightingBn(VSInputNm vin)
{
VSOutputPixelLighting vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse = float4(1, 1, 1, DiffuseColor.a);
return vout;
}
// Vertex shader: pixel lighting + vertex color.
VSOutputPixelLighting VSBasicPixelLightingVc(VSInputNmVc vin)
{
VSOutputPixelLighting vout;
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, vin.Normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse.rgb = vin.Color.rgb;
vout.Diffuse.a = vin.Color.a * DiffuseColor.a;
return vout;
}
VSOutputPixelLighting VSBasicPixelLightingVcBn(VSInputNmVc vin)
{
VSOutputPixelLighting vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse.rgb = vin.Color.rgb;
vout.Diffuse.a = vin.Color.a * DiffuseColor.a;
return vout;
}
// Vertex shader: pixel lighting + texture.
VSOutputPixelLightingTx VSBasicPixelLightingTx(VSInputNmTx vin)
{
VSOutputPixelLightingTx vout;
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, vin.Normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse = float4(1, 1, 1, DiffuseColor.a);
vout.TexCoord = vin.TexCoord;
return vout;
}
VSOutputPixelLightingTx VSBasicPixelLightingTxBn(VSInputNmTx vin)
{
VSOutputPixelLightingTx vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse = float4(1, 1, 1, DiffuseColor.a);
vout.TexCoord = vin.TexCoord;
return vout;
}
// Vertex shader: pixel lighting + texture + vertex color.
VSOutputPixelLightingTx VSBasicPixelLightingTxVc(VSInputNmTxVc vin)
{
VSOutputPixelLightingTx vout;
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, vin.Normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse.rgb = vin.Color.rgb;
vout.Diffuse.a = vin.Color.a * DiffuseColor.a;
vout.TexCoord = vin.TexCoord;
return vout;
}
VSOutputPixelLightingTx VSBasicPixelLightingTxVcBn(VSInputNmTxVc vin)
{
VSOutputPixelLightingTx vout;
float3 normal = BiasX2(vin.Normal);
CommonVSOutputPixelLighting cout = ComputeCommonVSOutputPixelLighting(vin.Position, normal);
SetCommonVSOutputParamsPixelLighting;
vout.Diffuse.rgb = vin.Color.rgb;
vout.Diffuse.a = vin.Color.a * DiffuseColor.a;
vout.TexCoord = vin.TexCoord;
return vout;
}
// Pixel shader: basic.
float4 PSBasic(PSInput pin) : SV_Target0
{
float4 color = pin.Diffuse;
ApplyFog(color, pin.Specular.w);
return color;
}
// Pixel shader: no fog.
float4 PSBasicNoFog(PSInputNoFog pin) : SV_Target0
{
return pin.Diffuse;
}
// Pixel shader: texture.
float4 PSBasicTx(PSInputTx pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
ApplyFog(color, pin.Specular.w);
return color;
}
// Pixel shader: texture, no fog.
float4 PSBasicTxNoFog(PSInputTxNoFog pin) : SV_Target0
{
return Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
}
// Pixel shader: vertex lighting.
float4 PSBasicVertexLighting(PSInput pin) : SV_Target0
{
float4 color = pin.Diffuse;
AddSpecular(color, pin.Specular.rgb);
ApplyFog(color, pin.Specular.w);
return color;
}
// Pixel shader: vertex lighting, no fog.
float4 PSBasicVertexLightingNoFog(PSInput pin) : SV_Target0
{
float4 color = pin.Diffuse;
AddSpecular(color, pin.Specular.rgb);
return color;
}
// Pixel shader: vertex lighting + texture.
float4 PSBasicVertexLightingTx(PSInputTx pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
AddSpecular(color, pin.Specular.rgb);
ApplyFog(color, pin.Specular.w);
return color;
}
// Pixel shader: vertex lighting + texture, no fog.
float4 PSBasicVertexLightingTxNoFog(PSInputTx pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
AddSpecular(color, pin.Specular.rgb);
return color;
}
// Pixel shader: pixel lighting.
float4 PSBasicPixelLighting(PSInputPixelLighting pin) : SV_Target0
{
float4 color = pin.Diffuse;
float3 eyeVector = normalize(EyePosition - pin.PositionWS.xyz);
float3 worldNormal = normalize(pin.NormalWS);
ColorPair lightResult = ComputeLights(eyeVector, worldNormal, 3);
color.rgb *= lightResult.Diffuse;
AddSpecular(color, lightResult.Specular);
ApplyFog(color, pin.PositionWS.w);
return color;
}
// Pixel shader: pixel lighting + texture.
float4 PSBasicPixelLightingTx(PSInputPixelLightingTx pin) : SV_Target0
{
float4 color = Texture.Sample(Sampler, pin.TexCoord) * pin.Diffuse;
float3 eyeVector = normalize(EyePosition - pin.PositionWS.xyz);
float3 worldNormal = normalize(pin.NormalWS);
ColorPair lightResult = ComputeLights(eyeVector, worldNormal, 3);
color.rgb *= lightResult.Diffuse;
AddSpecular(color, lightResult.Specular);
ApplyFog(color, pin.PositionWS.w);
return color;
}

View File

@@ -0,0 +1,66 @@
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// http://go.microsoft.com/fwlink/?LinkId=248929
// http://create.msdn.com/en-US/education/catalog/sample/stock_effects
float ComputeFogFactor(float4 position)
{
return saturate(dot(position, FogVector));
}
void ApplyFog(inout float4 color, float fogFactor)
{
color.rgb = lerp(color.rgb, FogColor * color.a, fogFactor);
}
void AddSpecular(inout float4 color, float3 specular)
{
color.rgb += specular * color.a;
}
float3 BiasX2(float3 x)
{
return 2.0f * x - 1.0f;
}
struct CommonVSOutput
{
float4 Pos_ps;
float4 Diffuse;
float3 Specular;
float FogFactor;
};
CommonVSOutput ComputeCommonVSOutput(float4 position)
{
CommonVSOutput vout;
vout.Pos_ps = mul(position, WorldViewProj);
vout.Diffuse = DiffuseColor;
vout.Specular = 0;
vout.FogFactor = ComputeFogFactor(position);
return vout;
}
#define SetCommonVSOutputParams \
vout.PositionPS = cout.Pos_ps; \
vout.Diffuse = cout.Diffuse; \
vout.Specular = float4(cout.Specular, cout.FogFactor);
#define SetCommonVSOutputParamsNoFog \
vout.PositionPS = cout.Pos_ps; \
vout.Diffuse = cout.Diffuse;

View File

@@ -0,0 +1,267 @@
@echo off
rem THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
rem ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
rem THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
rem PARTICULAR PURPOSE.
rem
rem Copyright (c) Microsoft Corporation. All rights reserved.
setlocal
set error=0
if %1.==xbox. goto continuexbox
if %1.==. goto continue
echo usage: CompileShaders [xbox]
exit /b
:continuexbox
set XBOXOPTS=/D__XBOX_DISABLE_SHADER_NAME_EMPLACEMENT
if NOT %2.==noprecompile. goto skipnoprecompile
set XBOXOPTS=%XBOXOPTS% /D__XBOX_DISABLE_PRECOMPILE=1
:skipnoprecompile
set XBOXFXC="%XboxOneXDKLatest%\xdk\FXC\amd64\FXC.exe"
if exist %XBOXFXC% goto continue
set XBOXFXC="%XboxOneXDKLatest%xdk\FXC\amd64\FXC.exe"
if exist %XBOXFXC% goto continue
set XBOXFXC="%XboxOneXDKBuild%xdk\FXC\amd64\FXC.exe"
if exist %XBOXFXC% goto continue
set XBOXFXC="%DurangoXDK%xdk\FXC\amd64\FXC.exe"
if not exist %XBOXFXC% goto needxdk
:continue
call :CompileShader%1 AlphaTestEffect vs VSAlphaTest
call :CompileShader%1 AlphaTestEffect vs VSAlphaTestNoFog
call :CompileShader%1 AlphaTestEffect vs VSAlphaTestVc
call :CompileShader%1 AlphaTestEffect vs VSAlphaTestVcNoFog
call :CompileShader%1 AlphaTestEffect ps PSAlphaTestLtGt
call :CompileShader%1 AlphaTestEffect ps PSAlphaTestLtGtNoFog
call :CompileShader%1 AlphaTestEffect ps PSAlphaTestEqNe
call :CompileShader%1 AlphaTestEffect ps PSAlphaTestEqNeNoFog
call :CompileShader%1 BasicEffect vs VSBasic
call :CompileShader%1 BasicEffect vs VSBasicNoFog
call :CompileShader%1 BasicEffect vs VSBasicVc
call :CompileShader%1 BasicEffect vs VSBasicVcNoFog
call :CompileShader%1 BasicEffect vs VSBasicTx
call :CompileShader%1 BasicEffect vs VSBasicTxNoFog
call :CompileShader%1 BasicEffect vs VSBasicTxVc
call :CompileShader%1 BasicEffect vs VSBasicTxVcNoFog
call :CompileShader%1 BasicEffect vs VSBasicVertexLighting
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingBn
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingVc
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingVcBn
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingTx
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingTxBn
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingTxVc
call :CompileShader%1 BasicEffect vs VSBasicVertexLightingTxVcBn
call :CompileShader%1 BasicEffect vs VSBasicOneLight
call :CompileShader%1 BasicEffect vs VSBasicOneLightBn
call :CompileShader%1 BasicEffect vs VSBasicOneLightVc
call :CompileShader%1 BasicEffect vs VSBasicOneLightVcBn
call :CompileShader%1 BasicEffect vs VSBasicOneLightTx
call :CompileShader%1 BasicEffect vs VSBasicOneLightTxBn
call :CompileShader%1 BasicEffect vs VSBasicOneLightTxVc
call :CompileShader%1 BasicEffect vs VSBasicOneLightTxVcBn
call :CompileShader%1 BasicEffect vs VSBasicPixelLighting
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingBn
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingVc
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingVcBn
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingTx
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingTxBn
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingTxVc
call :CompileShader%1 BasicEffect vs VSBasicPixelLightingTxVcBn
call :CompileShader%1 BasicEffect ps PSBasic
call :CompileShader%1 BasicEffect ps PSBasicNoFog
call :CompileShader%1 BasicEffect ps PSBasicTx
call :CompileShader%1 BasicEffect ps PSBasicTxNoFog
call :CompileShader%1 BasicEffect ps PSBasicVertexLighting
call :CompileShader%1 BasicEffect ps PSBasicVertexLightingNoFog
call :CompileShader%1 BasicEffect ps PSBasicVertexLightingTx
call :CompileShader%1 BasicEffect ps PSBasicVertexLightingTxNoFog
call :CompileShader%1 BasicEffect ps PSBasicPixelLighting
call :CompileShader%1 BasicEffect ps PSBasicPixelLightingTx
call :CompileShader%1 DualTextureEffect vs VSDualTexture
call :CompileShader%1 DualTextureEffect vs VSDualTextureNoFog
call :CompileShader%1 DualTextureEffect vs VSDualTextureVc
call :CompileShader%1 DualTextureEffect vs VSDualTextureVcNoFog
call :CompileShader%1 DualTextureEffect ps PSDualTexture
call :CompileShader%1 DualTextureEffect ps PSDualTextureNoFog
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMap
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapBn
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapFresnel
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapFresnelBn
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapOneLight
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapOneLightBn
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapOneLightFresnel
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapOneLightFresnelBn
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapPixelLighting
call :CompileShader%1 EnvironmentMapEffect vs VSEnvMapPixelLightingBn
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMap
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapNoFog
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapSpecular
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapSpecularNoFog
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapPixelLighting
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapPixelLightingNoFog
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapPixelLightingFresnel
call :CompileShader%1 EnvironmentMapEffect ps PSEnvMapPixelLightingFresnelNoFog
call :CompileShader%1 SkinnedEffect vs VSSkinnedVertexLightingOneBone
call :CompileShader%1 SkinnedEffect vs VSSkinnedVertexLightingOneBoneBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedVertexLightingTwoBones
call :CompileShader%1 SkinnedEffect vs VSSkinnedVertexLightingTwoBonesBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedVertexLightingFourBones
call :CompileShader%1 SkinnedEffect vs VSSkinnedVertexLightingFourBonesBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedOneLightOneBone
call :CompileShader%1 SkinnedEffect vs VSSkinnedOneLightOneBoneBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedOneLightTwoBones
call :CompileShader%1 SkinnedEffect vs VSSkinnedOneLightTwoBonesBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedOneLightFourBones
call :CompileShader%1 SkinnedEffect vs VSSkinnedOneLightFourBonesBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedPixelLightingOneBone
call :CompileShader%1 SkinnedEffect vs VSSkinnedPixelLightingOneBoneBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedPixelLightingTwoBones
call :CompileShader%1 SkinnedEffect vs VSSkinnedPixelLightingTwoBonesBn
call :CompileShader%1 SkinnedEffect vs VSSkinnedPixelLightingFourBones
call :CompileShader%1 SkinnedEffect vs VSSkinnedPixelLightingFourBonesBn
call :CompileShader%1 SkinnedEffect ps PSSkinnedVertexLighting
call :CompileShader%1 SkinnedEffect ps PSSkinnedVertexLightingNoFog
call :CompileShader%1 SkinnedEffect ps PSSkinnedPixelLighting
call :CompileShader%1 NormalMapEffect vs VSNormalPixelLightingTx
call :CompileShader%1 NormalMapEffect vs VSNormalPixelLightingTxBn
call :CompileShader%1 NormalMapEffect vs VSNormalPixelLightingTxVc
call :CompileShader%1 NormalMapEffect vs VSNormalPixelLightingTxVcBn
call :CompileShader%1 NormalMapEffect ps PSNormalPixelLightingTx
call :CompileShader%1 NormalMapEffect ps PSNormalPixelLightingTxNoFog
call :CompileShader%1 NormalMapEffect ps PSNormalPixelLightingTxNoSpec
call :CompileShader%1 NormalMapEffect ps PSNormalPixelLightingTxNoFogSpec
call :CompileShader%1 SpriteEffect vs SpriteVertexShader
call :CompileShader%1 SpriteEffect ps SpritePixelShader
call :CompileShader%1 DGSLEffect vs main
call :CompileShader%1 DGSLEffect vs mainVc
call :CompileShader%1 DGSLEffect vs main1Bones
call :CompileShader%1 DGSLEffect vs main1BonesVc
call :CompileShader%1 DGSLEffect vs main2Bones
call :CompileShader%1 DGSLEffect vs main2BonesVc
call :CompileShader%1 DGSLEffect vs main4Bones
call :CompileShader%1 DGSLEffect vs main4BonesVc
call :CompileShaderHLSL%1 DGSLUnlit ps main
call :CompileShaderHLSL%1 DGSLLambert ps main
call :CompileShaderHLSL%1 DGSLPhong ps main
call :CompileShaderHLSL%1 DGSLUnlit ps mainTk
call :CompileShaderHLSL%1 DGSLLambert ps mainTk
call :CompileShaderHLSL%1 DGSLPhong ps mainTk
call :CompileShaderHLSL%1 DGSLUnlit ps mainTx
call :CompileShaderHLSL%1 DGSLLambert ps mainTx
call :CompileShaderHLSL%1 DGSLPhong ps mainTx
call :CompileShaderHLSL%1 DGSLUnlit ps mainTxTk
call :CompileShaderHLSL%1 DGSLLambert ps mainTxTk
call :CompileShaderHLSL%1 DGSLPhong ps mainTxTk
call :CompileShaderSM4%1 PostProcess vs VSQuad
call :CompileShaderSM4%1 PostProcess ps PSCopy
call :CompileShaderSM4%1 PostProcess ps PSMonochrome
call :CompileShaderSM4%1 PostProcess ps PSSepia
call :CompileShaderSM4%1 PostProcess ps PSDownScale2x2
call :CompileShaderSM4%1 PostProcess ps PSDownScale4x4
call :CompileShaderSM4%1 PostProcess ps PSGaussianBlur5x5
call :CompileShaderSM4%1 PostProcess ps PSBloomExtract
call :CompileShaderSM4%1 PostProcess ps PSBloomBlur
call :CompileShaderSM4%1 PostProcess ps PSMerge
call :CompileShaderSM4%1 PostProcess ps PSBloomCombine
call :CompileShaderSM4%1 ToneMap vs VSQuad
call :CompileShaderSM4%1 ToneMap ps PSCopy
call :CompileShaderSM4%1 ToneMap ps PSSaturate
call :CompileShaderSM4%1 ToneMap ps PSReinhard
call :CompileShaderSM4%1 ToneMap ps PSACESFilmic
call :CompileShaderSM4%1 ToneMap ps PS_SRGB
call :CompileShaderSM4%1 ToneMap ps PSSaturate_SRGB
call :CompileShaderSM4%1 ToneMap ps PSReinhard_SRGB
call :CompileShaderSM4%1 ToneMap ps PSACESFilmic_SRGB
call :CompileShaderSM4%1 ToneMap ps PSHDR10
if NOT %1.==xbox. goto skipxboxonly
call :CompileShaderSM4xbox ToneMap ps PSHDR10_Saturate
call :CompileShaderSM4xbox ToneMap ps PSHDR10_Reinhard
call :CompileShaderSM4xbox ToneMap ps PSHDR10_ACESFilmic
call :CompileShaderSM4xbox ToneMap ps PSHDR10_Saturate_SRGB
call :CompileShaderSM4xbox ToneMap ps PSHDR10_Reinhard_SRGB
call :CompileShaderSM4xbox ToneMap ps PSHDR10_ACESFilmic_SRGB
:skipxboxonly
echo.
if %error% == 0 (
echo Shaders compiled ok
) else (
echo There were shader compilation errors!
)
endlocal
exit /b
:CompileShader
set fxc=fxc /nologo %1.fx /T%2_4_0_level_9_1 /Zi /Zpc /Qstrip_reflect /Qstrip_debug /E%3 /FhCompiled\%1_%3.inc /FdCompiled\%1_%3.pdb /Vn%1_%3
echo.
echo %fxc%
%fxc% || set error=1
exit /b
:CompileShaderSM4
set fxc=fxc /nologo %1.fx /T%2_4_0 /Zi /Zpc /Qstrip_reflect /Qstrip_debug /E%3 /FhCompiled\%1_%3.inc /FdCompiled\%1_%3.pdb /Vn%1_%3
echo.
echo %fxc%
%fxc% || set error=1
exit /b
:CompileShaderHLSL
set fxc=fxc /nologo %1.hlsl /T%2_4_0_level_9_1 /Zi /Zpc /Qstrip_reflect /Qstrip_debug /E%3 /FhCompiled\%1_%3.inc /FdCompiled\%1_%3.pdb /Vn%1_%3
echo.
echo %fxc%
%fxc% || set error=1
exit /b
:CompileShaderxbox
:CompileShaderSM4xbox
set fxc=%XBOXFXC% /nologo %1.fx /T%2_5_0 /Zpc /Zi /Qstrip_reflect /Qstrip_debug %XBOXOPTS% /E%3 /FhCompiled\XboxOne%1_%3.inc /FdCompiled\XboxOne%1_%3.pdb /Vn%1_%3
echo.
echo %fxc%
%fxc% || set error=1
exit /b
:CompileShaderHLSLxbox
set fxc=%XBOXFXC% /nologo %1.hlsl /T%2_5_0 /Zpc /Zi /Qstrip_reflect /Qstrip_debug %XBOXOPTS% /E%3 /FhCompiled\XboxOne%1_%3.inc /FdCompiled\XboxOne%1_%3.pdb /Vn%1_%3
echo.
echo %fxc%
%fxc% || set error=1
exit /b
:needxdk
echo ERROR: CompileShaders xbox requires the Microsoft Xbox One XDK
echo (try re-running from the XDK Command Prompt)

View File

@@ -0,0 +1,350 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float w
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 1 2 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
dcl t2.xy // pin<8,9>
dcl_2d s0
#line 115 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
texld r0, t2, s0
mad r1.w, r0.w, t0.w, -c0.x
mul r0, r0, t0 // ::color<0,1,2,3>
abs r1.x, r1.w
add r1.x, r1.x, -c0.y
cmp r1, r1.x, c0.w, c0.z
texkill r1
#line 20 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r1.xyz, c1, r0.w, -r0
mad r0.xyz, t1.w, r1, r0 // ApplyFog::color<0,1,2>
mov oC0, r0 // ::PSAlphaTestEqNe<0,1,2,3>
// approximately 10 instruction slots used (1 texture, 9 arithmetic)
ps_4_0
dcl_constantbuffer CB0[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.w
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mad r1.x, r0.w, v0.w, -cb0[1].x
mul r0.xyzw, r0.xyzw, v0.xyzw
lt r1.x, |r1.x|, cb0[1].y
movc r1.x, r1.x, cb0[1].z, cb0[1].w
lt r1.x, r1.x, l(0.000000)
discard_nz r1.x
mad r1.xyz, cb0[2].xyzx, r0.wwww, -r0.xyzx
mad o0.xyz, v1.wwww, r1.xyzx, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_PSAlphaTestEqNe[] =
{
68, 88, 66, 67, 227, 144,
105, 35, 78, 36, 70, 238,
99, 102, 182, 28, 112, 61,
242, 103, 1, 0, 0, 0,
56, 6, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
220, 3, 0, 0, 156, 5,
0, 0, 4, 6, 0, 0,
65, 111, 110, 57, 164, 3,
0, 0, 164, 3, 0, 0,
0, 2, 255, 255, 112, 3,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
165, 0, 68, 66, 85, 71,
40, 0, 0, 0, 104, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 192, 0,
0, 0, 14, 0, 0, 0,
200, 0, 0, 0, 4, 0,
0, 0, 24, 2, 0, 0,
56, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
40, 0, 0, 0, 120, 0,
0, 0, 0, 0, 255, 255,
156, 2, 0, 0, 0, 0,
255, 255, 168, 2, 0, 0,
0, 0, 255, 255, 180, 2,
0, 0, 0, 0, 255, 255,
192, 2, 0, 0, 115, 0,
0, 0, 204, 2, 0, 0,
117, 0, 0, 0, 220, 2,
0, 0, 115, 0, 0, 0,
240, 2, 0, 0, 117, 0,
0, 0, 0, 3, 0, 0,
117, 0, 0, 0, 12, 3,
0, 0, 117, 0, 0, 0,
28, 3, 0, 0, 117, 0,
0, 0, 48, 3, 0, 0,
20, 0, 1, 0, 56, 3,
0, 0, 20, 0, 1, 0,
76, 3, 0, 0, 20, 0,
1, 0, 96, 3, 0, 0,
80, 83, 65, 108, 112, 104,
97, 84, 101, 115, 116, 69,
113, 78, 101, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 13, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 65, 112, 112, 108,
121, 70, 111, 103, 0, 99,
111, 108, 111, 114, 0, 171,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 12, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 6, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 112, 105,
110, 0, 68, 105, 102, 102,
117, 115, 101, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 84, 101, 120, 67, 111,
111, 114, 100, 0, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 160, 1,
0, 0, 116, 1, 0, 0,
168, 1, 0, 0, 116, 1,
0, 0, 177, 1, 0, 0,
188, 1, 0, 0, 5, 0,
0, 0, 1, 0, 10, 0,
1, 0, 3, 0, 204, 1,
0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 1, 0, 0, 0,
4, 0, 5, 0, 6, 0,
7, 0, 2, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 0, 0, 0, 0,
56, 1, 0, 0, 72, 1,
0, 0, 1, 0, 0, 0,
88, 1, 0, 0, 100, 1,
0, 0, 109, 1, 0, 0,
116, 1, 0, 0, 1, 0,
0, 0, 132, 1, 0, 0,
0, 0, 0, 0, 109, 1,
0, 0, 116, 1, 0, 0,
1, 0, 0, 0, 144, 1,
0, 0, 56, 1, 0, 0,
156, 1, 0, 0, 228, 1,
0, 0, 3, 0, 0, 0,
244, 1, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 1, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 2, 0,
3, 176, 31, 0, 0, 2,
0, 0, 0, 144, 0, 8,
15, 160, 66, 0, 0, 3,
0, 0, 15, 128, 2, 0,
228, 176, 0, 8, 228, 160,
4, 0, 0, 4, 1, 0,
8, 128, 0, 0, 255, 128,
0, 0, 255, 176, 0, 0,
0, 161, 5, 0, 0, 3,
0, 0, 15, 128, 0, 0,
228, 128, 0, 0, 228, 176,
35, 0, 0, 2, 1, 0,
1, 128, 1, 0, 255, 128,
2, 0, 0, 3, 1, 0,
1, 128, 1, 0, 0, 128,
0, 0, 85, 161, 88, 0,
0, 4, 1, 0, 15, 128,
1, 0, 0, 128, 0, 0,
255, 160, 0, 0, 170, 160,
65, 0, 0, 1, 1, 0,
15, 128, 4, 0, 0, 4,
1, 0, 7, 128, 1, 0,
228, 160, 0, 0, 255, 128,
0, 0, 228, 129, 4, 0,
0, 4, 0, 0, 7, 128,
1, 0, 255, 176, 1, 0,
228, 128, 0, 0, 228, 128,
1, 0, 0, 2, 0, 8,
15, 128, 0, 0, 228, 128,
255, 255, 0, 0, 83, 72,
68, 82, 184, 1, 0, 0,
64, 0, 0, 0, 110, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 3, 0, 0, 0,
90, 0, 0, 3, 0, 96,
16, 0, 0, 0, 0, 0,
88, 24, 0, 4, 0, 112,
16, 0, 0, 0, 0, 0,
85, 85, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 98, 16,
0, 3, 130, 16, 16, 0,
1, 0, 0, 0, 98, 16,
0, 3, 50, 16, 16, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 104, 0,
0, 2, 2, 0, 0, 0,
69, 0, 0, 9, 242, 0,
16, 0, 0, 0, 0, 0,
70, 16, 16, 0, 2, 0,
0, 0, 70, 126, 16, 0,
0, 0, 0, 0, 0, 96,
16, 0, 0, 0, 0, 0,
50, 0, 0, 11, 18, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 58, 16, 16, 0,
0, 0, 0, 0, 10, 128,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 56, 0, 0, 7,
242, 0, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
49, 0, 0, 9, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 128, 129, 0,
0, 0, 1, 0, 0, 0,
26, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
55, 0, 0, 11, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 42, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 49, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
13, 0, 4, 3, 10, 0,
16, 0, 1, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 2, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 128,
65, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 9,
114, 32, 16, 0, 0, 0,
0, 0, 246, 31, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 54, 0, 0, 5,
130, 32, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
96, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
80, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 8, 0, 0,
86, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 3, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,286 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 1 1 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1.xy // pin<4,5>
dcl_2d s0
#line 128 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
texld r0, t1, s0
mad r1.w, r0.w, t0.w, -c0.x
mul r0, r0, t0 // ::color<0,1,2,3>
mov oC0, r0 // ::PSAlphaTestEqNeNoFog<0,1,2,3>
abs r0.x, r1.w
add r0.x, r0.x, -c0.y
cmp r0, r0.x, c0.w, c0.z
texkill r0
// approximately 8 instruction slots used (1 texture, 7 arithmetic)
ps_4_0
dcl_constantbuffer CB0[2], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mad r1.x, r0.w, v0.w, -cb0[1].x
mul r0.xyzw, r0.xyzw, v0.xyzw
mov o0.xyzw, r0.xyzw
lt r0.x, |r1.x|, cb0[1].y
movc r0.x, r0.x, cb0[1].z, cb0[1].w
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_PSAlphaTestEqNeNoFog[] =
{
68, 88, 66, 67, 68, 196,
239, 137, 188, 228, 35, 233,
220, 12, 98, 97, 32, 106,
149, 255, 1, 0, 0, 0,
240, 4, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
8, 3, 0, 0, 108, 4,
0, 0, 188, 4, 0, 0,
65, 111, 110, 57, 208, 2,
0, 0, 208, 2, 0, 0,
0, 2, 255, 255, 156, 2,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
125, 0, 68, 66, 85, 71,
40, 0, 0, 0, 200, 1,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 120, 0,
0, 0, 11, 0, 0, 0,
124, 0, 0, 0, 3, 0,
0, 0, 140, 1, 0, 0,
212, 0, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
40, 0, 0, 0, 0, 0,
255, 255, 252, 1, 0, 0,
0, 0, 255, 255, 8, 2,
0, 0, 0, 0, 255, 255,
20, 2, 0, 0, 128, 0,
0, 0, 32, 2, 0, 0,
130, 0, 0, 0, 48, 2,
0, 0, 128, 0, 0, 0,
68, 2, 0, 0, 128, 0,
0, 0, 84, 2, 0, 0,
130, 0, 0, 0, 96, 2,
0, 0, 130, 0, 0, 0,
108, 2, 0, 0, 130, 0,
0, 0, 124, 2, 0, 0,
130, 0, 0, 0, 144, 2,
0, 0, 80, 83, 65, 108,
112, 104, 97, 84, 101, 115,
116, 69, 113, 78, 101, 78,
111, 70, 111, 103, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
99, 111, 108, 111, 114, 0,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
112, 105, 110, 0, 68, 105,
102, 102, 117, 115, 101, 0,
84, 101, 120, 67, 111, 111,
114, 100, 0, 171, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 48, 1,
0, 0, 16, 1, 0, 0,
56, 1, 0, 0, 68, 1,
0, 0, 5, 0, 0, 0,
1, 0, 6, 0, 1, 0,
2, 0, 84, 1, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
1, 0, 0, 0, 4, 0,
5, 0, 255, 255, 255, 255,
0, 0, 0, 0, 212, 0,
0, 0, 236, 0, 0, 0,
1, 0, 0, 0, 252, 0,
0, 0, 0, 0, 0, 0,
8, 1, 0, 0, 16, 1,
0, 0, 1, 0, 0, 0,
32, 1, 0, 0, 212, 0,
0, 0, 44, 1, 0, 0,
100, 1, 0, 0, 2, 0,
0, 0, 116, 1, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 31, 0,
0, 2, 0, 0, 0, 128,
0, 0, 15, 176, 31, 0,
0, 2, 0, 0, 0, 128,
1, 0, 3, 176, 31, 0,
0, 2, 0, 0, 0, 144,
0, 8, 15, 160, 66, 0,
0, 3, 0, 0, 15, 128,
1, 0, 228, 176, 0, 8,
228, 160, 4, 0, 0, 4,
1, 0, 8, 128, 0, 0,
255, 128, 0, 0, 255, 176,
0, 0, 0, 161, 5, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 0, 0,
228, 176, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 128, 35, 0, 0, 2,
0, 0, 1, 128, 1, 0,
255, 128, 2, 0, 0, 3,
0, 0, 1, 128, 0, 0,
0, 128, 0, 0, 85, 161,
88, 0, 0, 4, 0, 0,
15, 128, 0, 0, 0, 128,
0, 0, 255, 160, 0, 0,
170, 160, 65, 0, 0, 1,
0, 0, 15, 128, 255, 255,
0, 0, 83, 72, 68, 82,
92, 1, 0, 0, 64, 0,
0, 0, 87, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 90, 0,
0, 3, 0, 96, 16, 0,
0, 0, 0, 0, 88, 24,
0, 4, 0, 112, 16, 0,
0, 0, 0, 0, 85, 85,
0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 98, 16, 0, 3,
50, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 104, 0, 0, 2,
2, 0, 0, 0, 69, 0,
0, 9, 242, 0, 16, 0,
0, 0, 0, 0, 70, 16,
16, 0, 1, 0, 0, 0,
70, 126, 16, 0, 0, 0,
0, 0, 0, 96, 16, 0,
0, 0, 0, 0, 50, 0,
0, 11, 18, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
58, 16, 16, 0, 0, 0,
0, 0, 10, 128, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
56, 0, 0, 7, 242, 0,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0,
49, 0, 0, 9, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 128, 129, 0,
0, 0, 1, 0, 0, 0,
26, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
55, 0, 0, 11, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 42, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 49, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
13, 0, 4, 3, 10, 0,
16, 0, 0, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 72, 0, 0, 0,
2, 0, 0, 0, 8, 0,
0, 0, 56, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 62, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 3, 3,
0, 0, 67, 79, 76, 79,
82, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 171,
79, 83, 71, 78, 44, 0,
0, 0, 1, 0, 0, 0,
8, 0, 0, 0, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 83, 86,
95, 84, 97, 114, 103, 101,
116, 0, 171, 171
};

View File

@@ -0,0 +1,331 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float w
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 1 2 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
dcl t2.xy // pin<8,9>
dcl_2d s0
#line 91 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
texld r0, t2, s0
mad r1.w, r0.w, t0.w, -c0.x
mul r0, r0, t0 // ::color<0,1,2,3>
cmp r1, r1.w, c0.w, c0.z
texkill r1
#line 20 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r1.xyz, c1, r0.w, -r0
mad r0.xyz, t1.w, r1, r0 // ApplyFog::color<0,1,2>
mov oC0, r0 // ::PSAlphaTestLtGt<0,1,2,3>
// approximately 8 instruction slots used (1 texture, 7 arithmetic)
ps_4_0
dcl_constantbuffer CB0[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.w
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, v0.xyzw
lt r1.x, r0.w, cb0[1].x
movc r1.x, r1.x, cb0[1].z, cb0[1].w
lt r1.x, r1.x, l(0.000000)
discard_nz r1.x
mad r1.xyz, cb0[2].xyzx, r0.wwww, -r0.xyzx
mad o0.xyz, v1.wwww, r1.xyzx, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_PSAlphaTestLtGt[] =
{
68, 88, 66, 67, 3, 69,
176, 46, 18, 126, 71, 88,
168, 156, 30, 41, 255, 175,
92, 82, 1, 0, 0, 0,
220, 5, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
176, 3, 0, 0, 64, 5,
0, 0, 168, 5, 0, 0,
65, 111, 110, 57, 120, 3,
0, 0, 120, 3, 0, 0,
0, 2, 255, 255, 68, 3,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
161, 0, 68, 66, 85, 71,
40, 0, 0, 0, 88, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 192, 0,
0, 0, 12, 0, 0, 0,
200, 0, 0, 0, 4, 0,
0, 0, 8, 2, 0, 0,
40, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
40, 0, 0, 0, 120, 0,
0, 0, 0, 0, 255, 255,
140, 2, 0, 0, 0, 0,
255, 255, 152, 2, 0, 0,
0, 0, 255, 255, 164, 2,
0, 0, 0, 0, 255, 255,
176, 2, 0, 0, 91, 0,
0, 0, 188, 2, 0, 0,
93, 0, 0, 0, 204, 2,
0, 0, 91, 0, 0, 0,
224, 2, 0, 0, 93, 0,
0, 0, 240, 2, 0, 0,
93, 0, 0, 0, 4, 3,
0, 0, 20, 0, 1, 0,
12, 3, 0, 0, 20, 0,
1, 0, 32, 3, 0, 0,
20, 0, 1, 0, 52, 3,
0, 0, 80, 83, 65, 108,
112, 104, 97, 84, 101, 115,
116, 76, 116, 71, 116, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 65, 112,
112, 108, 121, 70, 111, 103,
0, 99, 111, 108, 111, 114,
0, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
10, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
6, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
112, 105, 110, 0, 68, 105,
102, 102, 117, 115, 101, 0,
83, 112, 101, 99, 117, 108,
97, 114, 0, 84, 101, 120,
67, 111, 111, 114, 100, 0,
171, 171, 1, 0, 3, 0,
1, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0,
144, 1, 0, 0, 100, 1,
0, 0, 152, 1, 0, 0,
100, 1, 0, 0, 161, 1,
0, 0, 172, 1, 0, 0,
5, 0, 0, 0, 1, 0,
10, 0, 1, 0, 3, 0,
188, 1, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 1, 0,
0, 0, 4, 0, 5, 0,
6, 0, 7, 0, 2, 0,
0, 0, 8, 0, 9, 0,
255, 255, 255, 255, 0, 0,
0, 0, 40, 1, 0, 0,
56, 1, 0, 0, 1, 0,
0, 0, 72, 1, 0, 0,
84, 1, 0, 0, 93, 1,
0, 0, 100, 1, 0, 0,
1, 0, 0, 0, 116, 1,
0, 0, 0, 0, 0, 0,
93, 1, 0, 0, 100, 1,
0, 0, 1, 0, 0, 0,
128, 1, 0, 0, 40, 1,
0, 0, 140, 1, 0, 0,
212, 1, 0, 0, 3, 0,
0, 0, 228, 1, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 31, 0,
0, 2, 0, 0, 0, 128,
0, 0, 15, 176, 31, 0,
0, 2, 0, 0, 0, 128,
1, 0, 15, 176, 31, 0,
0, 2, 0, 0, 0, 128,
2, 0, 3, 176, 31, 0,
0, 2, 0, 0, 0, 144,
0, 8, 15, 160, 66, 0,
0, 3, 0, 0, 15, 128,
2, 0, 228, 176, 0, 8,
228, 160, 4, 0, 0, 4,
1, 0, 8, 128, 0, 0,
255, 128, 0, 0, 255, 176,
0, 0, 0, 161, 5, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 0, 0,
228, 176, 88, 0, 0, 4,
1, 0, 15, 128, 1, 0,
255, 128, 0, 0, 255, 160,
0, 0, 170, 160, 65, 0,
0, 1, 1, 0, 15, 128,
4, 0, 0, 4, 1, 0,
7, 128, 1, 0, 228, 160,
0, 0, 255, 128, 0, 0,
228, 129, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
255, 176, 1, 0, 228, 128,
0, 0, 228, 128, 1, 0,
0, 2, 0, 8, 15, 128,
0, 0, 228, 128, 255, 255,
0, 0, 83, 72, 68, 82,
136, 1, 0, 0, 64, 0,
0, 0, 98, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
3, 0, 0, 0, 90, 0,
0, 3, 0, 96, 16, 0,
0, 0, 0, 0, 88, 24,
0, 4, 0, 112, 16, 0,
0, 0, 0, 0, 85, 85,
0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 98, 16, 0, 3,
130, 16, 16, 0, 1, 0,
0, 0, 98, 16, 0, 3,
50, 16, 16, 0, 2, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 104, 0, 0, 2,
2, 0, 0, 0, 69, 0,
0, 9, 242, 0, 16, 0,
0, 0, 0, 0, 70, 16,
16, 0, 2, 0, 0, 0,
70, 126, 16, 0, 0, 0,
0, 0, 0, 96, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 242, 0, 16, 0,
0, 0, 0, 0, 70, 14,
16, 0, 0, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 49, 0, 0, 8,
18, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 10, 128,
32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 55, 0,
0, 11, 18, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
42, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
49, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 13, 0,
4, 3, 10, 0, 16, 0,
1, 0, 0, 0, 50, 0,
0, 11, 114, 0, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0,
70, 2, 16, 128, 65, 0,
0, 0, 0, 0, 0, 0,
50, 0, 0, 9, 114, 32,
16, 0, 0, 0, 0, 0,
246, 31, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 130, 32,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 96, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 80, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
15, 8, 0, 0, 86, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
3, 3, 0, 0, 67, 79,
76, 79, 82, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 171, 79, 83, 71, 78,
44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 84, 97, 114,
103, 101, 116, 0, 171, 171
};

View File

@@ -0,0 +1,268 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 1 1 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1.xy // pin<4,5>
dcl_2d s0
#line 104 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
texld r0, t1, s0
mad r1.w, r0.w, t0.w, -c0.x
mul r0, r0, t0 // ::color<0,1,2,3>
mov oC0, r0 // ::PSAlphaTestLtGtNoFog<0,1,2,3>
cmp r0, r1.w, c0.w, c0.z
texkill r0
// approximately 6 instruction slots used (1 texture, 5 arithmetic)
ps_4_0
dcl_constantbuffer CB0[2], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, v0.xyzw
lt r1.x, r0.w, cb0[1].x
mov o0.xyzw, r0.xyzw
movc r0.x, r1.x, cb0[1].z, cb0[1].w
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_PSAlphaTestLtGtNoFog[] =
{
68, 88, 66, 67, 125, 5,
186, 50, 61, 255, 179, 75,
244, 88, 246, 174, 40, 196,
165, 195, 1, 0, 0, 0,
148, 4, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
220, 2, 0, 0, 16, 4,
0, 0, 96, 4, 0, 0,
65, 111, 110, 57, 164, 2,
0, 0, 164, 2, 0, 0,
0, 2, 255, 255, 112, 2,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
121, 0, 68, 66, 85, 71,
40, 0, 0, 0, 184, 1,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 120, 0,
0, 0, 9, 0, 0, 0,
124, 0, 0, 0, 3, 0,
0, 0, 124, 1, 0, 0,
196, 0, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
40, 0, 0, 0, 0, 0,
255, 255, 236, 1, 0, 0,
0, 0, 255, 255, 248, 1,
0, 0, 0, 0, 255, 255,
4, 2, 0, 0, 104, 0,
0, 0, 16, 2, 0, 0,
106, 0, 0, 0, 32, 2,
0, 0, 104, 0, 0, 0,
52, 2, 0, 0, 104, 0,
0, 0, 68, 2, 0, 0,
106, 0, 0, 0, 80, 2,
0, 0, 106, 0, 0, 0,
100, 2, 0, 0, 80, 83,
65, 108, 112, 104, 97, 84,
101, 115, 116, 76, 116, 71,
116, 78, 111, 70, 111, 103,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 6, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 99, 111, 108, 111,
114, 0, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 5, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 112, 105, 110, 0,
68, 105, 102, 102, 117, 115,
101, 0, 84, 101, 120, 67,
111, 111, 114, 100, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0,
32, 1, 0, 0, 0, 1,
0, 0, 40, 1, 0, 0,
52, 1, 0, 0, 5, 0,
0, 0, 1, 0, 6, 0,
1, 0, 2, 0, 68, 1,
0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 1, 0, 0, 0,
4, 0, 5, 0, 255, 255,
255, 255, 0, 0, 0, 0,
196, 0, 0, 0, 220, 0,
0, 0, 1, 0, 0, 0,
236, 0, 0, 0, 0, 0,
0, 0, 248, 0, 0, 0,
0, 1, 0, 0, 1, 0,
0, 0, 16, 1, 0, 0,
196, 0, 0, 0, 28, 1,
0, 0, 84, 1, 0, 0,
2, 0, 0, 0, 100, 1,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 15, 176,
31, 0, 0, 2, 0, 0,
0, 128, 1, 0, 3, 176,
31, 0, 0, 2, 0, 0,
0, 144, 0, 8, 15, 160,
66, 0, 0, 3, 0, 0,
15, 128, 1, 0, 228, 176,
0, 8, 228, 160, 4, 0,
0, 4, 1, 0, 8, 128,
0, 0, 255, 128, 0, 0,
255, 176, 0, 0, 0, 161,
5, 0, 0, 3, 0, 0,
15, 128, 0, 0, 228, 128,
0, 0, 228, 176, 1, 0,
0, 2, 0, 8, 15, 128,
0, 0, 228, 128, 88, 0,
0, 4, 0, 0, 15, 128,
1, 0, 255, 128, 0, 0,
255, 160, 0, 0, 170, 160,
65, 0, 0, 1, 0, 0,
15, 128, 255, 255, 0, 0,
83, 72, 68, 82, 44, 1,
0, 0, 64, 0, 0, 0,
75, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 90, 0, 0, 3,
0, 96, 16, 0, 0, 0,
0, 0, 88, 24, 0, 4,
0, 112, 16, 0, 0, 0,
0, 0, 85, 85, 0, 0,
98, 16, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
98, 16, 0, 3, 50, 16,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
104, 0, 0, 2, 2, 0,
0, 0, 69, 0, 0, 9,
242, 0, 16, 0, 0, 0,
0, 0, 70, 16, 16, 0,
1, 0, 0, 0, 70, 126,
16, 0, 0, 0, 0, 0,
0, 96, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
242, 0, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
49, 0, 0, 8, 18, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 10, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 55, 0,
0, 11, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
42, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
49, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 13, 0,
4, 3, 10, 0, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
72, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
62, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 3, 3, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,391 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 3 5 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c7, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 oPos.z, v0, c5 // ::VSAlphaTest<12>
#line 14
dp4 r0.x, v0, c2
max r0.x, r0.x, c7.x
min oT1.w, r0.x, c7.y // ::VSAlphaTest<7>
#line 49
dp4 r0.x, v0, c3 // ::vout<0>
dp4 r0.y, v0, c4 // ::vout<1>
dp4 r0.z, v0, c6 // ::vout<3>
#line 31 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSAlphaTest<10,11>
mov oPos.w, r0.z // ::VSAlphaTest<13>
#line 50 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov oT0, c1 // ::VSAlphaTest<0,1,2,3>
mov oT1.xyz, c7.x // ::VSAlphaTest<4,5,6>
#line 38 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mov oT2.xy, v1 // ::VSAlphaTest<8,9>
// approximately 12 instruction slots used
vs_4_0
dcl_constantbuffer CB0[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output_siv o3.xyzw, position
mov o0.xyzw, cb0[0].xyzw
dp4_sat o1.w, v0.xyzw, cb0[3].xyzw
mov o1.xyz, l(0,0,0,0)
mov o2.xy, v1.xyxx
dp4 o3.x, v0.xyzw, cb0[4].xyzw
dp4 o3.y, v0.xyzw, cb0[5].xyzw
dp4 o3.z, v0.xyzw, cb0[6].xyzw
dp4 o3.w, v0.xyzw, cb0[7].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_VSAlphaTest[] =
{
68, 88, 66, 67, 149, 237,
230, 158, 255, 251, 158, 37,
226, 181, 230, 53, 161, 36,
45, 210, 1, 0, 0, 0,
252, 6, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
188, 4, 0, 0, 24, 6,
0, 0, 112, 6, 0, 0,
65, 111, 110, 57, 132, 4,
0, 0, 132, 4, 0, 0,
0, 2, 254, 255, 68, 4,
0, 0, 64, 0, 0, 0,
2, 0, 36, 0, 0, 0,
60, 0, 0, 0, 60, 0,
0, 0, 36, 0, 1, 0,
60, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
5, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
213, 0, 68, 66, 85, 71,
40, 0, 0, 0, 40, 3,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 192, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 3, 0,
0, 0, 236, 2, 0, 0,
64, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
40, 0, 0, 0, 112, 0,
0, 0, 0, 0, 255, 255,
92, 3, 0, 0, 0, 0,
255, 255, 116, 3, 0, 0,
0, 0, 255, 255, 128, 3,
0, 0, 49, 0, 0, 0,
140, 3, 0, 0, 14, 0,
0, 0, 156, 3, 0, 0,
14, 0, 0, 0, 172, 3,
0, 0, 14, 0, 0, 0,
188, 3, 0, 0, 49, 0,
0, 0, 204, 3, 0, 0,
49, 0, 0, 0, 220, 3,
0, 0, 49, 0, 0, 0,
236, 3, 0, 0, 31, 0,
1, 0, 252, 3, 0, 0,
31, 0, 1, 0, 16, 4,
0, 0, 50, 0, 0, 0,
28, 4, 0, 0, 51, 0,
0, 0, 40, 4, 0, 0,
38, 0, 1, 0, 52, 4,
0, 0, 86, 83, 65, 108,
112, 104, 97, 84, 101, 115,
116, 0, 68, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 84,
101, 120, 67, 111, 111, 114,
100, 0, 171, 171, 1, 0,
3, 0, 1, 0, 2, 0,
1, 0, 0, 0, 0, 0,
0, 0, 80, 111, 115, 105,
116, 105, 111, 110, 80, 83,
0, 171, 76, 1, 0, 0,
84, 1, 0, 0, 100, 1,
0, 0, 84, 1, 0, 0,
109, 1, 0, 0, 120, 1,
0, 0, 136, 1, 0, 0,
84, 1, 0, 0, 5, 0,
0, 0, 1, 0, 14, 0,
1, 0, 4, 0, 148, 1,
0, 0, 3, 0, 0, 0,
255, 255, 255, 255, 12, 0,
255, 255, 6, 0, 0, 0,
255, 255, 255, 255, 255, 255,
7, 0, 10, 0, 0, 0,
10, 0, 11, 0, 255, 255,
255, 255, 11, 0, 0, 0,
255, 255, 255, 255, 255, 255,
13, 0, 12, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 13, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 14, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171, 171, 171,
28, 2, 0, 0, 84, 1,
0, 0, 109, 1, 0, 0,
120, 1, 0, 0, 5, 0,
0, 0, 1, 0, 6, 0,
1, 0, 2, 0, 40, 2,
0, 0, 1, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 2, 0, 0, 0,
4, 0, 5, 0, 255, 255,
255, 255, 118, 111, 117, 116,
0, 80, 111, 115, 95, 112,
115, 0, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 101, 2,
0, 0, 84, 1, 0, 0,
76, 1, 0, 0, 84, 1,
0, 0, 100, 1, 0, 0,
108, 2, 0, 0, 124, 2,
0, 0, 136, 2, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
152, 2, 0, 0, 7, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 8, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 9, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 0, 0,
0, 0, 64, 1, 0, 0,
180, 1, 0, 0, 7, 0,
0, 0, 196, 1, 0, 0,
64, 1, 0, 0, 24, 2,
0, 0, 56, 2, 0, 0,
2, 0, 0, 0, 72, 2,
0, 0, 0, 0, 0, 0,
96, 2, 0, 0, 184, 2,
0, 0, 3, 0, 0, 0,
200, 2, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
7, 0, 15, 160, 0, 0,
0, 0, 0, 0, 128, 63,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 9, 0, 0, 3,
0, 0, 4, 192, 0, 0,
228, 144, 5, 0, 228, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
2, 0, 228, 160, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 7, 0,
0, 160, 10, 0, 0, 3,
1, 0, 8, 224, 0, 0,
0, 128, 7, 0, 85, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 4, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 6, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 1, 0, 0, 2,
0, 0, 15, 224, 1, 0,
228, 160, 1, 0, 0, 2,
1, 0, 7, 224, 7, 0,
0, 160, 1, 0, 0, 2,
2, 0, 3, 224, 1, 0,
228, 144, 255, 255, 0, 0,
83, 72, 68, 82, 84, 1,
0, 0, 64, 0, 1, 0,
85, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 8, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 95, 0, 0, 3,
50, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
50, 32, 16, 0, 2, 0,
0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 3, 0,
0, 0, 1, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
17, 32, 0, 8, 130, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 3, 0,
0, 0, 54, 0, 0, 8,
114, 32, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 54, 0,
0, 5, 50, 32, 16, 0,
2, 0, 0, 0, 70, 16,
16, 0, 1, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 4, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
5, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 6, 0, 0, 0,
17, 0, 0, 8, 130, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 7, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 80, 0,
0, 0, 2, 0, 0, 0,
8, 0, 0, 0, 56, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 68, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
3, 3, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 171, 171, 171, 79, 83,
71, 78, 132, 0, 0, 0,
4, 0, 0, 0, 8, 0,
0, 0, 104, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 104, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 0,
0, 0, 110, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 3, 12,
0, 0, 119, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 3, 0, 0, 0,
3, 0, 0, 0, 15, 0,
0, 0, 67, 79, 76, 79,
82, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 83,
86, 95, 80, 111, 115, 105,
116, 105, 111, 110, 0, 171
};

View File

@@ -0,0 +1,338 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 4 4 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 oPos.z, v0, c4 // ::VSAlphaTestNoFog<8>
dp4 r0.x, v0, c2 // ::vout<0>
dp4 r0.y, v0, c3 // ::vout<1>
dp4 r0.z, v0, c5 // ::vout<3>
#line 45 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSAlphaTestNoFog<6,7>
mov oPos.w, r0.z // ::VSAlphaTestNoFog<9>
#line 50 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov oT0, c1 // ::VSAlphaTestNoFog<0,1,2,3>
#line 52 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mov oT1.xy, v1 // ::VSAlphaTestNoFog<4,5>
// approximately 8 instruction slots used
vs_4_0
dcl_constantbuffer CB0[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_output o0.xyzw
dcl_output o1.xy
dcl_output_siv o2.xyzw, position
mov o0.xyzw, cb0[0].xyzw
mov o1.xy, v1.xyxx
dp4 o2.x, v0.xyzw, cb0[4].xyzw
dp4 o2.y, v0.xyzw, cb0[5].xyzw
dp4 o2.z, v0.xyzw, cb0[6].xyzw
dp4 o2.w, v0.xyzw, cb0[7].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_VSAlphaTestNoFog[] =
{
68, 88, 66, 67, 186, 231,
94, 126, 212, 151, 1, 66,
13, 251, 222, 21, 253, 183,
92, 106, 1, 0, 0, 0,
8, 6, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
44, 4, 0, 0, 60, 5,
0, 0, 148, 5, 0, 0,
65, 111, 110, 57, 244, 3,
0, 0, 244, 3, 0, 0,
0, 2, 254, 255, 180, 3,
0, 0, 64, 0, 0, 0,
2, 0, 36, 0, 0, 0,
60, 0, 0, 0, 60, 0,
0, 0, 36, 0, 1, 0,
60, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 4, 0,
4, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
198, 0, 68, 66, 85, 71,
40, 0, 0, 0, 236, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 192, 0,
0, 0, 10, 0, 0, 0,
200, 0, 0, 0, 3, 0,
0, 0, 176, 2, 0, 0,
24, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
40, 0, 0, 0, 112, 0,
0, 0, 0, 0, 255, 255,
32, 3, 0, 0, 0, 0,
255, 255, 44, 3, 0, 0,
49, 0, 0, 0, 56, 3,
0, 0, 49, 0, 0, 0,
72, 3, 0, 0, 49, 0,
0, 0, 88, 3, 0, 0,
49, 0, 0, 0, 104, 3,
0, 0, 45, 0, 1, 0,
120, 3, 0, 0, 45, 0,
1, 0, 140, 3, 0, 0,
50, 0, 0, 0, 152, 3,
0, 0, 52, 0, 1, 0,
164, 3, 0, 0, 86, 83,
65, 108, 112, 104, 97, 84,
101, 115, 116, 78, 111, 70,
111, 103, 0, 68, 105, 102,
102, 117, 115, 101, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
84, 101, 120, 67, 111, 111,
114, 100, 0, 171, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 80, 111,
115, 105, 116, 105, 111, 110,
80, 83, 0, 171, 41, 1,
0, 0, 52, 1, 0, 0,
68, 1, 0, 0, 80, 1,
0, 0, 96, 1, 0, 0,
52, 1, 0, 0, 5, 0,
0, 0, 1, 0, 10, 0,
1, 0, 3, 0, 108, 1,
0, 0, 2, 0, 0, 0,
255, 255, 255, 255, 8, 0,
255, 255, 6, 0, 0, 0,
6, 0, 7, 0, 255, 255,
255, 255, 7, 0, 0, 0,
255, 255, 255, 255, 255, 255,
9, 0, 8, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 9, 0, 0, 0,
4, 0, 5, 0, 255, 255,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171, 171, 171,
212, 1, 0, 0, 52, 1,
0, 0, 68, 1, 0, 0,
80, 1, 0, 0, 5, 0,
0, 0, 1, 0, 6, 0,
1, 0, 2, 0, 224, 1,
0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 1, 0, 0, 0,
4, 0, 5, 0, 255, 255,
255, 255, 118, 111, 117, 116,
0, 80, 111, 115, 95, 112,
115, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 29, 2,
0, 0, 52, 1, 0, 0,
41, 1, 0, 0, 52, 1,
0, 0, 36, 2, 0, 0,
48, 2, 0, 0, 64, 2,
0, 0, 76, 2, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
92, 2, 0, 0, 3, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 4, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 5, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 0, 0,
0, 0, 24, 1, 0, 0,
132, 1, 0, 0, 5, 0,
0, 0, 148, 1, 0, 0,
24, 1, 0, 0, 208, 1,
0, 0, 240, 1, 0, 0,
2, 0, 0, 0, 0, 2,
0, 0, 0, 0, 0, 0,
24, 2, 0, 0, 124, 2,
0, 0, 3, 0, 0, 0,
140, 2, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 9, 0, 0, 3,
0, 0, 4, 192, 0, 0,
228, 144, 4, 0, 228, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
2, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 3, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 5, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 1, 0, 0, 2,
0, 0, 15, 224, 1, 0,
228, 160, 1, 0, 0, 2,
1, 0, 3, 224, 1, 0,
228, 144, 255, 255, 0, 0,
83, 72, 68, 82, 8, 1,
0, 0, 64, 0, 1, 0,
66, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 8, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 95, 0, 0, 3,
50, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
50, 32, 16, 0, 1, 0,
0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 2, 0,
0, 0, 1, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 5, 50, 32,
16, 0, 1, 0, 0, 0,
70, 16, 16, 0, 1, 0,
0, 0, 17, 0, 0, 8,
18, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
4, 0, 0, 0, 17, 0,
0, 8, 34, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 5, 0, 0, 0,
17, 0, 0, 8, 66, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 6, 0,
0, 0, 17, 0, 0, 8,
130, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
7, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
80, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
68, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 3, 3, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 171, 171,
79, 83, 71, 78, 108, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 86, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
3, 12, 0, 0, 95, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 67, 79,
76, 79, 82, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 83, 86, 95, 80, 111,
115, 105, 116, 105, 111, 110,
0, 171
};

View File

@@ -0,0 +1,413 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// COLOR 0 xyzw 2 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 3 5 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c7, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5>
dcl_texcoord2 v2 // vin<6,7,8,9>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 oPos.z, v0, c5 // ::VSAlphaTestVc<12>
#line 14
dp4 r0.x, v0, c2
max r0.x, r0.x, c7.x
min oT1.w, r0.x, c7.y // ::VSAlphaTestVc<7>
#line 67 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mul oT0, v2, c1 // ::VSAlphaTestVc<0,1,2,3>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c3 // ::vout<0>
dp4 r0.y, v0, c4 // ::vout<1>
dp4 r0.z, v0, c6 // ::vout<3>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSAlphaTestVc<10,11>
mov oPos.w, r0.z // ::VSAlphaTestVc<13>
#line 51 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov oT1.xyz, c7.x // ::VSAlphaTestVc<4,5,6>
#line 66 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mov oT2.xy, v1 // ::VSAlphaTestVc<8,9>
// approximately 12 instruction slots used
vs_4_0
dcl_constantbuffer CB0[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output_siv o3.xyzw, position
mul o0.xyzw, v2.xyzw, cb0[0].xyzw
dp4_sat o1.w, v0.xyzw, cb0[3].xyzw
mov o1.xyz, l(0,0,0,0)
mov o2.xy, v1.xyxx
dp4 o3.x, v0.xyzw, cb0[4].xyzw
dp4 o3.y, v0.xyzw, cb0[5].xyzw
dp4 o3.z, v0.xyzw, cb0[6].xyzw
dp4 o3.w, v0.xyzw, cb0[7].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_VSAlphaTestVc[] =
{
68, 88, 66, 67, 248, 163,
203, 249, 0, 143, 149, 224,
15, 104, 144, 45, 227, 103,
73, 30, 1, 0, 0, 0,
96, 7, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
240, 4, 0, 0, 96, 6,
0, 0, 212, 6, 0, 0,
65, 111, 110, 57, 184, 4,
0, 0, 184, 4, 0, 0,
0, 2, 254, 255, 120, 4,
0, 0, 64, 0, 0, 0,
2, 0, 36, 0, 0, 0,
60, 0, 0, 0, 60, 0,
0, 0, 36, 0, 1, 0,
60, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
5, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
222, 0, 68, 66, 85, 71,
40, 0, 0, 0, 76, 3,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 192, 0,
0, 0, 16, 0, 0, 0,
200, 0, 0, 0, 3, 0,
0, 0, 16, 3, 0, 0,
72, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
40, 0, 0, 0, 112, 0,
0, 0, 0, 0, 255, 255,
128, 3, 0, 0, 0, 0,
255, 255, 152, 3, 0, 0,
0, 0, 255, 255, 164, 3,
0, 0, 0, 0, 255, 255,
176, 3, 0, 0, 49, 0,
0, 0, 188, 3, 0, 0,
14, 0, 0, 0, 204, 3,
0, 0, 14, 0, 0, 0,
220, 3, 0, 0, 14, 0,
0, 0, 236, 3, 0, 0,
67, 0, 1, 0, 252, 3,
0, 0, 49, 0, 0, 0,
12, 4, 0, 0, 49, 0,
0, 0, 28, 4, 0, 0,
49, 0, 0, 0, 44, 4,
0, 0, 59, 0, 1, 0,
60, 4, 0, 0, 59, 0,
1, 0, 80, 4, 0, 0,
51, 0, 0, 0, 92, 4,
0, 0, 66, 0, 1, 0,
104, 4, 0, 0, 86, 83,
65, 108, 112, 104, 97, 84,
101, 115, 116, 86, 99, 0,
68, 105, 102, 102, 117, 115,
101, 0, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 84,
101, 120, 67, 111, 111, 114,
100, 0, 171, 171, 1, 0,
3, 0, 1, 0, 2, 0,
1, 0, 0, 0, 0, 0,
0, 0, 80, 111, 115, 105,
116, 105, 111, 110, 80, 83,
0, 171, 86, 1, 0, 0,
96, 1, 0, 0, 112, 1,
0, 0, 96, 1, 0, 0,
121, 1, 0, 0, 132, 1,
0, 0, 148, 1, 0, 0,
96, 1, 0, 0, 5, 0,
0, 0, 1, 0, 14, 0,
1, 0, 4, 0, 160, 1,
0, 0, 4, 0, 0, 0,
255, 255, 255, 255, 12, 0,
255, 255, 7, 0, 0, 0,
255, 255, 255, 255, 255, 255,
7, 0, 8, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 12, 0, 0, 0,
10, 0, 11, 0, 255, 255,
255, 255, 13, 0, 0, 0,
255, 255, 255, 255, 255, 255,
13, 0, 14, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 15, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 67, 111, 108,
111, 114, 0, 171, 40, 2,
0, 0, 96, 1, 0, 0,
121, 1, 0, 0, 132, 1,
0, 0, 49, 2, 0, 0,
96, 1, 0, 0, 5, 0,
0, 0, 1, 0, 10, 0,
1, 0, 3, 0, 56, 2,
0, 0, 1, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 2, 0, 0, 0,
4, 0, 5, 0, 255, 255,
255, 255, 3, 0, 0, 0,
6, 0, 7, 0, 8, 0,
9, 0, 118, 111, 117, 116,
0, 80, 111, 115, 95, 112,
115, 0, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 137, 2,
0, 0, 96, 1, 0, 0,
86, 1, 0, 0, 96, 1,
0, 0, 112, 1, 0, 0,
144, 2, 0, 0, 160, 2,
0, 0, 172, 2, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
188, 2, 0, 0, 9, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 10, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 11, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 0, 0,
0, 0, 72, 1, 0, 0,
192, 1, 0, 0, 7, 0,
0, 0, 208, 1, 0, 0,
72, 1, 0, 0, 36, 2,
0, 0, 80, 2, 0, 0,
3, 0, 0, 0, 96, 2,
0, 0, 0, 0, 0, 0,
132, 2, 0, 0, 220, 2,
0, 0, 3, 0, 0, 0,
236, 2, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
7, 0, 15, 160, 0, 0,
0, 0, 0, 0, 128, 63,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 31, 0, 0, 2,
5, 0, 2, 128, 2, 0,
15, 144, 9, 0, 0, 3,
0, 0, 4, 192, 0, 0,
228, 144, 5, 0, 228, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
2, 0, 228, 160, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 7, 0,
0, 160, 10, 0, 0, 3,
1, 0, 8, 224, 0, 0,
0, 128, 7, 0, 85, 160,
5, 0, 0, 3, 0, 0,
15, 224, 2, 0, 228, 144,
1, 0, 228, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 3, 0,
228, 160, 9, 0, 0, 3,
0, 0, 2, 128, 0, 0,
228, 144, 4, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 128, 0, 0, 228, 144,
6, 0, 228, 160, 4, 0,
0, 4, 0, 0, 3, 192,
0, 0, 170, 128, 0, 0,
228, 160, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 192, 0, 0, 170, 128,
1, 0, 0, 2, 1, 0,
7, 224, 7, 0, 0, 160,
1, 0, 0, 2, 2, 0,
3, 224, 1, 0, 228, 144,
255, 255, 0, 0, 83, 72,
68, 82, 104, 1, 0, 0,
64, 0, 1, 0, 90, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 8, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 50, 16,
16, 0, 1, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 2, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 50, 32,
16, 0, 2, 0, 0, 0,
103, 0, 0, 4, 242, 32,
16, 0, 3, 0, 0, 0,
1, 0, 0, 0, 56, 0,
0, 8, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 2, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
17, 32, 0, 8, 130, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 3, 0,
0, 0, 54, 0, 0, 8,
114, 32, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 54, 0,
0, 5, 50, 32, 16, 0,
2, 0, 0, 0, 70, 16,
16, 0, 1, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 4, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
5, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 6, 0, 0, 0,
17, 0, 0, 8, 130, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 7, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 108, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 92, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
3, 3, 0, 0, 101, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 15, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 67, 79, 76, 79, 82,
0, 171, 79, 83, 71, 78,
132, 0, 0, 0, 4, 0,
0, 0, 8, 0, 0, 0,
104, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
104, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
110, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 12, 0, 0,
119, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171
};

View File

@@ -0,0 +1,359 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// COLOR 0 xyzw 2 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 4 4 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5>
dcl_texcoord2 v2 // vin<6,7,8,9>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 oPos.z, v0, c4 // ::VSAlphaTestVcNoFog<8>
#line 82 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mul oT0, v2, c1 // ::VSAlphaTestVcNoFog<0,1,2,3>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c2 // ::vout<0>
dp4 r0.y, v0, c3 // ::vout<1>
dp4 r0.z, v0, c5 // ::vout<3>
#line 74 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\AlphaTestEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSAlphaTestVcNoFog<6,7>
mov oPos.w, r0.z // ::VSAlphaTestVcNoFog<9>
#line 81
mov oT1.xy, v1 // ::VSAlphaTestVcNoFog<4,5>
// approximately 8 instruction slots used
vs_4_0
dcl_constantbuffer CB0[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output o0.xyzw
dcl_output o1.xy
dcl_output_siv o2.xyzw, position
mul o0.xyzw, v2.xyzw, cb0[0].xyzw
mov o1.xy, v1.xyxx
dp4 o2.x, v0.xyzw, cb0[4].xyzw
dp4 o2.y, v0.xyzw, cb0[5].xyzw
dp4 o2.z, v0.xyzw, cb0[6].xyzw
dp4 o2.w, v0.xyzw, cb0[7].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE AlphaTestEffect_VSAlphaTestVcNoFog[] =
{
68, 88, 66, 67, 99, 59,
33, 25, 194, 141, 79, 92,
27, 175, 10, 183, 59, 213,
206, 32, 1, 0, 0, 0,
104, 6, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
92, 4, 0, 0, 128, 5,
0, 0, 244, 5, 0, 0,
65, 111, 110, 57, 36, 4,
0, 0, 36, 4, 0, 0,
0, 2, 254, 255, 228, 3,
0, 0, 64, 0, 0, 0,
2, 0, 36, 0, 0, 0,
60, 0, 0, 0, 60, 0,
0, 0, 36, 0, 1, 0,
60, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 4, 0,
4, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
206, 0, 68, 66, 85, 71,
40, 0, 0, 0, 12, 3,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 192, 0,
0, 0, 11, 0, 0, 0,
200, 0, 0, 0, 3, 0,
0, 0, 208, 2, 0, 0,
32, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 65,
108, 112, 104, 97, 84, 101,
115, 116, 69, 102, 102, 101,
99, 116, 46, 102, 120, 0,
40, 0, 0, 0, 112, 0,
0, 0, 0, 0, 255, 255,
64, 3, 0, 0, 0, 0,
255, 255, 76, 3, 0, 0,
0, 0, 255, 255, 88, 3,
0, 0, 49, 0, 0, 0,
100, 3, 0, 0, 82, 0,
1, 0, 116, 3, 0, 0,
49, 0, 0, 0, 132, 3,
0, 0, 49, 0, 0, 0,
148, 3, 0, 0, 49, 0,
0, 0, 164, 3, 0, 0,
74, 0, 1, 0, 180, 3,
0, 0, 74, 0, 1, 0,
200, 3, 0, 0, 81, 0,
1, 0, 212, 3, 0, 0,
86, 83, 65, 108, 112, 104,
97, 84, 101, 115, 116, 86,
99, 78, 111, 70, 111, 103,
0, 68, 105, 102, 102, 117,
115, 101, 0, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 84, 101, 120, 67,
111, 111, 114, 100, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0,
80, 111, 115, 105, 116, 105,
111, 110, 80, 83, 0, 171,
51, 1, 0, 0, 60, 1,
0, 0, 76, 1, 0, 0,
88, 1, 0, 0, 104, 1,
0, 0, 60, 1, 0, 0,
5, 0, 0, 0, 1, 0,
10, 0, 1, 0, 3, 0,
116, 1, 0, 0, 3, 0,
0, 0, 255, 255, 255, 255,
8, 0, 255, 255, 4, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 8, 0,
0, 0, 6, 0, 7, 0,
255, 255, 255, 255, 9, 0,
0, 0, 255, 255, 255, 255,
255, 255, 9, 0, 10, 0,
0, 0, 4, 0, 5, 0,
255, 255, 255, 255, 118, 105,
110, 0, 80, 111, 115, 105,
116, 105, 111, 110, 0, 67,
111, 108, 111, 114, 0, 171,
220, 1, 0, 0, 60, 1,
0, 0, 76, 1, 0, 0,
88, 1, 0, 0, 229, 1,
0, 0, 60, 1, 0, 0,
5, 0, 0, 0, 1, 0,
10, 0, 1, 0, 3, 0,
236, 1, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 1, 0,
0, 0, 4, 0, 5, 0,
255, 255, 255, 255, 2, 0,
0, 0, 6, 0, 7, 0,
8, 0, 9, 0, 118, 111,
117, 116, 0, 80, 111, 115,
95, 112, 115, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 70, 111, 103, 70,
97, 99, 116, 111, 114, 0,
171, 171, 0, 0, 3, 0,
1, 0, 1, 0, 1, 0,
0, 0, 0, 0, 0, 0,
61, 2, 0, 0, 60, 1,
0, 0, 51, 1, 0, 0,
60, 1, 0, 0, 68, 2,
0, 0, 80, 2, 0, 0,
96, 2, 0, 0, 108, 2,
0, 0, 5, 0, 0, 0,
1, 0, 12, 0, 1, 0,
4, 0, 124, 2, 0, 0,
5, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
6, 0, 0, 0, 255, 255,
1, 0, 255, 255, 255, 255,
7, 0, 0, 0, 255, 255,
255, 255, 3, 0, 255, 255,
0, 0, 0, 0, 32, 1,
0, 0, 140, 1, 0, 0,
5, 0, 0, 0, 156, 1,
0, 0, 32, 1, 0, 0,
216, 1, 0, 0, 4, 2,
0, 0, 3, 0, 0, 0,
20, 2, 0, 0, 0, 0,
0, 0, 56, 2, 0, 0,
156, 2, 0, 0, 3, 0,
0, 0, 172, 2, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 31, 0,
0, 2, 5, 0, 0, 128,
0, 0, 15, 144, 31, 0,
0, 2, 5, 0, 1, 128,
1, 0, 15, 144, 31, 0,
0, 2, 5, 0, 2, 128,
2, 0, 15, 144, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 4, 0,
228, 160, 5, 0, 0, 3,
0, 0, 15, 224, 2, 0,
228, 144, 1, 0, 228, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
2, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 3, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 5, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 1, 0, 0, 2,
1, 0, 3, 224, 1, 0,
228, 144, 255, 255, 0, 0,
83, 72, 68, 82, 28, 1,
0, 0, 64, 0, 1, 0,
71, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 8, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 95, 0, 0, 3,
50, 16, 16, 0, 1, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 2, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
50, 32, 16, 0, 1, 0,
0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 2, 0,
0, 0, 1, 0, 0, 0,
56, 0, 0, 8, 242, 32,
16, 0, 0, 0, 0, 0,
70, 30, 16, 0, 2, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 54, 0, 0, 5,
50, 32, 16, 0, 1, 0,
0, 0, 70, 16, 16, 0,
1, 0, 0, 0, 17, 0,
0, 8, 18, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 4, 0, 0, 0,
17, 0, 0, 8, 34, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 5, 0,
0, 0, 17, 0, 0, 8,
66, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
6, 0, 0, 0, 17, 0,
0, 8, 130, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 7, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 108, 0, 0, 0,
3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 92, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 3, 3,
0, 0, 101, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 15,
0, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 67,
79, 76, 79, 82, 0, 171,
79, 83, 71, 78, 108, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 86, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
3, 12, 0, 0, 95, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 67, 79,
76, 79, 82, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 83, 86, 95, 80, 111,
115, 105, 116, 105, 111, 110,
0, 171
};

View File

@@ -0,0 +1,219 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float w
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 13 1 ( FLT, FLT, FLT, FLT)
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
#line 20 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, c0, t0.w, -t0
mov r1.xyz, t0 // pin<0,1,2>
mad r0.xyz, t1.w, r0, r1 // ApplyFog::color<0,1,2>
mov r0.w, t0.w
mov oC0, r0 // ::PSBasic<0,1,2,3>
// approximately 5 instruction slots used
ps_4_0
dcl_constantbuffer CB0[14], immediateIndexed
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.w
dcl_output o0.xyzw
dcl_temps 1
mad r0.xyz, cb0[13].xyzx, v0.wwww, -v0.xyzx
mad o0.xyz, v1.wwww, r0.xyzx, v0.xyzx
mov o0.w, v0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasic[] =
{
68, 88, 66, 67, 145, 72,
125, 168, 185, 197, 217, 65,
137, 65, 247, 206, 159, 131,
15, 237, 1, 0, 0, 0,
200, 3, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
152, 2, 0, 0, 76, 3,
0, 0, 148, 3, 0, 0,
65, 111, 110, 57, 96, 2,
0, 0, 96, 2, 0, 0,
0, 2, 255, 255, 48, 2,
0, 0, 48, 0, 0, 0,
1, 0, 36, 0, 0, 0,
48, 0, 0, 0, 48, 0,
0, 0, 36, 0, 0, 0,
48, 0, 0, 0, 13, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 2, 255, 255,
254, 255, 112, 0, 68, 66,
85, 71, 40, 0, 0, 0,
148, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
112, 0, 0, 0, 7, 0,
0, 0, 116, 0, 0, 0,
3, 0, 0, 0, 88, 1,
0, 0, 172, 0, 0, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
40, 0, 0, 0, 0, 0,
255, 255, 200, 1, 0, 0,
0, 0, 255, 255, 212, 1,
0, 0, 20, 0, 0, 0,
224, 1, 0, 0, 20, 0,
0, 0, 244, 1, 0, 0,
20, 0, 0, 0, 0, 2,
0, 0, 20, 0, 0, 0,
20, 2, 0, 0, 20, 0,
0, 0, 32, 2, 0, 0,
80, 83, 66, 97, 115, 105,
99, 0, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
65, 112, 112, 108, 121, 70,
111, 103, 0, 99, 111, 108,
111, 114, 0, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 112, 105, 110, 0,
68, 105, 102, 102, 117, 115,
101, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 171,
171, 171, 0, 1, 0, 0,
224, 0, 0, 0, 8, 1,
0, 0, 224, 0, 0, 0,
5, 0, 0, 0, 1, 0,
8, 0, 1, 0, 2, 0,
20, 1, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 1, 0,
0, 0, 4, 0, 5, 0,
6, 0, 7, 0, 3, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 0, 0,
0, 0, 172, 0, 0, 0,
180, 0, 0, 0, 1, 0,
0, 0, 196, 0, 0, 0,
208, 0, 0, 0, 217, 0,
0, 0, 224, 0, 0, 0,
1, 0, 0, 0, 240, 0,
0, 0, 172, 0, 0, 0,
252, 0, 0, 0, 36, 1,
0, 0, 3, 0, 0, 0,
52, 1, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 1, 0,
15, 176, 4, 0, 0, 4,
0, 0, 7, 128, 0, 0,
228, 160, 0, 0, 255, 176,
0, 0, 228, 177, 1, 0,
0, 2, 1, 0, 7, 128,
0, 0, 228, 176, 4, 0,
0, 4, 0, 0, 7, 128,
1, 0, 255, 176, 0, 0,
228, 128, 1, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 128, 0, 0, 255, 176,
1, 0, 0, 2, 0, 8,
15, 128, 0, 0, 228, 128,
255, 255, 0, 0, 83, 72,
68, 82, 172, 0, 0, 0,
64, 0, 0, 0, 43, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 14, 0, 0, 0,
98, 16, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
98, 16, 0, 3, 130, 16,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
104, 0, 0, 2, 1, 0,
0, 0, 50, 0, 0, 11,
114, 0, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 13, 0,
0, 0, 246, 31, 16, 0,
0, 0, 0, 0, 70, 18,
16, 128, 65, 0, 0, 0,
0, 0, 0, 0, 50, 0,
0, 9, 114, 32, 16, 0,
0, 0, 0, 0, 246, 31,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
0, 0, 0, 0, 54, 0,
0, 5, 130, 32, 16, 0,
0, 0, 0, 0, 58, 16,
16, 0, 0, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 64, 0, 0, 0,
2, 0, 0, 0, 8, 0,
0, 0, 56, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 56, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 8,
0, 0, 67, 79, 76, 79,
82, 0, 171, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

Binary file not shown.

View File

@@ -0,0 +1,143 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
#line 507 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mov oC0, t0 // ::PSBasicNoFog<0,1,2,3>
// approximately 1 instruction slot used
ps_4_0
dcl_input_ps linear v0.xyzw
dcl_output o0.xyzw
mov o0.xyzw, v0.xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicNoFog[] =
{
68, 88, 66, 67, 181, 141,
52, 249, 104, 203, 93, 96,
195, 252, 22, 12, 12, 108,
165, 17, 1, 0, 0, 0,
108, 2, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
200, 1, 0, 0, 8, 2,
0, 0, 56, 2, 0, 0,
65, 111, 110, 57, 144, 1,
0, 0, 144, 1, 0, 0,
0, 2, 255, 255, 108, 1,
0, 0, 36, 0, 0, 0,
0, 0, 36, 0, 0, 0,
36, 0, 0, 0, 36, 0,
0, 0, 36, 0, 0, 0,
36, 0, 0, 2, 255, 255,
254, 255, 82, 0, 68, 66,
85, 71, 40, 0, 0, 0,
28, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
116, 0, 0, 0, 2, 0,
0, 0, 120, 0, 0, 0,
2, 0, 0, 0, 244, 0,
0, 0, 136, 0, 0, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 40, 0,
0, 0, 0, 0, 255, 255,
80, 1, 0, 0, 251, 1,
0, 0, 92, 1, 0, 0,
80, 83, 66, 97, 115, 105,
99, 78, 111, 70, 111, 103,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 112, 105, 110, 0,
68, 105, 102, 102, 117, 115,
101, 0, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
184, 0, 0, 0, 192, 0,
0, 0, 5, 0, 0, 0,
1, 0, 4, 0, 1, 0,
1, 0, 208, 0, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
0, 0, 0, 0, 136, 0,
0, 0, 152, 0, 0, 0,
1, 0, 0, 0, 168, 0,
0, 0, 136, 0, 0, 0,
180, 0, 0, 0, 216, 0,
0, 0, 1, 0, 0, 0,
232, 0, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 176, 255, 255, 0, 0,
83, 72, 68, 82, 56, 0,
0, 0, 64, 0, 0, 0,
14, 0, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 40, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 67, 79, 76, 79,
82, 0, 171, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,858 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float xyzw
// TEXCOORD 1 xyz 1 NONE float xyz
// COLOR 0 xyzw 2 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 0 14 ( FLT, FLT, FLT, FLT)
//
//
// Level9 shader bytecode:
//
ps_2_0
def c14, 1, 0, 0, 0
dcl t0 // pin<0,1,2,3>
dcl t1.xyz // pin<4,5,6>
dcl t2 // pin<7,8,9,10>
#line 580 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
add r0.xyz, -t0, c12
dp3 r0.w, r0, r0
rsq r0.w, r0.w
#line 33 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mad r1.xyz, r0, r0.w, -c3
nrm r2.xyz, r1 // ::halfVectors<0,1,2>
#line 581 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
nrm r1.xyz, t1 // ::worldNormal<0,1,2>
#line 37 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r2.x, r2, r1 // ::dotH<0>
#line 33
mad r3.xyz, r0, r0.w, -c4
mad r0.xyz, r0, r0.w, -c5
nrm r4.xyz, r0 // ::halfVectors<6,7,8>
#line 37
dp3 r2.z, r4, r1 // ::dotH<2>
#line 33
nrm r0.xyz, r3 // ::halfVectors<3,4,5>
#line 37
dp3 r2.y, r0, r1 // ::dotH<1>
dp3 r0.x, -c3, r1 // ::dotL<0>
dp3 r0.y, -c4, r1 // ::dotL<1>
dp3 r0.z, -c5, r1 // ::dotL<2>
#line 39
cmp r1.xyz, r0, c14.x, c14.y // ::zeroL<0,1,2>
#line 42
mul r3.xyz, r1, r2
cmp r2.xyz, r2, r3, c14.y
mul r1.xyz, r0, r1 // ::diffuse<0,1,2>
log r3.x, r2.x
log r3.y, r2.y
log r3.z, r2.z
mul r2.xyz, r3, c2.w
exp r3.x, r2.x
exp r3.y, r2.y
exp r3.z, r2.z
mul r0.xyz, r0, r3 // ::specular<0,1,2>
#line 47
mul r2.xyz, r0.y, c10
mad r2.xyz, r0.x, c9, r2
mad r0.xyz, r0.z, c11, r2
mul r0.xyz, r0, c2 // ::result<3,4,5>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mul r0.xyz, r0, t2.w
#line 46 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mul r2.xyz, r1.y, c7
mad r2.xyz, r1.x, c6, r2
mad r1.xyz, r1.z, c8, r2
mov r2.xyz, c0 // Parameters::DiffuseColor<0,1,2>
mad r1.xyz, r1, r2, c1 // ::result<0,1,2>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, t2, r1, r0 // AddSpecular::color<0,1,2>
#line 20
mad r1.xyz, c13, t2.w, -r0
mad r0.xyz, t0.w, r1, r0 // ApplyFog::color<0,1,2>
mov r0.w, t2.w
mov oC0, r0 // ::PSBasicPixelLighting<0,1,2,3>
// approximately 51 instruction slots used
ps_4_0
dcl_constantbuffer CB0[14], immediateIndexed
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xyzw
dcl_output o0.xyzw
dcl_temps 4
add r0.xyz, -v0.xyzx, cb0[12].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mad r1.xyz, r0.xyzx, r0.wwww, -cb0[3].xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3 r1.w, v1.xyzx, v1.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, v1.xyzx
dp3 r1.x, r1.xyzx, r2.xyzx
mad r3.xyz, r0.xyzx, r0.wwww, -cb0[4].xyzx
mad r0.xyz, r0.xyzx, r0.wwww, -cb0[5].xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
dp3 r1.y, r3.xyzx, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r1.z, r0.xyzx, r2.xyzx
max r0.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
dp3 r1.x, -cb0[3].xyzx, r2.xyzx
dp3 r1.y, -cb0[4].xyzx, r2.xyzx
dp3 r1.z, -cb0[5].xyzx, r2.xyzx
ge r2.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r2.xyz, r2.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r0.xyz, r0.xyzx, r2.xyzx
mul r2.xyz, r1.xyzx, r2.xyzx
log r0.xyz, r0.xyzx
mul r0.xyz, r0.xyzx, cb0[2].wwww
exp r0.xyz, r0.xyzx
mul r0.xyz, r1.xyzx, r0.xyzx
mul r1.xyz, r0.yyyy, cb0[10].xyzx
mad r0.xyw, r0.xxxx, cb0[9].xyxz, r1.xyxz
mad r0.xyz, r0.zzzz, cb0[11].xyzx, r0.xywx
mul r0.xyz, r0.xyzx, cb0[2].xyzx
mul r0.xyz, r0.xyzx, v2.wwww
mul r1.xyz, r2.yyyy, cb0[7].xyzx
mad r1.xyz, r2.xxxx, cb0[6].xyzx, r1.xyzx
mad r1.xyz, r2.zzzz, cb0[8].xyzx, r1.xyzx
mad r1.xyz, r1.xyzx, cb0[0].xyzx, cb0[1].xyzx
mad r0.xyz, v2.xyzx, r1.xyzx, r0.xyzx
mad r1.xyz, cb0[13].xyzx, v2.wwww, -r0.xyzx
mad o0.xyz, v0.wwww, r1.xyzx, r0.xyzx
mov o0.w, v2.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicPixelLighting[] =
{
68, 88, 66, 67, 246, 112,
115, 104, 215, 10, 161, 255,
46, 116, 127, 82, 111, 129,
151, 195, 1, 0, 0, 0,
28, 16, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
120, 9, 0, 0, 128, 15,
0, 0, 232, 15, 0, 0,
65, 111, 110, 57, 64, 9,
0, 0, 64, 9, 0, 0,
0, 2, 255, 255, 16, 9,
0, 0, 48, 0, 0, 0,
1, 0, 36, 0, 0, 0,
48, 0, 0, 0, 48, 0,
0, 0, 36, 0, 0, 0,
48, 0, 0, 0, 0, 0,
14, 0, 0, 0, 0, 0,
0, 0, 0, 2, 255, 255,
254, 255, 135, 1, 68, 66,
85, 71, 40, 0, 0, 0,
240, 5, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
8, 1, 0, 0, 47, 0,
0, 0, 20, 1, 0, 0,
13, 0, 0, 0, 236, 4,
0, 0, 192, 2, 0, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
171, 171, 40, 0, 0, 0,
116, 0, 0, 0, 190, 0,
0, 0, 0, 0, 255, 255,
36, 6, 0, 0, 0, 0,
255, 255, 60, 6, 0, 0,
0, 0, 255, 255, 72, 6,
0, 0, 0, 0, 255, 255,
84, 6, 0, 0, 68, 2,
0, 0, 96, 6, 0, 0,
68, 2, 0, 0, 112, 6,
0, 0, 68, 2, 0, 0,
128, 6, 0, 0, 33, 0,
1, 0, 140, 6, 0, 0,
33, 0, 1, 0, 160, 6,
0, 0, 69, 2, 0, 0,
172, 6, 0, 0, 37, 0,
1, 0, 184, 6, 0, 0,
33, 0, 1, 0, 200, 6,
0, 0, 33, 0, 1, 0,
220, 6, 0, 0, 33, 0,
1, 0, 240, 6, 0, 0,
37, 0, 1, 0, 252, 6,
0, 0, 33, 0, 1, 0,
12, 7, 0, 0, 37, 0,
1, 0, 24, 7, 0, 0,
36, 0, 1, 0, 40, 7,
0, 0, 36, 0, 1, 0,
56, 7, 0, 0, 36, 0,
1, 0, 72, 7, 0, 0,
39, 0, 1, 0, 88, 7,
0, 0, 42, 0, 1, 0,
108, 7, 0, 0, 42, 0,
1, 0, 124, 7, 0, 0,
41, 0, 1, 0, 144, 7,
0, 0, 42, 0, 1, 0,
160, 7, 0, 0, 42, 0,
1, 0, 172, 7, 0, 0,
42, 0, 1, 0, 184, 7,
0, 0, 42, 0, 1, 0,
196, 7, 0, 0, 42, 0,
1, 0, 212, 7, 0, 0,
42, 0, 1, 0, 224, 7,
0, 0, 42, 0, 1, 0,
236, 7, 0, 0, 42, 0,
1, 0, 248, 7, 0, 0,
47, 0, 1, 0, 8, 8,
0, 0, 47, 0, 1, 0,
24, 8, 0, 0, 47, 0,
1, 0, 44, 8, 0, 0,
47, 0, 1, 0, 64, 8,
0, 0, 26, 0, 2, 0,
80, 8, 0, 0, 46, 0,
1, 0, 96, 8, 0, 0,
46, 0, 1, 0, 112, 8,
0, 0, 46, 0, 1, 0,
132, 8, 0, 0, 46, 0,
1, 0, 152, 8, 0, 0,
46, 0, 1, 0, 164, 8,
0, 0, 26, 0, 2, 0,
184, 8, 0, 0, 20, 0,
2, 0, 204, 8, 0, 0,
20, 0, 2, 0, 224, 8,
0, 0, 20, 0, 2, 0,
244, 8, 0, 0, 20, 0,
2, 0, 0, 9, 0, 0,
80, 97, 114, 97, 109, 101,
116, 101, 114, 115, 0, 68,
105, 102, 102, 117, 115, 101,
67, 111, 108, 111, 114, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 40, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 80, 83,
66, 97, 115, 105, 99, 80,
105, 120, 101, 108, 76, 105,
103, 104, 116, 105, 110, 103,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 46, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 65, 112, 112, 108,
121, 70, 111, 103, 0, 99,
111, 108, 111, 114, 0, 171,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 44, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 65, 100,
100, 83, 112, 101, 99, 117,
108, 97, 114, 0, 42, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 100, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 23, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 100, 111,
116, 72, 0, 171, 171, 171,
10, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
14, 0, 0, 0, 255, 255,
255, 255, 2, 0, 255, 255,
16, 0, 0, 0, 255, 255,
1, 0, 255, 255, 255, 255,
100, 111, 116, 76, 0, 171,
171, 171, 17, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 18, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 19, 0, 0, 0,
255, 255, 255, 255, 2, 0,
255, 255, 104, 97, 108, 102,
86, 101, 99, 116, 111, 114,
115, 0, 3, 0, 3, 0,
3, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
13, 0, 0, 0, 6, 0,
7, 0, 8, 0, 255, 255,
15, 0, 0, 0, 3, 0,
4, 0, 5, 0, 255, 255,
112, 105, 110, 0, 80, 111,
115, 105, 116, 105, 111, 110,
87, 83, 0, 78, 111, 114,
109, 97, 108, 87, 83, 0,
68, 105, 102, 102, 117, 115,
101, 0, 248, 3, 0, 0,
4, 3, 0, 0, 3, 4,
0, 0, 64, 3, 0, 0,
12, 4, 0, 0, 4, 3,
0, 0, 5, 0, 0, 0,
1, 0, 11, 0, 1, 0,
3, 0, 20, 4, 0, 0,
1, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
2, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
3, 0, 0, 0, 7, 0,
8, 0, 9, 0, 10, 0,
114, 101, 115, 117, 108, 116,
0, 83, 112, 101, 99, 117,
108, 97, 114, 0, 12, 4,
0, 0, 64, 3, 0, 0,
103, 4, 0, 0, 64, 3,
0, 0, 5, 0, 0, 0,
1, 0, 6, 0, 1, 0,
2, 0, 112, 4, 0, 0,
35, 0, 0, 0, 3, 0,
4, 0, 5, 0, 255, 255,
41, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
115, 112, 101, 99, 117, 108,
97, 114, 0, 171, 171, 171,
31, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
119, 111, 114, 108, 100, 78,
111, 114, 109, 97, 108, 0,
9, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
122, 101, 114, 111, 76, 0,
171, 171, 20, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 140, 2, 0, 0,
151, 2, 0, 0, 164, 2,
0, 0, 1, 0, 0, 0,
180, 2, 0, 0, 0, 0,
0, 0, 192, 2, 0, 0,
216, 2, 0, 0, 1, 0,
0, 0, 232, 2, 0, 0,
244, 2, 0, 0, 253, 2,
0, 0, 4, 3, 0, 0,
1, 0, 0, 0, 20, 3,
0, 0, 32, 3, 0, 0,
253, 2, 0, 0, 4, 3,
0, 0, 1, 0, 0, 0,
44, 3, 0, 0, 0, 0,
0, 0, 56, 3, 0, 0,
64, 3, 0, 0, 1, 0,
0, 0, 80, 3, 0, 0,
0, 0, 0, 0, 92, 3,
0, 0, 64, 3, 0, 0,
3, 0, 0, 0, 100, 3,
0, 0, 0, 0, 0, 0,
136, 3, 0, 0, 64, 3,
0, 0, 3, 0, 0, 0,
144, 3, 0, 0, 0, 0,
0, 0, 180, 3, 0, 0,
192, 3, 0, 0, 3, 0,
0, 0, 208, 3, 0, 0,
192, 2, 0, 0, 244, 3,
0, 0, 44, 4, 0, 0,
3, 0, 0, 0, 60, 4,
0, 0, 0, 0, 0, 0,
96, 4, 0, 0, 128, 4,
0, 0, 2, 0, 0, 0,
144, 4, 0, 0, 0, 0,
0, 0, 168, 4, 0, 0,
64, 3, 0, 0, 1, 0,
0, 0, 180, 4, 0, 0,
0, 0, 0, 0, 192, 4,
0, 0, 64, 3, 0, 0,
1, 0, 0, 0, 204, 4,
0, 0, 0, 0, 0, 0,
216, 4, 0, 0, 64, 3,
0, 0, 1, 0, 0, 0,
224, 4, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
14, 0, 15, 160, 0, 0,
128, 63, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 1, 0,
7, 176, 31, 0, 0, 2,
0, 0, 0, 128, 2, 0,
15, 176, 2, 0, 0, 3,
0, 0, 7, 128, 0, 0,
228, 177, 12, 0, 228, 160,
8, 0, 0, 3, 0, 0,
8, 128, 0, 0, 228, 128,
0, 0, 228, 128, 7, 0,
0, 2, 0, 0, 8, 128,
0, 0, 255, 128, 4, 0,
0, 4, 1, 0, 7, 128,
0, 0, 228, 128, 0, 0,
255, 128, 3, 0, 228, 161,
36, 0, 0, 2, 2, 0,
7, 128, 1, 0, 228, 128,
36, 0, 0, 2, 1, 0,
7, 128, 1, 0, 228, 176,
8, 0, 0, 3, 2, 0,
1, 128, 2, 0, 228, 128,
1, 0, 228, 128, 4, 0,
0, 4, 3, 0, 7, 128,
0, 0, 228, 128, 0, 0,
255, 128, 4, 0, 228, 161,
4, 0, 0, 4, 0, 0,
7, 128, 0, 0, 228, 128,
0, 0, 255, 128, 5, 0,
228, 161, 36, 0, 0, 2,
4, 0, 7, 128, 0, 0,
228, 128, 8, 0, 0, 3,
2, 0, 4, 128, 4, 0,
228, 128, 1, 0, 228, 128,
36, 0, 0, 2, 0, 0,
7, 128, 3, 0, 228, 128,
8, 0, 0, 3, 2, 0,
2, 128, 0, 0, 228, 128,
1, 0, 228, 128, 8, 0,
0, 3, 0, 0, 1, 128,
3, 0, 228, 161, 1, 0,
228, 128, 8, 0, 0, 3,
0, 0, 2, 128, 4, 0,
228, 161, 1, 0, 228, 128,
8, 0, 0, 3, 0, 0,
4, 128, 5, 0, 228, 161,
1, 0, 228, 128, 88, 0,
0, 4, 1, 0, 7, 128,
0, 0, 228, 128, 14, 0,
0, 160, 14, 0, 85, 160,
5, 0, 0, 3, 3, 0,
7, 128, 1, 0, 228, 128,
2, 0, 228, 128, 88, 0,
0, 4, 2, 0, 7, 128,
2, 0, 228, 128, 3, 0,
228, 128, 14, 0, 85, 160,
5, 0, 0, 3, 1, 0,
7, 128, 0, 0, 228, 128,
1, 0, 228, 128, 15, 0,
0, 2, 3, 0, 1, 128,
2, 0, 0, 128, 15, 0,
0, 2, 3, 0, 2, 128,
2, 0, 85, 128, 15, 0,
0, 2, 3, 0, 4, 128,
2, 0, 170, 128, 5, 0,
0, 3, 2, 0, 7, 128,
3, 0, 228, 128, 2, 0,
255, 160, 14, 0, 0, 2,
3, 0, 1, 128, 2, 0,
0, 128, 14, 0, 0, 2,
3, 0, 2, 128, 2, 0,
85, 128, 14, 0, 0, 2,
3, 0, 4, 128, 2, 0,
170, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
228, 128, 3, 0, 228, 128,
5, 0, 0, 3, 2, 0,
7, 128, 0, 0, 85, 128,
10, 0, 228, 160, 4, 0,
0, 4, 2, 0, 7, 128,
0, 0, 0, 128, 9, 0,
228, 160, 2, 0, 228, 128,
4, 0, 0, 4, 0, 0,
7, 128, 0, 0, 170, 128,
11, 0, 228, 160, 2, 0,
228, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
228, 128, 2, 0, 228, 160,
5, 0, 0, 3, 0, 0,
7, 128, 0, 0, 228, 128,
2, 0, 255, 176, 5, 0,
0, 3, 2, 0, 7, 128,
1, 0, 85, 128, 7, 0,
228, 160, 4, 0, 0, 4,
2, 0, 7, 128, 1, 0,
0, 128, 6, 0, 228, 160,
2, 0, 228, 128, 4, 0,
0, 4, 1, 0, 7, 128,
1, 0, 170, 128, 8, 0,
228, 160, 2, 0, 228, 128,
1, 0, 0, 2, 2, 0,
7, 128, 0, 0, 228, 160,
4, 0, 0, 4, 1, 0,
7, 128, 1, 0, 228, 128,
2, 0, 228, 128, 1, 0,
228, 160, 4, 0, 0, 4,
0, 0, 7, 128, 2, 0,
228, 176, 1, 0, 228, 128,
0, 0, 228, 128, 4, 0,
0, 4, 1, 0, 7, 128,
13, 0, 228, 160, 2, 0,
255, 176, 0, 0, 228, 129,
4, 0, 0, 4, 0, 0,
7, 128, 0, 0, 255, 176,
1, 0, 228, 128, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 128, 2, 0,
255, 176, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 128, 255, 255, 0, 0,
83, 72, 68, 82, 0, 6,
0, 0, 64, 0, 0, 0,
128, 1, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 98, 16, 0, 3,
114, 16, 16, 0, 1, 0,
0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 2, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 104, 0, 0, 2,
4, 0, 0, 0, 0, 0,
0, 9, 114, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 128, 65, 0, 0, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
12, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 11, 114, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 130, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
16, 0, 0, 7, 130, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 130, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 1, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 1, 0, 0, 0,
246, 15, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
1, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
1, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
2, 0, 0, 0, 246, 15,
16, 0, 1, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 3, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 246, 15, 16, 0,
0, 0, 0, 0, 70, 130,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 4, 0,
0, 0, 50, 0, 0, 11,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
70, 2, 16, 0, 3, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
3, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 3, 0,
0, 0, 16, 0, 0, 7,
34, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
16, 0, 0, 7, 130, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 68, 0,
0, 5, 130, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 16, 0,
0, 7, 66, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 2, 0,
0, 0, 52, 0, 0, 10,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
16, 0, 0, 9, 18, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
16, 0, 0, 9, 34, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
16, 0, 0, 9, 66, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
29, 0, 0, 10, 114, 0,
16, 0, 2, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 10, 114, 0, 16, 0,
2, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
0, 0, 56, 0, 0, 7,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 2, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
2, 0, 0, 0, 47, 0,
0, 5, 114, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 246, 143, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 25, 0, 0, 5,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
114, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
10, 0, 0, 0, 50, 0,
0, 10, 178, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 136, 32, 0, 0, 0,
0, 0, 9, 0, 0, 0,
70, 8, 16, 0, 1, 0,
0, 0, 50, 0, 0, 10,
114, 0, 16, 0, 0, 0,
0, 0, 166, 10, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
11, 0, 0, 0, 70, 3,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 56, 0, 0, 7,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 246, 31,
16, 0, 2, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 1, 0, 0, 0,
86, 5, 16, 0, 2, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 7, 0,
0, 0, 50, 0, 0, 10,
114, 0, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
6, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
50, 0, 0, 10, 114, 0,
16, 0, 1, 0, 0, 0,
166, 10, 16, 0, 2, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 8, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 50, 0,
0, 11, 114, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
50, 0, 0, 9, 114, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 2, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 13, 0, 0, 0,
246, 31, 16, 0, 2, 0,
0, 0, 70, 2, 16, 128,
65, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 9,
114, 32, 16, 0, 0, 0,
0, 0, 246, 31, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 54, 0, 0, 5,
130, 32, 16, 0, 0, 0,
0, 0, 58, 16, 16, 0,
2, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
96, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
80, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 7, 0, 0,
89, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 15, 0, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 67, 79, 76,
79, 82, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,922 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xy 0 NONE float xy
// TEXCOORD 1 xyzw 1 NONE float xyzw
// TEXCOORD 2 xyz 2 NONE float xyz
// COLOR 0 xyzw 3 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 0 14 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
def c14, 1, 0, 0, 0
dcl t0.xyz // pin<0,1>
dcl t1 // pin<2,3,4,5>
dcl t2.xyz // pin<6,7,8>
dcl t3 // pin<9,10,11,12>
dcl_2d s0
#line 597 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
texld r0, t0, s0
add r1.xyz, -t1, c12
dp3 r1.w, r1, r1
rsq r1.w, r1.w
#line 33 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mad r2.xyz, r1, r1.w, -c3
nrm r3.xyz, r2 // ::halfVectors<0,1,2>
#line 600 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
nrm r2.xyz, t2 // ::worldNormal<0,1,2>
#line 37 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r3.x, r3, r2 // ::dotH<0>
#line 33
mad r4.xyz, r1, r1.w, -c4
mad r1.xyz, r1, r1.w, -c5
nrm r5.xyz, r1 // ::halfVectors<6,7,8>
#line 37
dp3 r3.z, r5, r2 // ::dotH<2>
#line 33
nrm r1.xyz, r4 // ::halfVectors<3,4,5>
#line 37
dp3 r3.y, r1, r2 // ::dotH<1>
dp3 r1.x, -c3, r2 // ::dotL<0>
dp3 r1.y, -c4, r2 // ::dotL<1>
dp3 r1.z, -c5, r2 // ::dotL<2>
#line 39
cmp r2.xyz, r1, c14.x, c14.y // ::zeroL<0,1,2>
#line 42
mul r4.xyz, r2, r3
cmp r3.xyz, r3, r4, c14.y
mul r2.xyz, r1, r2 // ::diffuse<0,1,2>
log r4.x, r3.x
log r4.y, r3.y
log r4.z, r3.z
mul r3.xyz, r4, c2.w
exp r4.x, r3.x
exp r4.y, r3.y
exp r4.z, r3.z
mul r1.xyz, r1, r4 // ::specular<0,1,2>
#line 47
mul r3.xyz, r1.y, c10
mad r3.xyz, r1.x, c9, r3
mad r1.xyz, r1.z, c11, r3
mul r1.xyz, r1, c2 // ::result<3,4,5>
#line 597 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul r0, r0, t3 // ::color<0,1,2,3>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mul r1.xyz, r0.w, r1
#line 46 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mul r3.xyz, r2.y, c7
mad r3.xyz, r2.x, c6, r3
mad r2.xyz, r2.z, c8, r3
mov r3.xyz, c0 // Parameters::DiffuseColor<0,1,2>
mad r2.xyz, r2, r3, c1 // ::result<0,1,2>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r1.xyz, r0, r2, r1 // AddSpecular::color<0,1,2>
#line 20
mad r2.xyz, c13, r0.w, -r1
mad r0.xyz, t1.w, r2, r1 // ApplyFog::color<0,1,2>
mov oC0, r0 // ::PSBasicPixelLightingTx<0,1,2,3>
// approximately 52 instruction slots used (1 texture, 51 arithmetic)
ps_4_0
dcl_constantbuffer CB0[14], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xy
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyzw
dcl_output o0.xyzw
dcl_temps 4
add r0.xyz, -v1.xyzx, cb0[12].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mad r1.xyz, r0.xyzx, r0.wwww, -cb0[3].xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3 r1.w, v2.xyzx, v2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, v2.xyzx
dp3 r1.x, r1.xyzx, r2.xyzx
mad r3.xyz, r0.xyzx, r0.wwww, -cb0[4].xyzx
mad r0.xyz, r0.xyzx, r0.wwww, -cb0[5].xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
dp3 r1.y, r3.xyzx, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r1.z, r0.xyzx, r2.xyzx
max r0.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
dp3 r1.x, -cb0[3].xyzx, r2.xyzx
dp3 r1.y, -cb0[4].xyzx, r2.xyzx
dp3 r1.z, -cb0[5].xyzx, r2.xyzx
ge r2.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r2.xyz, r2.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r0.xyz, r0.xyzx, r2.xyzx
mul r2.xyz, r1.xyzx, r2.xyzx
log r0.xyz, r0.xyzx
mul r0.xyz, r0.xyzx, cb0[2].wwww
exp r0.xyz, r0.xyzx
mul r0.xyz, r1.xyzx, r0.xyzx
mul r1.xyz, r0.yyyy, cb0[10].xyzx
mad r0.xyw, r0.xxxx, cb0[9].xyxz, r1.xyxz
mad r0.xyz, r0.zzzz, cb0[11].xyzx, r0.xywx
mul r0.xyz, r0.xyzx, cb0[2].xyzx
sample r1.xyzw, v0.xyxx, t0.xyzw, s0
mul r1.xyzw, r1.xyzw, v3.xyzw
mul r0.xyz, r0.xyzx, r1.wwww
mul r3.xyz, r2.yyyy, cb0[7].xyzx
mad r2.xyw, r2.xxxx, cb0[6].xyxz, r3.xyxz
mad r2.xyz, r2.zzzz, cb0[8].xyzx, r2.xywx
mad r2.xyz, r2.xyzx, cb0[0].xyzx, cb0[1].xyzx
mad r0.xyz, r1.xyzx, r2.xyzx, r0.xyzx
mad r1.xyz, cb0[13].xyzx, r1.wwww, -r0.xyzx
mad o0.xyz, v1.wwww, r1.xyzx, r0.xyzx
mov o0.w, r1.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicPixelLightingTx[] =
{
68, 88, 66, 67, 28, 31,
63, 118, 174, 186, 222, 46,
17, 25, 144, 155, 31, 175,
202, 30, 1, 0, 0, 0,
52, 17, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
16, 10, 0, 0, 128, 16,
0, 0, 0, 17, 0, 0,
65, 111, 110, 57, 216, 9,
0, 0, 216, 9, 0, 0,
0, 2, 255, 255, 164, 9,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 0, 0, 14, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
161, 1, 68, 66, 85, 71,
40, 0, 0, 0, 88, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 50, 0, 0, 0,
20, 1, 0, 0, 14, 0,
0, 0, 64, 5, 0, 0,
216, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 67, 58, 92, 85,
115, 101, 114, 115, 92, 67,
104, 117, 99, 107, 87, 92,
68, 101, 115, 107, 116, 111,
112, 92, 68, 51, 68, 49,
49, 32, 80, 114, 111, 106,
101, 99, 116, 115, 92, 68,
105, 114, 101, 99, 116, 88,
84, 75, 92, 83, 114, 99,
92, 83, 104, 97, 100, 101,
114, 115, 92, 76, 105, 103,
104, 116, 105, 110, 103, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 171, 171,
40, 0, 0, 0, 116, 0,
0, 0, 190, 0, 0, 0,
0, 0, 255, 255, 140, 6,
0, 0, 0, 0, 255, 255,
164, 6, 0, 0, 0, 0,
255, 255, 176, 6, 0, 0,
0, 0, 255, 255, 188, 6,
0, 0, 0, 0, 255, 255,
200, 6, 0, 0, 0, 0,
255, 255, 212, 6, 0, 0,
85, 2, 0, 0, 224, 6,
0, 0, 87, 2, 0, 0,
240, 6, 0, 0, 87, 2,
0, 0, 0, 7, 0, 0,
87, 2, 0, 0, 16, 7,
0, 0, 33, 0, 1, 0,
28, 7, 0, 0, 33, 0,
1, 0, 48, 7, 0, 0,
88, 2, 0, 0, 60, 7,
0, 0, 37, 0, 1, 0,
72, 7, 0, 0, 33, 0,
1, 0, 88, 7, 0, 0,
33, 0, 1, 0, 108, 7,
0, 0, 33, 0, 1, 0,
128, 7, 0, 0, 37, 0,
1, 0, 140, 7, 0, 0,
33, 0, 1, 0, 156, 7,
0, 0, 37, 0, 1, 0,
168, 7, 0, 0, 36, 0,
1, 0, 184, 7, 0, 0,
36, 0, 1, 0, 200, 7,
0, 0, 36, 0, 1, 0,
216, 7, 0, 0, 39, 0,
1, 0, 232, 7, 0, 0,
42, 0, 1, 0, 252, 7,
0, 0, 42, 0, 1, 0,
12, 8, 0, 0, 41, 0,
1, 0, 32, 8, 0, 0,
42, 0, 1, 0, 48, 8,
0, 0, 42, 0, 1, 0,
60, 8, 0, 0, 42, 0,
1, 0, 72, 8, 0, 0,
42, 0, 1, 0, 84, 8,
0, 0, 42, 0, 1, 0,
100, 8, 0, 0, 42, 0,
1, 0, 112, 8, 0, 0,
42, 0, 1, 0, 124, 8,
0, 0, 42, 0, 1, 0,
136, 8, 0, 0, 47, 0,
1, 0, 152, 8, 0, 0,
47, 0, 1, 0, 168, 8,
0, 0, 47, 0, 1, 0,
188, 8, 0, 0, 47, 0,
1, 0, 208, 8, 0, 0,
85, 2, 0, 0, 224, 8,
0, 0, 26, 0, 2, 0,
240, 8, 0, 0, 46, 0,
1, 0, 0, 9, 0, 0,
46, 0, 1, 0, 16, 9,
0, 0, 46, 0, 1, 0,
36, 9, 0, 0, 46, 0,
1, 0, 56, 9, 0, 0,
46, 0, 1, 0, 68, 9,
0, 0, 26, 0, 2, 0,
88, 9, 0, 0, 20, 0,
2, 0, 108, 9, 0, 0,
20, 0, 2, 0, 128, 9,
0, 0, 20, 0, 2, 0,
148, 9, 0, 0, 80, 97,
114, 97, 109, 101, 116, 101,
114, 115, 0, 68, 105, 102,
102, 117, 115, 101, 67, 111,
108, 111, 114, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 44, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 80, 83, 66, 97,
115, 105, 99, 80, 105, 120,
101, 108, 76, 105, 103, 104,
116, 105, 110, 103, 84, 120,
0, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
49, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
65, 112, 112, 108, 121, 70,
111, 103, 0, 99, 111, 108,
111, 114, 0, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 48, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 65, 100, 100, 83,
112, 101, 99, 117, 108, 97,
114, 0, 46, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 39, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 100, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 26, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 100, 111, 116, 72,
0, 171, 171, 171, 13, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 17, 0,
0, 0, 255, 255, 255, 255,
2, 0, 255, 255, 19, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 100, 111,
116, 76, 0, 171, 171, 171,
20, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
21, 0, 0, 0, 255, 255,
1, 0, 255, 255, 255, 255,
22, 0, 0, 0, 255, 255,
255, 255, 2, 0, 255, 255,
104, 97, 108, 102, 86, 101,
99, 116, 111, 114, 115, 0,
3, 0, 3, 0, 3, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 16, 0,
0, 0, 6, 0, 7, 0,
8, 0, 255, 255, 18, 0,
0, 0, 3, 0, 4, 0,
5, 0, 255, 255, 112, 105,
110, 0, 84, 101, 120, 67,
111, 111, 114, 100, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0,
80, 111, 115, 105, 116, 105,
111, 110, 87, 83, 0, 78,
111, 114, 109, 97, 108, 87,
83, 0, 68, 105, 102, 102,
117, 115, 101, 0, 28, 4,
0, 0, 40, 4, 0, 0,
56, 4, 0, 0, 28, 3,
0, 0, 67, 4, 0, 0,
100, 3, 0, 0, 76, 4,
0, 0, 28, 3, 0, 0,
5, 0, 0, 0, 1, 0,
13, 0, 1, 0, 4, 0,
84, 4, 0, 0, 1, 0,
0, 0, 0, 0, 1, 0,
255, 255, 255, 255, 2, 0,
0, 0, 2, 0, 3, 0,
4, 0, 5, 0, 3, 0,
0, 0, 6, 0, 7, 0,
8, 0, 255, 255, 4, 0,
0, 0, 9, 0, 10, 0,
11, 0, 12, 0, 114, 101,
115, 117, 108, 116, 0, 83,
112, 101, 99, 117, 108, 97,
114, 0, 76, 4, 0, 0,
100, 3, 0, 0, 187, 4,
0, 0, 100, 3, 0, 0,
5, 0, 0, 0, 1, 0,
6, 0, 1, 0, 2, 0,
196, 4, 0, 0, 38, 0,
0, 0, 3, 0, 4, 0,
5, 0, 255, 255, 45, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 115, 112,
101, 99, 117, 108, 97, 114,
0, 171, 171, 171, 34, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 119, 111,
114, 108, 100, 78, 111, 114,
109, 97, 108, 0, 12, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 122, 101,
114, 111, 76, 0, 171, 171,
23, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
164, 2, 0, 0, 175, 2,
0, 0, 188, 2, 0, 0,
1, 0, 0, 0, 204, 2,
0, 0, 0, 0, 0, 0,
216, 2, 0, 0, 240, 2,
0, 0, 1, 0, 0, 0,
0, 3, 0, 0, 12, 3,
0, 0, 21, 3, 0, 0,
28, 3, 0, 0, 1, 0,
0, 0, 44, 3, 0, 0,
56, 3, 0, 0, 21, 3,
0, 0, 28, 3, 0, 0,
1, 0, 0, 0, 68, 3,
0, 0, 0, 0, 0, 0,
21, 3, 0, 0, 28, 3,
0, 0, 1, 0, 0, 0,
80, 3, 0, 0, 0, 0,
0, 0, 92, 3, 0, 0,
100, 3, 0, 0, 1, 0,
0, 0, 116, 3, 0, 0,
0, 0, 0, 0, 128, 3,
0, 0, 100, 3, 0, 0,
3, 0, 0, 0, 136, 3,
0, 0, 0, 0, 0, 0,
172, 3, 0, 0, 100, 3,
0, 0, 3, 0, 0, 0,
180, 3, 0, 0, 0, 0,
0, 0, 216, 3, 0, 0,
228, 3, 0, 0, 3, 0,
0, 0, 244, 3, 0, 0,
216, 2, 0, 0, 24, 4,
0, 0, 116, 4, 0, 0,
4, 0, 0, 0, 132, 4,
0, 0, 0, 0, 0, 0,
180, 4, 0, 0, 212, 4,
0, 0, 2, 0, 0, 0,
228, 4, 0, 0, 0, 0,
0, 0, 252, 4, 0, 0,
100, 3, 0, 0, 1, 0,
0, 0, 8, 5, 0, 0,
0, 0, 0, 0, 20, 5,
0, 0, 100, 3, 0, 0,
1, 0, 0, 0, 32, 5,
0, 0, 0, 0, 0, 0,
44, 5, 0, 0, 100, 3,
0, 0, 1, 0, 0, 0,
52, 5, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
14, 0, 15, 160, 0, 0,
128, 63, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
7, 176, 31, 0, 0, 2,
0, 0, 0, 128, 1, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 2, 0,
7, 176, 31, 0, 0, 2,
0, 0, 0, 128, 3, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 144, 0, 8,
15, 160, 66, 0, 0, 3,
0, 0, 15, 128, 0, 0,
228, 176, 0, 8, 228, 160,
2, 0, 0, 3, 1, 0,
7, 128, 1, 0, 228, 177,
12, 0, 228, 160, 8, 0,
0, 3, 1, 0, 8, 128,
1, 0, 228, 128, 1, 0,
228, 128, 7, 0, 0, 2,
1, 0, 8, 128, 1, 0,
255, 128, 4, 0, 0, 4,
2, 0, 7, 128, 1, 0,
228, 128, 1, 0, 255, 128,
3, 0, 228, 161, 36, 0,
0, 2, 3, 0, 7, 128,
2, 0, 228, 128, 36, 0,
0, 2, 2, 0, 7, 128,
2, 0, 228, 176, 8, 0,
0, 3, 3, 0, 1, 128,
3, 0, 228, 128, 2, 0,
228, 128, 4, 0, 0, 4,
4, 0, 7, 128, 1, 0,
228, 128, 1, 0, 255, 128,
4, 0, 228, 161, 4, 0,
0, 4, 1, 0, 7, 128,
1, 0, 228, 128, 1, 0,
255, 128, 5, 0, 228, 161,
36, 0, 0, 2, 5, 0,
7, 128, 1, 0, 228, 128,
8, 0, 0, 3, 3, 0,
4, 128, 5, 0, 228, 128,
2, 0, 228, 128, 36, 0,
0, 2, 1, 0, 7, 128,
4, 0, 228, 128, 8, 0,
0, 3, 3, 0, 2, 128,
1, 0, 228, 128, 2, 0,
228, 128, 8, 0, 0, 3,
1, 0, 1, 128, 3, 0,
228, 161, 2, 0, 228, 128,
8, 0, 0, 3, 1, 0,
2, 128, 4, 0, 228, 161,
2, 0, 228, 128, 8, 0,
0, 3, 1, 0, 4, 128,
5, 0, 228, 161, 2, 0,
228, 128, 88, 0, 0, 4,
2, 0, 7, 128, 1, 0,
228, 128, 14, 0, 0, 160,
14, 0, 85, 160, 5, 0,
0, 3, 4, 0, 7, 128,
2, 0, 228, 128, 3, 0,
228, 128, 88, 0, 0, 4,
3, 0, 7, 128, 3, 0,
228, 128, 4, 0, 228, 128,
14, 0, 85, 160, 5, 0,
0, 3, 2, 0, 7, 128,
1, 0, 228, 128, 2, 0,
228, 128, 15, 0, 0, 2,
4, 0, 1, 128, 3, 0,
0, 128, 15, 0, 0, 2,
4, 0, 2, 128, 3, 0,
85, 128, 15, 0, 0, 2,
4, 0, 4, 128, 3, 0,
170, 128, 5, 0, 0, 3,
3, 0, 7, 128, 4, 0,
228, 128, 2, 0, 255, 160,
14, 0, 0, 2, 4, 0,
1, 128, 3, 0, 0, 128,
14, 0, 0, 2, 4, 0,
2, 128, 3, 0, 85, 128,
14, 0, 0, 2, 4, 0,
4, 128, 3, 0, 170, 128,
5, 0, 0, 3, 1, 0,
7, 128, 1, 0, 228, 128,
4, 0, 228, 128, 5, 0,
0, 3, 3, 0, 7, 128,
1, 0, 85, 128, 10, 0,
228, 160, 4, 0, 0, 4,
3, 0, 7, 128, 1, 0,
0, 128, 9, 0, 228, 160,
3, 0, 228, 128, 4, 0,
0, 4, 1, 0, 7, 128,
1, 0, 170, 128, 11, 0,
228, 160, 3, 0, 228, 128,
5, 0, 0, 3, 1, 0,
7, 128, 1, 0, 228, 128,
2, 0, 228, 160, 5, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 3, 0,
228, 176, 5, 0, 0, 3,
1, 0, 7, 128, 0, 0,
255, 128, 1, 0, 228, 128,
5, 0, 0, 3, 3, 0,
7, 128, 2, 0, 85, 128,
7, 0, 228, 160, 4, 0,
0, 4, 3, 0, 7, 128,
2, 0, 0, 128, 6, 0,
228, 160, 3, 0, 228, 128,
4, 0, 0, 4, 2, 0,
7, 128, 2, 0, 170, 128,
8, 0, 228, 160, 3, 0,
228, 128, 1, 0, 0, 2,
3, 0, 7, 128, 0, 0,
228, 160, 4, 0, 0, 4,
2, 0, 7, 128, 2, 0,
228, 128, 3, 0, 228, 128,
1, 0, 228, 160, 4, 0,
0, 4, 1, 0, 7, 128,
0, 0, 228, 128, 2, 0,
228, 128, 1, 0, 228, 128,
4, 0, 0, 4, 2, 0,
7, 128, 13, 0, 228, 160,
0, 0, 255, 128, 1, 0,
228, 129, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
255, 176, 2, 0, 228, 128,
1, 0, 228, 128, 1, 0,
0, 2, 0, 8, 15, 128,
0, 0, 228, 128, 255, 255,
0, 0, 83, 72, 68, 82,
104, 6, 0, 0, 64, 0,
0, 0, 154, 1, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
14, 0, 0, 0, 90, 0,
0, 3, 0, 96, 16, 0,
0, 0, 0, 0, 88, 24,
0, 4, 0, 112, 16, 0,
0, 0, 0, 0, 85, 85,
0, 0, 98, 16, 0, 3,
50, 16, 16, 0, 0, 0,
0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 1, 0,
0, 0, 98, 16, 0, 3,
114, 16, 16, 0, 2, 0,
0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 3, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 104, 0, 0, 2,
4, 0, 0, 0, 0, 0,
0, 9, 114, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 128, 65, 0, 0, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
12, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 11, 114, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 130, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
16, 0, 0, 7, 130, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 130, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 1, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 1, 0, 0, 0,
246, 15, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
1, 0, 0, 0, 70, 18,
16, 0, 2, 0, 0, 0,
70, 18, 16, 0, 2, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
1, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
2, 0, 0, 0, 246, 15,
16, 0, 1, 0, 0, 0,
70, 18, 16, 0, 2, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 3, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 246, 15, 16, 0,
0, 0, 0, 0, 70, 130,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 4, 0,
0, 0, 50, 0, 0, 11,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 3, 0, 0, 0,
70, 2, 16, 0, 3, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
3, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 3, 0,
0, 0, 16, 0, 0, 7,
34, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
3, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
16, 0, 0, 7, 130, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 68, 0,
0, 5, 130, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 16, 0,
0, 7, 66, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 2, 0,
0, 0, 52, 0, 0, 10,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
16, 0, 0, 9, 18, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
16, 0, 0, 9, 34, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
16, 0, 0, 9, 66, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
29, 0, 0, 10, 114, 0,
16, 0, 2, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 10, 114, 0, 16, 0,
2, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
0, 0, 56, 0, 0, 7,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 2, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 2, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
2, 0, 0, 0, 47, 0,
0, 5, 114, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 246, 143, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 25, 0, 0, 5,
114, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
114, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
10, 0, 0, 0, 50, 0,
0, 10, 178, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 136, 32, 0, 0, 0,
0, 0, 9, 0, 0, 0,
70, 8, 16, 0, 1, 0,
0, 0, 50, 0, 0, 10,
114, 0, 16, 0, 0, 0,
0, 0, 166, 10, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
11, 0, 0, 0, 70, 3,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 69, 0, 0, 9,
242, 0, 16, 0, 1, 0,
0, 0, 70, 16, 16, 0,
0, 0, 0, 0, 70, 126,
16, 0, 0, 0, 0, 0,
0, 96, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
242, 0, 16, 0, 1, 0,
0, 0, 70, 14, 16, 0,
1, 0, 0, 0, 70, 30,
16, 0, 3, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 246, 15, 16, 0,
1, 0, 0, 0, 56, 0,
0, 8, 114, 0, 16, 0,
3, 0, 0, 0, 86, 5,
16, 0, 2, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 7, 0, 0, 0,
50, 0, 0, 10, 178, 0,
16, 0, 2, 0, 0, 0,
6, 0, 16, 0, 2, 0,
0, 0, 70, 136, 32, 0,
0, 0, 0, 0, 6, 0,
0, 0, 70, 8, 16, 0,
3, 0, 0, 0, 50, 0,
0, 10, 114, 0, 16, 0,
2, 0, 0, 0, 166, 10,
16, 0, 2, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 8, 0, 0, 0,
70, 3, 16, 0, 2, 0,
0, 0, 50, 0, 0, 11,
114, 0, 16, 0, 2, 0,
0, 0, 70, 2, 16, 0,
2, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 50, 0,
0, 9, 114, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 2, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 50, 0,
0, 11, 114, 0, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
13, 0, 0, 0, 246, 15,
16, 0, 1, 0, 0, 0,
70, 2, 16, 128, 65, 0,
0, 0, 0, 0, 0, 0,
50, 0, 0, 9, 114, 32,
16, 0, 0, 0, 0, 0,
246, 31, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 130, 32,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 1, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 120, 0,
0, 0, 4, 0, 0, 0,
8, 0, 0, 0, 104, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
3, 3, 0, 0, 104, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
15, 15, 0, 0, 104, 0,
0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
7, 7, 0, 0, 113, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 3, 0, 0, 0,
15, 15, 0, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 67, 79, 76, 79, 82,
0, 171, 79, 83, 71, 78,
44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 84, 97, 114,
103, 101, 116, 0, 171, 171
};

View File

@@ -0,0 +1,292 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float w
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 13 1 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
dcl t2.xy // pin<8,9>
dcl_2d s0
#line 514 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
texld r0, t2, s0
mul r0, r0, t0 // ::color<0,1,2,3>
#line 20 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r1.xyz, c0, r0.w, -r0
mad r0.xyz, t1.w, r1, r0 // ApplyFog::color<0,1,2>
mov oC0, r0 // ::PSBasicTx<0,1,2,3>
// approximately 5 instruction slots used (1 texture, 4 arithmetic)
ps_4_0
dcl_constantbuffer CB0[14], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.w
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, v0.xyzw
mad r1.xyz, cb0[13].xyzx, r0.wwww, -r0.xyzx
mad o0.xyz, v1.wwww, r1.xyzx, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicTx[] =
{
68, 88, 66, 67, 249, 1,
249, 65, 121, 225, 61, 207,
49, 20, 67, 92, 169, 182,
37, 234, 1, 0, 0, 0,
24, 5, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
96, 3, 0, 0, 124, 4,
0, 0, 228, 4, 0, 0,
65, 111, 110, 57, 40, 3,
0, 0, 40, 3, 0, 0,
0, 2, 255, 255, 244, 2,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 13, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
153, 0, 68, 66, 85, 71,
40, 0, 0, 0, 56, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 188, 0,
0, 0, 9, 0, 0, 0,
196, 0, 0, 0, 4, 0,
0, 0, 232, 1, 0, 0,
12, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 67, 58, 92, 85,
115, 101, 114, 115, 92, 67,
104, 117, 99, 107, 87, 92,
68, 101, 115, 107, 116, 111,
112, 92, 68, 51, 68, 49,
49, 32, 80, 114, 111, 106,
101, 99, 116, 115, 92, 68,
105, 114, 101, 99, 116, 88,
84, 75, 92, 83, 114, 99,
92, 83, 104, 97, 100, 101,
114, 115, 92, 67, 111, 109,
109, 111, 110, 46, 102, 120,
104, 0, 40, 0, 0, 0,
116, 0, 0, 0, 0, 0,
255, 255, 108, 2, 0, 0,
0, 0, 255, 255, 120, 2,
0, 0, 0, 0, 255, 255,
132, 2, 0, 0, 0, 0,
255, 255, 144, 2, 0, 0,
2, 2, 0, 0, 156, 2,
0, 0, 2, 2, 0, 0,
172, 2, 0, 0, 20, 0,
1, 0, 188, 2, 0, 0,
20, 0, 1, 0, 208, 2,
0, 0, 20, 0, 1, 0,
228, 2, 0, 0, 80, 83,
66, 97, 115, 105, 99, 84,
120, 0, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 8, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 65, 112, 112, 108,
121, 70, 111, 103, 0, 99,
111, 108, 111, 114, 0, 171,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 7, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 5, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 112, 105,
110, 0, 68, 105, 102, 102,
117, 115, 101, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 84, 101, 120, 67, 111,
111, 114, 100, 0, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 112, 1,
0, 0, 68, 1, 0, 0,
120, 1, 0, 0, 68, 1,
0, 0, 129, 1, 0, 0,
140, 1, 0, 0, 5, 0,
0, 0, 1, 0, 10, 0,
1, 0, 3, 0, 156, 1,
0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 1, 0, 0, 0,
4, 0, 5, 0, 6, 0,
7, 0, 2, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 0, 0, 0, 0,
12, 1, 0, 0, 24, 1,
0, 0, 1, 0, 0, 0,
40, 1, 0, 0, 52, 1,
0, 0, 61, 1, 0, 0,
68, 1, 0, 0, 1, 0,
0, 0, 84, 1, 0, 0,
0, 0, 0, 0, 61, 1,
0, 0, 68, 1, 0, 0,
1, 0, 0, 0, 96, 1,
0, 0, 12, 1, 0, 0,
108, 1, 0, 0, 180, 1,
0, 0, 3, 0, 0, 0,
196, 1, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 1, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 2, 0,
3, 176, 31, 0, 0, 2,
0, 0, 0, 144, 0, 8,
15, 160, 66, 0, 0, 3,
0, 0, 15, 128, 2, 0,
228, 176, 0, 8, 228, 160,
5, 0, 0, 3, 0, 0,
15, 128, 0, 0, 228, 128,
0, 0, 228, 176, 4, 0,
0, 4, 1, 0, 7, 128,
0, 0, 228, 160, 0, 0,
255, 128, 0, 0, 228, 129,
4, 0, 0, 4, 0, 0,
7, 128, 1, 0, 255, 176,
1, 0, 228, 128, 0, 0,
228, 128, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 128, 255, 255, 0, 0,
83, 72, 68, 82, 20, 1,
0, 0, 64, 0, 0, 0,
69, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 90, 0, 0, 3,
0, 96, 16, 0, 0, 0,
0, 0, 88, 24, 0, 4,
0, 112, 16, 0, 0, 0,
0, 0, 85, 85, 0, 0,
98, 16, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
98, 16, 0, 3, 130, 16,
16, 0, 1, 0, 0, 0,
98, 16, 0, 3, 50, 16,
16, 0, 2, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
104, 0, 0, 2, 2, 0,
0, 0, 69, 0, 0, 9,
242, 0, 16, 0, 0, 0,
0, 0, 70, 16, 16, 0,
2, 0, 0, 0, 70, 126,
16, 0, 0, 0, 0, 0,
0, 96, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
242, 0, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 13, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 128,
65, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 9,
114, 32, 16, 0, 0, 0,
0, 0, 246, 31, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 54, 0, 0, 5,
130, 32, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
96, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
80, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 8, 0, 0,
86, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 3, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,206 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1.xy // pin<4,5>
dcl_2d s0
#line 525 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
texld r0, t1, s0
mul r0, r0, t0 // ::PSBasicTxNoFog<0,1,2,3>
mov oC0, r0 // ::PSBasicTxNoFog<0,1,2,3>
// approximately 3 instruction slots used (1 texture, 2 arithmetic)
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyzw, r0.xyzw, v0.xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicTxNoFog[] =
{
68, 88, 66, 67, 77, 0,
71, 176, 20, 96, 134, 84,
154, 61, 13, 233, 166, 152,
82, 114, 1, 0, 0, 0,
128, 3, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
96, 2, 0, 0, 252, 2,
0, 0, 76, 3, 0, 0,
65, 111, 110, 57, 40, 2,
0, 0, 40, 2, 0, 0,
0, 2, 255, 255, 0, 2,
0, 0, 40, 0, 0, 0,
0, 0, 40, 0, 0, 0,
40, 0, 0, 0, 40, 0,
1, 0, 36, 0, 0, 0,
40, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
105, 0, 68, 66, 85, 71,
40, 0, 0, 0, 120, 1,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 116, 0,
0, 0, 6, 0, 0, 0,
120, 0, 0, 0, 2, 0,
0, 0, 80, 1, 0, 0,
168, 0, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 40, 0, 0, 0,
0, 0, 255, 255, 172, 1,
0, 0, 0, 0, 255, 255,
184, 1, 0, 0, 0, 0,
255, 255, 196, 1, 0, 0,
13, 2, 0, 0, 208, 1,
0, 0, 13, 2, 0, 0,
224, 1, 0, 0, 13, 2,
0, 0, 240, 1, 0, 0,
80, 83, 66, 97, 115, 105,
99, 84, 120, 78, 111, 70,
111, 103, 0, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 5, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 112, 105, 110, 0,
68, 105, 102, 102, 117, 115,
101, 0, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
84, 101, 120, 67, 111, 111,
114, 100, 0, 171, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 228, 0,
0, 0, 236, 0, 0, 0,
252, 0, 0, 0, 8, 1,
0, 0, 5, 0, 0, 0,
1, 0, 6, 0, 1, 0,
2, 0, 24, 1, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
1, 0, 0, 0, 4, 0,
5, 0, 255, 255, 255, 255,
0, 0, 0, 0, 168, 0,
0, 0, 184, 0, 0, 0,
2, 0, 0, 0, 200, 0,
0, 0, 168, 0, 0, 0,
224, 0, 0, 0, 40, 1,
0, 0, 2, 0, 0, 0,
56, 1, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 31, 0, 0, 2,
0, 0, 0, 128, 1, 0,
3, 176, 31, 0, 0, 2,
0, 0, 0, 144, 0, 8,
15, 160, 66, 0, 0, 3,
0, 0, 15, 128, 1, 0,
228, 176, 0, 8, 228, 160,
5, 0, 0, 3, 0, 0,
15, 128, 0, 0, 228, 128,
0, 0, 228, 176, 1, 0,
0, 2, 0, 8, 15, 128,
0, 0, 228, 128, 255, 255,
0, 0, 83, 72, 68, 82,
148, 0, 0, 0, 64, 0,
0, 0, 37, 0, 0, 0,
90, 0, 0, 3, 0, 96,
16, 0, 0, 0, 0, 0,
88, 24, 0, 4, 0, 112,
16, 0, 0, 0, 0, 0,
85, 85, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 98, 16,
0, 3, 50, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 104, 0,
0, 2, 1, 0, 0, 0,
69, 0, 0, 9, 242, 0,
16, 0, 0, 0, 0, 0,
70, 16, 16, 0, 1, 0,
0, 0, 70, 126, 16, 0,
0, 0, 0, 0, 0, 96,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 242, 32,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
72, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
62, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 3, 3, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,243 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 13 1 ( FLT, FLT, FLT, FLT)
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov r0, t0 // pin<0,1,2,3>
mad r0.xyz, t1, r0.w, r0 // AddSpecular::color<0,1,2>
#line 20
mad r1.xyz, c0, t0.w, -r0
mad r0.xyz, t1.w, r1, r0 // ApplyFog::color<0,1,2>
mov r0.w, t0.w
mov oC0, r0 // ::PSBasicVertexLighting<0,1,2,3>
// approximately 6 instruction slots used
ps_4_0
dcl_constantbuffer CB0[14], immediateIndexed
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xyzw
dcl_output o0.xyzw
dcl_temps 2
mad r0.xyz, v1.xyzx, v0.wwww, v0.xyzx
mad r1.xyz, cb0[13].xyzx, v0.wwww, -r0.xyzx
mad o0.xyz, v1.wwww, r1.xyzx, r0.xyzx
mov o0.w, v0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicVertexLighting[] =
{
68, 88, 66, 67, 87, 2,
149, 25, 198, 64, 161, 184,
94, 133, 3, 23, 104, 88,
205, 215, 1, 0, 0, 0,
68, 4, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
240, 2, 0, 0, 200, 3,
0, 0, 16, 4, 0, 0,
65, 111, 110, 57, 184, 2,
0, 0, 184, 2, 0, 0,
0, 2, 255, 255, 136, 2,
0, 0, 48, 0, 0, 0,
1, 0, 36, 0, 0, 0,
48, 0, 0, 0, 48, 0,
0, 0, 36, 0, 0, 0,
48, 0, 0, 0, 13, 0,
1, 0, 0, 0, 0, 0,
0, 0, 0, 2, 255, 255,
254, 255, 129, 0, 68, 66,
85, 71, 40, 0, 0, 0,
216, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
112, 0, 0, 0, 8, 0,
0, 0, 116, 0, 0, 0,
4, 0, 0, 0, 136, 1,
0, 0, 180, 0, 0, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
40, 0, 0, 0, 0, 0,
255, 255, 12, 2, 0, 0,
0, 0, 255, 255, 24, 2,
0, 0, 26, 0, 0, 0,
36, 2, 0, 0, 26, 0,
0, 0, 48, 2, 0, 0,
20, 0, 0, 0, 68, 2,
0, 0, 20, 0, 0, 0,
88, 2, 0, 0, 20, 0,
0, 0, 108, 2, 0, 0,
20, 0, 0, 0, 120, 2,
0, 0, 80, 83, 66, 97,
115, 105, 99, 86, 101, 114,
116, 101, 120, 76, 105, 103,
104, 116, 105, 110, 103, 0,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
7, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
65, 112, 112, 108, 121, 70,
111, 103, 0, 99, 111, 108,
111, 114, 0, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 5, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 65, 100, 100, 83,
112, 101, 99, 117, 108, 97,
114, 0, 3, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 112, 105, 110, 0,
68, 105, 102, 102, 117, 115,
101, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 171,
171, 171, 48, 1, 0, 0,
248, 0, 0, 0, 56, 1,
0, 0, 248, 0, 0, 0,
5, 0, 0, 0, 1, 0,
8, 0, 1, 0, 2, 0,
68, 1, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 1, 0,
0, 0, 4, 0, 5, 0,
6, 0, 7, 0, 2, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 0, 0,
0, 0, 180, 0, 0, 0,
204, 0, 0, 0, 1, 0,
0, 0, 220, 0, 0, 0,
232, 0, 0, 0, 241, 0,
0, 0, 248, 0, 0, 0,
1, 0, 0, 0, 8, 1,
0, 0, 20, 1, 0, 0,
241, 0, 0, 0, 248, 0,
0, 0, 1, 0, 0, 0,
32, 1, 0, 0, 180, 0,
0, 0, 44, 1, 0, 0,
84, 1, 0, 0, 3, 0,
0, 0, 100, 1, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 31, 0,
0, 2, 0, 0, 0, 128,
0, 0, 15, 176, 31, 0,
0, 2, 0, 0, 0, 128,
1, 0, 15, 176, 1, 0,
0, 2, 0, 0, 15, 128,
0, 0, 228, 176, 4, 0,
0, 4, 0, 0, 7, 128,
1, 0, 228, 176, 0, 0,
255, 128, 0, 0, 228, 128,
4, 0, 0, 4, 1, 0,
7, 128, 0, 0, 228, 160,
0, 0, 255, 176, 0, 0,
228, 129, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
255, 176, 1, 0, 228, 128,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 128,
0, 0, 255, 176, 1, 0,
0, 2, 0, 8, 15, 128,
0, 0, 228, 128, 255, 255,
0, 0, 83, 72, 68, 82,
208, 0, 0, 0, 64, 0,
0, 0, 52, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
14, 0, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 104, 0,
0, 2, 2, 0, 0, 0,
50, 0, 0, 9, 114, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 246, 31, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 0, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 13, 0, 0, 0,
246, 31, 16, 0, 0, 0,
0, 0, 70, 2, 16, 128,
65, 0, 0, 0, 0, 0,
0, 0, 50, 0, 0, 9,
114, 32, 16, 0, 0, 0,
0, 0, 246, 31, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 54, 0, 0, 5,
130, 32, 16, 0, 0, 0,
0, 0, 58, 16, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
64, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
56, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 15, 0, 0,
67, 79, 76, 79, 82, 0,
171, 171, 79, 83, 71, 78,
44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 84, 97, 114,
103, 101, 116, 0, 171, 171
};

View File

@@ -0,0 +1,194 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov r0, t0 // pin<0,1,2,3>
mad r0.xyz, t1, r0.w, r0 // AddSpecular::color<0,1,2>
mov r0.w, t0.w
mov oC0, r0 // ::PSBasicVertexLightingNoFog<0,1,2,3>
// approximately 4 instruction slots used
ps_4_0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xyz
dcl_output o0.xyzw
mad o0.xyz, v1.xyzx, v0.wwww, v0.xyzx
mov o0.w, v0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicVertexLightingNoFog[] =
{
68, 88, 66, 67, 130, 92,
190, 251, 92, 163, 242, 235,
36, 95, 152, 62, 166, 5,
73, 116, 1, 0, 0, 0,
116, 3, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
136, 2, 0, 0, 248, 2,
0, 0, 64, 3, 0, 0,
65, 111, 110, 57, 80, 2,
0, 0, 80, 2, 0, 0,
0, 2, 255, 255, 44, 2,
0, 0, 36, 0, 0, 0,
0, 0, 36, 0, 0, 0,
36, 0, 0, 0, 36, 0,
0, 0, 36, 0, 0, 0,
36, 0, 0, 2, 255, 255,
254, 255, 116, 0, 68, 66,
85, 71, 40, 0, 0, 0,
164, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
112, 0, 0, 0, 6, 0,
0, 0, 116, 0, 0, 0,
3, 0, 0, 0, 104, 1,
0, 0, 164, 0, 0, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
40, 0, 0, 0, 0, 0,
255, 255, 216, 1, 0, 0,
0, 0, 255, 255, 228, 1,
0, 0, 26, 0, 0, 0,
240, 1, 0, 0, 26, 0,
0, 0, 252, 1, 0, 0,
26, 0, 0, 0, 16, 2,
0, 0, 26, 0, 0, 0,
28, 2, 0, 0, 80, 83,
66, 97, 115, 105, 99, 86,
101, 114, 116, 101, 120, 76,
105, 103, 104, 116, 105, 110,
103, 78, 111, 70, 111, 103,
0, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
65, 100, 100, 83, 112, 101,
99, 117, 108, 97, 114, 0,
99, 111, 108, 111, 114, 0,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
112, 105, 110, 0, 68, 105,
102, 102, 117, 115, 101, 0,
83, 112, 101, 99, 117, 108,
97, 114, 0, 171, 171, 171,
16, 1, 0, 0, 240, 0,
0, 0, 24, 1, 0, 0,
240, 0, 0, 0, 5, 0,
0, 0, 1, 0, 8, 0,
1, 0, 2, 0, 36, 1,
0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 1, 0, 0, 0,
4, 0, 5, 0, 6, 0,
7, 0, 2, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 0, 0, 0, 0,
164, 0, 0, 0, 192, 0,
0, 0, 1, 0, 0, 0,
208, 0, 0, 0, 220, 0,
0, 0, 232, 0, 0, 0,
240, 0, 0, 0, 1, 0,
0, 0, 0, 1, 0, 0,
164, 0, 0, 0, 12, 1,
0, 0, 52, 1, 0, 0,
3, 0, 0, 0, 68, 1,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 15, 176,
31, 0, 0, 2, 0, 0,
0, 128, 1, 0, 15, 176,
1, 0, 0, 2, 0, 0,
15, 128, 0, 0, 228, 176,
4, 0, 0, 4, 0, 0,
7, 128, 1, 0, 228, 176,
0, 0, 255, 128, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 128, 0, 0,
255, 176, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 128, 255, 255, 0, 0,
83, 72, 68, 82, 104, 0,
0, 0, 64, 0, 0, 0,
26, 0, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 98, 16,
0, 3, 114, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 50, 0,
0, 9, 114, 32, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
246, 31, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
0, 0, 0, 0, 54, 0,
0, 5, 130, 32, 16, 0,
0, 0, 0, 0, 58, 16,
16, 0, 0, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 64, 0, 0, 0,
2, 0, 0, 0, 8, 0,
0, 0, 56, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 56, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 7,
0, 0, 67, 79, 76, 79,
82, 0, 171, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,316 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 13 1 ( FLT, FLT, FLT, FLT)
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
dcl t2.xy // pin<8,9>
dcl_2d s0
#line 555 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
texld r0, t2, s0
mul r0, r0, t0 // ::color<0,1,2,3>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r1.xyz, t1, r0.w, r0 // AddSpecular::color<0,1,2>
#line 20
mad r2.xyz, c0, r0.w, -r1
mad r0.xyz, t1.w, r2, r1 // ApplyFog::color<0,1,2>
mov oC0, r0 // ::PSBasicVertexLightingTx<0,1,2,3>
// approximately 6 instruction slots used (1 texture, 5 arithmetic)
ps_4_0
dcl_constantbuffer CB0[14], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, v0.xyzw
mad r0.xyz, v1.xyzx, r0.wwww, r0.xyzx
mad r1.xyz, cb0[13].xyzx, r0.wwww, -r0.xyzx
mov o0.w, r0.w
mad o0.xyz, v1.wwww, r1.xyzx, r0.xyzx
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicVertexLightingTx[] =
{
68, 88, 66, 67, 144, 91,
71, 86, 138, 73, 249, 111,
252, 41, 40, 95, 152, 204,
81, 168, 1, 0, 0, 0,
144, 5, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
180, 3, 0, 0, 244, 4,
0, 0, 92, 5, 0, 0,
65, 111, 110, 57, 124, 3,
0, 0, 124, 3, 0, 0,
0, 2, 255, 255, 72, 3,
0, 0, 52, 0, 0, 0,
1, 0, 40, 0, 0, 0,
52, 0, 0, 0, 52, 0,
1, 0, 36, 0, 0, 0,
52, 0, 0, 0, 0, 0,
0, 0, 13, 0, 1, 0,
0, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
169, 0, 68, 66, 85, 71,
40, 0, 0, 0, 120, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 188, 0,
0, 0, 10, 0, 0, 0,
196, 0, 0, 0, 5, 0,
0, 0, 20, 2, 0, 0,
20, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 67, 58, 92, 85,
115, 101, 114, 115, 92, 67,
104, 117, 99, 107, 87, 92,
68, 101, 115, 107, 116, 111,
112, 92, 68, 51, 68, 49,
49, 32, 80, 114, 111, 106,
101, 99, 116, 115, 92, 68,
105, 114, 101, 99, 116, 88,
84, 75, 92, 83, 114, 99,
92, 83, 104, 97, 100, 101,
114, 115, 92, 67, 111, 109,
109, 111, 110, 46, 102, 120,
104, 0, 40, 0, 0, 0,
116, 0, 0, 0, 0, 0,
255, 255, 172, 2, 0, 0,
0, 0, 255, 255, 184, 2,
0, 0, 0, 0, 255, 255,
196, 2, 0, 0, 0, 0,
255, 255, 208, 2, 0, 0,
43, 2, 0, 0, 220, 2,
0, 0, 43, 2, 0, 0,
236, 2, 0, 0, 26, 0,
1, 0, 252, 2, 0, 0,
20, 0, 1, 0, 16, 3,
0, 0, 20, 0, 1, 0,
36, 3, 0, 0, 20, 0,
1, 0, 56, 3, 0, 0,
80, 83, 66, 97, 115, 105,
99, 86, 101, 114, 116, 101,
120, 76, 105, 103, 104, 116,
105, 110, 103, 84, 120, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 9, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 65, 112,
112, 108, 121, 70, 111, 103,
0, 99, 111, 108, 111, 114,
0, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
65, 100, 100, 83, 112, 101,
99, 117, 108, 97, 114, 0,
6, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
5, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
112, 105, 110, 0, 68, 105,
102, 102, 117, 115, 101, 0,
83, 112, 101, 99, 117, 108,
97, 114, 0, 84, 101, 120,
67, 111, 111, 114, 100, 0,
171, 171, 1, 0, 3, 0,
1, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0,
156, 1, 0, 0, 88, 1,
0, 0, 164, 1, 0, 0,
88, 1, 0, 0, 173, 1,
0, 0, 184, 1, 0, 0,
5, 0, 0, 0, 1, 0,
10, 0, 1, 0, 3, 0,
200, 1, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 1, 0,
0, 0, 4, 0, 5, 0,
6, 0, 7, 0, 2, 0,
0, 0, 8, 0, 9, 0,
255, 255, 255, 255, 0, 0,
0, 0, 20, 1, 0, 0,
44, 1, 0, 0, 1, 0,
0, 0, 60, 1, 0, 0,
72, 1, 0, 0, 81, 1,
0, 0, 88, 1, 0, 0,
1, 0, 0, 0, 104, 1,
0, 0, 116, 1, 0, 0,
81, 1, 0, 0, 88, 1,
0, 0, 1, 0, 0, 0,
128, 1, 0, 0, 0, 0,
0, 0, 81, 1, 0, 0,
88, 1, 0, 0, 1, 0,
0, 0, 140, 1, 0, 0,
20, 1, 0, 0, 152, 1,
0, 0, 224, 1, 0, 0,
3, 0, 0, 0, 240, 1,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 15, 176,
31, 0, 0, 2, 0, 0,
0, 128, 1, 0, 15, 176,
31, 0, 0, 2, 0, 0,
0, 128, 2, 0, 3, 176,
31, 0, 0, 2, 0, 0,
0, 144, 0, 8, 15, 160,
66, 0, 0, 3, 0, 0,
15, 128, 2, 0, 228, 176,
0, 8, 228, 160, 5, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 0, 0,
228, 176, 4, 0, 0, 4,
1, 0, 7, 128, 1, 0,
228, 176, 0, 0, 255, 128,
0, 0, 228, 128, 4, 0,
0, 4, 2, 0, 7, 128,
0, 0, 228, 160, 0, 0,
255, 128, 1, 0, 228, 129,
4, 0, 0, 4, 0, 0,
7, 128, 1, 0, 255, 176,
2, 0, 228, 128, 1, 0,
228, 128, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 128, 255, 255, 0, 0,
83, 72, 68, 82, 56, 1,
0, 0, 64, 0, 0, 0,
78, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 90, 0, 0, 3,
0, 96, 16, 0, 0, 0,
0, 0, 88, 24, 0, 4,
0, 112, 16, 0, 0, 0,
0, 0, 85, 85, 0, 0,
98, 16, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
98, 16, 0, 3, 242, 16,
16, 0, 1, 0, 0, 0,
98, 16, 0, 3, 50, 16,
16, 0, 2, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
104, 0, 0, 2, 2, 0,
0, 0, 69, 0, 0, 9,
242, 0, 16, 0, 0, 0,
0, 0, 70, 16, 16, 0,
2, 0, 0, 0, 70, 126,
16, 0, 0, 0, 0, 0,
0, 96, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
242, 0, 16, 0, 0, 0,
0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
50, 0, 0, 9, 114, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 246, 15, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
50, 0, 0, 11, 114, 0,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 13, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 128,
65, 0, 0, 0, 0, 0,
0, 0, 54, 0, 0, 5,
130, 32, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 50, 0,
0, 9, 114, 32, 16, 0,
0, 0, 0, 0, 246, 31,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
96, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
80, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 15, 0, 0,
86, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 3, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

View File

@@ -0,0 +1,269 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyz
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_0
dcl t0 // pin<0,1,2,3>
dcl t1 // pin<4,5,6,7>
dcl t2.xy // pin<8,9>
dcl_2d s0
#line 567 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
texld r0, t2, s0
mul r0, r0, t0 // ::color<0,1,2,3>
#line 26 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, t1, r0.w, r0 // AddSpecular::color<0,1,2>
mov oC0, r0 // ::PSBasicVertexLightingTxNoFog<0,1,2,3>
// approximately 4 instruction slots used (1 texture, 3 arithmetic)
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 1
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, v0.xyzw
mad o0.xyz, v1.xyzx, r0.wwww, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_PSBasicVertexLightingTxNoFog[] =
{
68, 88, 66, 67, 144, 52,
8, 138, 36, 226, 252, 120,
221, 28, 14, 241, 161, 5,
36, 235, 1, 0, 0, 0,
204, 4, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
80, 3, 0, 0, 48, 4,
0, 0, 152, 4, 0, 0,
65, 111, 110, 57, 24, 3,
0, 0, 24, 3, 0, 0,
0, 2, 255, 255, 240, 2,
0, 0, 40, 0, 0, 0,
0, 0, 40, 0, 0, 0,
40, 0, 0, 0, 40, 0,
1, 0, 36, 0, 0, 0,
40, 0, 0, 0, 0, 0,
0, 2, 255, 255, 254, 255,
157, 0, 68, 66, 85, 71,
40, 0, 0, 0, 72, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 188, 0,
0, 0, 8, 0, 0, 0,
196, 0, 0, 0, 4, 0,
0, 0, 248, 1, 0, 0,
4, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 67, 58, 92, 85,
115, 101, 114, 115, 92, 67,
104, 117, 99, 107, 87, 92,
68, 101, 115, 107, 116, 111,
112, 92, 68, 51, 68, 49,
49, 32, 80, 114, 111, 106,
101, 99, 116, 115, 92, 68,
105, 114, 101, 99, 116, 88,
84, 75, 92, 83, 114, 99,
92, 83, 104, 97, 100, 101,
114, 115, 92, 67, 111, 109,
109, 111, 110, 46, 102, 120,
104, 0, 40, 0, 0, 0,
116, 0, 0, 0, 0, 0,
255, 255, 124, 2, 0, 0,
0, 0, 255, 255, 136, 2,
0, 0, 0, 0, 255, 255,
148, 2, 0, 0, 0, 0,
255, 255, 160, 2, 0, 0,
55, 2, 0, 0, 172, 2,
0, 0, 55, 2, 0, 0,
188, 2, 0, 0, 26, 0,
1, 0, 204, 2, 0, 0,
26, 0, 1, 0, 224, 2,
0, 0, 80, 83, 66, 97,
115, 105, 99, 86, 101, 114,
116, 101, 120, 76, 105, 103,
104, 116, 105, 110, 103, 84,
120, 78, 111, 70, 111, 103,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 7, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 65, 100, 100, 83,
112, 101, 99, 117, 108, 97,
114, 0, 99, 111, 108, 111,
114, 0, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 6, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 5, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 112, 105, 110, 0,
68, 105, 102, 102, 117, 115,
101, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 84,
101, 120, 67, 111, 111, 114,
100, 0, 171, 171, 1, 0,
3, 0, 1, 0, 2, 0,
1, 0, 0, 0, 0, 0,
0, 0, 128, 1, 0, 0,
84, 1, 0, 0, 136, 1,
0, 0, 84, 1, 0, 0,
145, 1, 0, 0, 156, 1,
0, 0, 5, 0, 0, 0,
1, 0, 10, 0, 1, 0,
3, 0, 172, 1, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
1, 0, 0, 0, 4, 0,
5, 0, 6, 0, 7, 0,
2, 0, 0, 0, 8, 0,
9, 0, 255, 255, 255, 255,
0, 0, 0, 0, 4, 1,
0, 0, 36, 1, 0, 0,
1, 0, 0, 0, 52, 1,
0, 0, 64, 1, 0, 0,
76, 1, 0, 0, 84, 1,
0, 0, 1, 0, 0, 0,
100, 1, 0, 0, 0, 0,
0, 0, 76, 1, 0, 0,
84, 1, 0, 0, 1, 0,
0, 0, 112, 1, 0, 0,
4, 1, 0, 0, 124, 1,
0, 0, 196, 1, 0, 0,
3, 0, 0, 0, 212, 1,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 15, 176,
31, 0, 0, 2, 0, 0,
0, 128, 1, 0, 15, 176,
31, 0, 0, 2, 0, 0,
0, 128, 2, 0, 3, 176,
31, 0, 0, 2, 0, 0,
0, 144, 0, 8, 15, 160,
66, 0, 0, 3, 0, 0,
15, 128, 2, 0, 228, 176,
0, 8, 228, 160, 5, 0,
0, 3, 0, 0, 15, 128,
0, 0, 228, 128, 0, 0,
228, 176, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
228, 176, 0, 0, 255, 128,
0, 0, 228, 128, 1, 0,
0, 2, 0, 8, 15, 128,
0, 0, 228, 128, 255, 255,
0, 0, 83, 72, 68, 82,
216, 0, 0, 0, 64, 0,
0, 0, 54, 0, 0, 0,
90, 0, 0, 3, 0, 96,
16, 0, 0, 0, 0, 0,
88, 24, 0, 4, 0, 112,
16, 0, 0, 0, 0, 0,
85, 85, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 98, 16,
0, 3, 114, 16, 16, 0,
1, 0, 0, 0, 98, 16,
0, 3, 50, 16, 16, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 104, 0,
0, 2, 1, 0, 0, 0,
69, 0, 0, 9, 242, 0,
16, 0, 0, 0, 0, 0,
70, 16, 16, 0, 2, 0,
0, 0, 70, 126, 16, 0,
0, 0, 0, 0, 0, 96,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 242, 0,
16, 0, 0, 0, 0, 0,
70, 14, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 50, 0,
0, 9, 114, 32, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 54, 0,
0, 5, 130, 32, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 96, 0, 0, 0,
3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 80, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 7,
0, 0, 86, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 3, 3,
0, 0, 67, 79, 76, 79,
82, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 171,
79, 83, 71, 78, 44, 0,
0, 0, 1, 0, 0, 0,
8, 0, 0, 0, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 83, 86,
95, 84, 97, 114, 103, 101,
116, 0, 171, 171
};

View File

@@ -0,0 +1,347 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 14 1 ( FLT, FLT, FLT, FLT)
// c3 cb0 22 4 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c7, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 oPos.z, v0, c5 // ::VSBasic<10>
#line 14
dp4 r0.x, v0, c2
max r0.x, r0.x, c7.x
min oT1.w, r0.x, c7.y // ::VSBasic<7>
#line 49
dp4 r0.x, v0, c3 // ::vout<0>
dp4 r0.y, v0, c4 // ::vout<1>
dp4 r0.z, v0, c6 // ::vout<3>
#line 44 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasic<8,9>
mov oPos.w, r0.z // ::VSBasic<11>
#line 50 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov oT0, c1 // ::VSBasic<0,1,2,3>
mov oT1.xyz, c7.x // ::VSBasic<4,5,6>
// approximately 11 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
mov o0.xyzw, cb0[0].xyzw
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
mov o1.xyz, l(0,0,0,0)
dp4 o2.x, v0.xyzw, cb0[22].xyzw
dp4 o2.y, v0.xyzw, cb0[23].xyzw
dp4 o2.z, v0.xyzw, cb0[24].xyzw
dp4 o2.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasic[] =
{
68, 88, 66, 67, 187, 46,
150, 222, 6, 93, 199, 6,
161, 69, 70, 59, 161, 222,
52, 92, 1, 0, 0, 0,
36, 6, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
84, 4, 0, 0, 132, 5,
0, 0, 184, 5, 0, 0,
65, 111, 110, 57, 28, 4,
0, 0, 28, 4, 0, 0,
0, 2, 254, 255, 208, 3,
0, 0, 76, 0, 0, 0,
3, 0, 36, 0, 0, 0,
72, 0, 0, 0, 72, 0,
0, 0, 36, 0, 1, 0,
72, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 14, 0,
1, 0, 2, 0, 0, 0,
0, 0, 0, 0, 22, 0,
4, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
190, 0, 68, 66, 85, 71,
40, 0, 0, 0, 204, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 188, 0,
0, 0, 13, 0, 0, 0,
196, 0, 0, 0, 3, 0,
0, 0, 144, 2, 0, 0,
44, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 40, 0, 0, 0,
112, 0, 0, 0, 0, 0,
255, 255, 0, 3, 0, 0,
0, 0, 255, 255, 24, 3,
0, 0, 49, 0, 0, 0,
36, 3, 0, 0, 14, 0,
0, 0, 52, 3, 0, 0,
14, 0, 0, 0, 68, 3,
0, 0, 14, 0, 0, 0,
84, 3, 0, 0, 49, 0,
0, 0, 100, 3, 0, 0,
49, 0, 0, 0, 116, 3,
0, 0, 49, 0, 0, 0,
132, 3, 0, 0, 44, 0,
1, 0, 148, 3, 0, 0,
44, 0, 1, 0, 168, 3,
0, 0, 50, 0, 0, 0,
180, 3, 0, 0, 51, 0,
0, 0, 192, 3, 0, 0,
86, 83, 66, 97, 115, 105,
99, 0, 68, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 80,
111, 115, 105, 116, 105, 111,
110, 80, 83, 0, 52, 1,
0, 0, 60, 1, 0, 0,
76, 1, 0, 0, 60, 1,
0, 0, 85, 1, 0, 0,
60, 1, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 3, 0, 96, 1,
0, 0, 2, 0, 0, 0,
255, 255, 255, 255, 10, 0,
255, 255, 5, 0, 0, 0,
255, 255, 255, 255, 255, 255,
7, 0, 9, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 10, 0, 0, 0,
255, 255, 255, 255, 255, 255,
11, 0, 11, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 12, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171, 171, 171,
212, 1, 0, 0, 60, 1,
0, 0, 5, 0, 0, 0,
1, 0, 4, 0, 1, 0,
1, 0, 224, 1, 0, 0,
1, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
118, 111, 117, 116, 0, 80,
111, 115, 95, 112, 115, 0,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 70, 111,
103, 70, 97, 99, 116, 111,
114, 0, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 9, 2, 0, 0,
60, 1, 0, 0, 52, 1,
0, 0, 60, 1, 0, 0,
76, 1, 0, 0, 16, 2,
0, 0, 32, 2, 0, 0,
44, 2, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 4, 0, 60, 2,
0, 0, 6, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 7, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 8, 0, 0, 0,
255, 255, 255, 255, 3, 0,
255, 255, 0, 0, 0, 0,
44, 1, 0, 0, 120, 1,
0, 0, 6, 0, 0, 0,
136, 1, 0, 0, 44, 1,
0, 0, 208, 1, 0, 0,
232, 1, 0, 0, 1, 0,
0, 0, 248, 1, 0, 0,
0, 0, 0, 0, 4, 2,
0, 0, 92, 2, 0, 0,
3, 0, 0, 0, 108, 2,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
81, 0, 0, 5, 7, 0,
15, 160, 0, 0, 0, 0,
0, 0, 128, 63, 0, 0,
0, 0, 0, 0, 0, 0,
31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144,
9, 0, 0, 3, 0, 0,
4, 192, 0, 0, 228, 144,
5, 0, 228, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 2, 0,
228, 160, 11, 0, 0, 3,
0, 0, 1, 128, 0, 0,
0, 128, 7, 0, 0, 160,
10, 0, 0, 3, 1, 0,
8, 224, 0, 0, 0, 128,
7, 0, 85, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 3, 0,
228, 160, 9, 0, 0, 3,
0, 0, 2, 128, 0, 0,
228, 144, 4, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 128, 0, 0, 228, 144,
6, 0, 228, 160, 4, 0,
0, 4, 0, 0, 3, 192,
0, 0, 170, 128, 0, 0,
228, 160, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 192, 0, 0, 170, 128,
1, 0, 0, 2, 0, 0,
15, 224, 1, 0, 228, 160,
1, 0, 0, 2, 1, 0,
7, 224, 7, 0, 0, 160,
255, 255, 0, 0, 83, 72,
68, 82, 40, 1, 0, 0,
64, 0, 1, 0, 74, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 26, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 1, 0, 0, 0,
103, 0, 0, 4, 242, 32,
16, 0, 2, 0, 0, 0,
1, 0, 0, 0, 54, 0,
0, 6, 242, 32, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 32,
0, 8, 130, 32, 16, 0,
1, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 14, 0, 0, 0,
54, 0, 0, 8, 114, 32,
16, 0, 1, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 17, 0, 0, 8,
18, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
22, 0, 0, 0, 17, 0,
0, 8, 34, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 23, 0, 0, 0,
17, 0, 0, 8, 66, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 24, 0,
0, 0, 17, 0, 0, 8,
130, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
25, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
44, 0, 0, 0, 1, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
79, 83, 71, 78, 100, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 80, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
15, 0, 0, 0, 86, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 67, 79,
76, 79, 82, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 171, 171
};

Binary file not shown.

View File

@@ -0,0 +1,291 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// SV_Position 0 xyzw 1 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 22 4 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
dcl_texcoord v0 // vin<0,1,2,3>
#line 49 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 oPos.z, v0, c4 // ::VSBasicNoFog<6>
dp4 r0.x, v0, c2 // ::vout<0>
dp4 r0.y, v0, c3 // ::vout<1>
dp4 r0.z, v0, c5 // ::vout<3>
#line 56 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicNoFog<4,5>
mov oPos.w, r0.z // ::VSBasicNoFog<7>
#line 50 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mov oT0, c1 // ::VSBasicNoFog<0,1,2,3>
// approximately 7 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_output o0.xyzw
dcl_output_siv o1.xyzw, position
mov o0.xyzw, cb0[0].xyzw
dp4 o1.x, v0.xyzw, cb0[22].xyzw
dp4 o1.y, v0.xyzw, cb0[23].xyzw
dp4 o1.z, v0.xyzw, cb0[24].xyzw
dp4 o1.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicNoFog[] =
{
68, 88, 66, 67, 138, 195,
138, 85, 139, 196, 214, 225,
41, 15, 112, 116, 182, 5,
180, 159, 1, 0, 0, 0,
36, 5, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
184, 3, 0, 0, 156, 4,
0, 0, 208, 4, 0, 0,
65, 111, 110, 57, 128, 3,
0, 0, 128, 3, 0, 0,
0, 2, 254, 255, 64, 3,
0, 0, 64, 0, 0, 0,
2, 0, 36, 0, 0, 0,
60, 0, 0, 0, 60, 0,
0, 0, 36, 0, 1, 0,
60, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 22, 0,
4, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
175, 0, 68, 66, 85, 71,
40, 0, 0, 0, 144, 2,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 188, 0,
0, 0, 8, 0, 0, 0,
196, 0, 0, 0, 3, 0,
0, 0, 84, 2, 0, 0,
4, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 66,
97, 115, 105, 99, 69, 102,
102, 101, 99, 116, 46, 102,
120, 0, 40, 0, 0, 0,
112, 0, 0, 0, 0, 0,
255, 255, 196, 2, 0, 0,
49, 0, 0, 0, 208, 2,
0, 0, 49, 0, 0, 0,
224, 2, 0, 0, 49, 0,
0, 0, 240, 2, 0, 0,
49, 0, 0, 0, 0, 3,
0, 0, 56, 0, 1, 0,
16, 3, 0, 0, 56, 0,
1, 0, 36, 3, 0, 0,
50, 0, 0, 0, 48, 3,
0, 0, 86, 83, 66, 97,
115, 105, 99, 78, 111, 70,
111, 103, 0, 68, 105, 102,
102, 117, 115, 101, 0, 171,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
80, 111, 115, 105, 116, 105,
111, 110, 80, 83, 0, 171,
17, 1, 0, 0, 28, 1,
0, 0, 44, 1, 0, 0,
28, 1, 0, 0, 5, 0,
0, 0, 1, 0, 8, 0,
1, 0, 2, 0, 56, 1,
0, 0, 1, 0, 0, 0,
255, 255, 255, 255, 6, 0,
255, 255, 5, 0, 0, 0,
4, 0, 5, 0, 255, 255,
255, 255, 6, 0, 0, 0,
255, 255, 255, 255, 255, 255,
7, 0, 7, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171, 171, 171,
140, 1, 0, 0, 28, 1,
0, 0, 5, 0, 0, 0,
1, 0, 4, 0, 1, 0,
1, 0, 152, 1, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
118, 111, 117, 116, 0, 80,
111, 115, 95, 112, 115, 0,
83, 112, 101, 99, 117, 108,
97, 114, 0, 171, 171, 171,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 70, 111,
103, 70, 97, 99, 116, 111,
114, 0, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 193, 1, 0, 0,
28, 1, 0, 0, 17, 1,
0, 0, 28, 1, 0, 0,
200, 1, 0, 0, 212, 1,
0, 0, 228, 1, 0, 0,
240, 1, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 4, 0, 0, 2,
0, 0, 2, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 4, 0, 0, 0,
255, 255, 255, 255, 3, 0,
255, 255, 0, 0, 0, 0,
4, 1, 0, 0, 72, 1,
0, 0, 4, 0, 0, 0,
88, 1, 0, 0, 4, 1,
0, 0, 136, 1, 0, 0,
160, 1, 0, 0, 1, 0,
0, 0, 176, 1, 0, 0,
0, 0, 0, 0, 188, 1,
0, 0, 32, 2, 0, 0,
3, 0, 0, 0, 48, 2,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144,
9, 0, 0, 3, 0, 0,
4, 192, 0, 0, 228, 144,
4, 0, 228, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 2, 0,
228, 160, 9, 0, 0, 3,
0, 0, 2, 128, 0, 0,
228, 144, 3, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 128, 0, 0, 228, 144,
5, 0, 228, 160, 4, 0,
0, 4, 0, 0, 3, 192,
0, 0, 170, 128, 0, 0,
228, 160, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 192, 0, 0, 170, 128,
1, 0, 0, 2, 0, 0,
15, 224, 1, 0, 228, 160,
255, 255, 0, 0, 83, 72,
68, 82, 220, 0, 0, 0,
64, 0, 1, 0, 55, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 26, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
103, 0, 0, 4, 242, 32,
16, 0, 1, 0, 0, 0,
1, 0, 0, 0, 54, 0,
0, 6, 242, 32, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 0,
0, 8, 18, 32, 16, 0,
1, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 22, 0, 0, 0,
17, 0, 0, 8, 34, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 23, 0,
0, 0, 17, 0, 0, 8,
66, 32, 16, 0, 1, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
24, 0, 0, 0, 17, 0,
0, 8, 130, 32, 16, 0,
1, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 25, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 79, 83, 71, 78,
76, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
62, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
67, 79, 76, 79, 82, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
171, 171
};

View File

@@ -0,0 +1,783 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r0.x, v1, c12
dp3 r0.y, v1, c13
dp3 r0.z, v1, c14
nrm r1.xyz, r0 // ::worldNormal<0,1,2>
#line 36
dp3 r0.x, -c4, r1 // ::dotL<0>
#line 39
sge r0.y, r0.x, c19.x // ::zeroL<0>
mul r0.z, r0.x, r0.y // ::diffuse<0>
#line 46
mul r2.xyz, r0.z, c5
mov r3.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad oT0.xyz, r2, r3, c2 // ::VSBasicOneLight<0,1,2>
#line 57
dp4 r2.x, v0, c9 // ::pos_ws<0>
dp4 r2.y, v0, c10 // ::pos_ws<1>
dp4 r2.z, v0, c11 // ::pos_ws<2>
add r2.xyz, -r2, c7
nrm r3.xyz, r2 // ::eyeVector<0,1,2>
#line 33
add r2.xyz, r3, -c4
nrm r3.xyz, r2 // ::halfVectors<0,1,2>
#line 37
dp3 r0.z, r3, r1 // ::dotH<0>
#line 42
max r0.z, r0.z, c19.x
mul r0.y, r0.y, r0.z
pow r1.x, r0.y, c3.w
mul r0.x, r0.x, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLight<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLight<10>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.x
min oT1.w, r0.x, c19.y // ::VSBasicOneLight<7>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 264 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLight<8,9>
mov oPos.w, r0.z // ::VSBasicOneLight<11>
#line 46 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mov oT0.w, c1.w // ::VSBasicOneLight<3>
// approximately 42 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 3
dp3 r0.x, v1.xyzx, cb0[19].xyzx
dp3 r0.y, v1.xyzx, cb0[20].xyzx
dp3 r0.z, v1.xyzx, cb0[21].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad o0.xyz, r1.yzwy, cb0[0].xyzx, cb0[1].xyzx
mov o0.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
dp4 o2.x, v0.xyzw, cb0[22].xyzw
dp4 o2.y, v0.xyzw, cb0[23].xyzw
dp4 o2.z, v0.xyzw, cb0[24].xyzw
dp4 o2.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLight[] =
{
68, 88, 66, 67, 14, 155,
50, 151, 63, 65, 101, 24,
40, 206, 57, 215, 220, 59,
7, 90, 1, 0, 0, 0,
136, 14, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
16, 9, 0, 0, 200, 13,
0, 0, 28, 14, 0, 0,
65, 111, 110, 57, 216, 8,
0, 0, 216, 8, 0, 0,
0, 2, 254, 255, 104, 8,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
135, 1, 68, 66, 85, 71,
40, 0, 0, 0, 240, 5,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 37, 0, 0, 0,
20, 1, 0, 0, 13, 0,
0, 0, 236, 4, 0, 0,
112, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 36, 6,
0, 0, 0, 0, 255, 255,
60, 6, 0, 0, 0, 0,
255, 255, 72, 6, 0, 0,
59, 0, 0, 0, 84, 6,
0, 0, 59, 0, 0, 0,
100, 6, 0, 0, 59, 0,
0, 0, 116, 6, 0, 0,
59, 0, 0, 0, 132, 6,
0, 0, 36, 0, 0, 0,
144, 6, 0, 0, 39, 0,
0, 0, 160, 6, 0, 0,
41, 0, 0, 0, 176, 6,
0, 0, 46, 0, 0, 0,
192, 6, 0, 0, 46, 0,
0, 0, 208, 6, 0, 0,
46, 0, 0, 0, 220, 6,
0, 0, 57, 0, 0, 0,
240, 6, 0, 0, 57, 0,
0, 0, 0, 7, 0, 0,
57, 0, 0, 0, 16, 7,
0, 0, 58, 0, 0, 0,
32, 7, 0, 0, 58, 0,
0, 0, 48, 7, 0, 0,
33, 0, 0, 0, 60, 7,
0, 0, 33, 0, 0, 0,
76, 7, 0, 0, 37, 0,
0, 0, 88, 7, 0, 0,
42, 0, 0, 0, 104, 7,
0, 0, 42, 0, 0, 0,
120, 7, 0, 0, 42, 0,
0, 0, 136, 7, 0, 0,
42, 0, 0, 0, 152, 7,
0, 0, 47, 0, 0, 0,
168, 7, 0, 0, 47, 0,
0, 0, 184, 7, 0, 0,
63, 0, 0, 0, 200, 7,
0, 0, 14, 0, 1, 0,
216, 7, 0, 0, 14, 0,
1, 0, 232, 7, 0, 0,
14, 0, 1, 0, 248, 7,
0, 0, 63, 0, 0, 0,
8, 8, 0, 0, 63, 0,
0, 0, 24, 8, 0, 0,
63, 0, 0, 0, 40, 8,
0, 0, 8, 1, 2, 0,
56, 8, 0, 0, 8, 1,
2, 0, 76, 8, 0, 0,
46, 0, 0, 0, 88, 8,
0, 0, 80, 97, 114, 97,
109, 101, 116, 101, 114, 115,
0, 68, 105, 102, 102, 117,
115, 101, 67, 111, 108, 111,
114, 0, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
11, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
86, 83, 66, 97, 115, 105,
99, 79, 110, 101, 76, 105,
103, 104, 116, 0, 68, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 80, 111, 115, 105, 116,
105, 111, 110, 80, 83, 0,
128, 2, 0, 0, 136, 2,
0, 0, 152, 2, 0, 0,
136, 2, 0, 0, 161, 2,
0, 0, 136, 2, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 3, 0,
172, 2, 0, 0, 12, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 26, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 27, 0,
0, 0, 255, 255, 255, 255,
10, 0, 255, 255, 30, 0,
0, 0, 255, 255, 255, 255,
255, 255, 7, 0, 34, 0,
0, 0, 8, 0, 9, 0,
255, 255, 255, 255, 35, 0,
0, 0, 255, 255, 255, 255,
255, 255, 11, 0, 36, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 100, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 9, 0,
0, 0, 255, 255, 255, 255,
0, 0, 255, 255, 100, 111,
116, 72, 0, 171, 171, 171,
20, 0, 0, 0, 255, 255,
255, 255, 0, 0, 255, 255,
100, 111, 116, 76, 0, 171,
171, 171, 7, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 101, 121, 101, 86,
101, 99, 116, 111, 114, 0,
171, 171, 17, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 104, 97, 108, 102,
86, 101, 99, 116, 111, 114,
115, 0, 3, 0, 3, 0,
3, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
19, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
112, 111, 115, 95, 119, 115,
0, 171, 13, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 14, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 15, 0, 0, 0,
255, 255, 255, 255, 2, 0,
255, 255, 115, 112, 101, 99,
117, 108, 97, 114, 0, 171,
171, 171, 24, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 78, 111, 114,
109, 97, 108, 0, 252, 3,
0, 0, 136, 2, 0, 0,
5, 4, 0, 0, 48, 3,
0, 0, 5, 0, 0, 0,
1, 0, 7, 0, 1, 0,
2, 0, 12, 4, 0, 0,
1, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
2, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
118, 111, 117, 116, 0, 80,
111, 115, 95, 112, 115, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 73, 4,
0, 0, 136, 2, 0, 0,
128, 2, 0, 0, 136, 2,
0, 0, 152, 2, 0, 0,
48, 3, 0, 0, 80, 4,
0, 0, 92, 4, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
108, 4, 0, 0, 31, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 32, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 33, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 119, 111,
114, 108, 100, 78, 111, 114,
109, 97, 108, 0, 6, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 122, 101,
114, 111, 76, 0, 171, 171,
8, 0, 0, 0, 255, 255,
0, 0, 255, 255, 255, 255,
60, 2, 0, 0, 71, 2,
0, 0, 84, 2, 0, 0,
1, 0, 0, 0, 100, 2,
0, 0, 0, 0, 0, 0,
112, 2, 0, 0, 196, 2,
0, 0, 7, 0, 0, 0,
212, 2, 0, 0, 0, 0,
0, 0, 40, 3, 0, 0,
48, 3, 0, 0, 1, 0,
0, 0, 64, 3, 0, 0,
0, 0, 0, 0, 76, 3,
0, 0, 48, 3, 0, 0,
1, 0, 0, 0, 84, 3,
0, 0, 0, 0, 0, 0,
96, 3, 0, 0, 48, 3,
0, 0, 1, 0, 0, 0,
104, 3, 0, 0, 0, 0,
0, 0, 116, 3, 0, 0,
48, 3, 0, 0, 1, 0,
0, 0, 128, 3, 0, 0,
0, 0, 0, 0, 140, 3,
0, 0, 152, 3, 0, 0,
1, 0, 0, 0, 168, 3,
0, 0, 0, 0, 0, 0,
180, 3, 0, 0, 136, 2,
0, 0, 3, 0, 0, 0,
188, 3, 0, 0, 0, 0,
0, 0, 224, 3, 0, 0,
48, 3, 0, 0, 1, 0,
0, 0, 236, 3, 0, 0,
112, 2, 0, 0, 248, 3,
0, 0, 28, 4, 0, 0,
2, 0, 0, 0, 44, 4,
0, 0, 0, 0, 0, 0,
68, 4, 0, 0, 140, 4,
0, 0, 3, 0, 0, 0,
156, 4, 0, 0, 0, 0,
0, 0, 192, 4, 0, 0,
48, 3, 0, 0, 1, 0,
0, 0, 204, 4, 0, 0,
0, 0, 0, 0, 216, 4,
0, 0, 48, 3, 0, 0,
1, 0, 0, 0, 224, 4,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
81, 0, 0, 5, 19, 0,
15, 160, 0, 0, 0, 0,
0, 0, 128, 63, 0, 0,
0, 0, 0, 0, 0, 0,
31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144,
31, 0, 0, 2, 5, 0,
1, 128, 1, 0, 15, 144,
8, 0, 0, 3, 0, 0,
1, 128, 1, 0, 228, 144,
12, 0, 228, 160, 8, 0,
0, 3, 0, 0, 2, 128,
1, 0, 228, 144, 13, 0,
228, 160, 8, 0, 0, 3,
0, 0, 4, 128, 1, 0,
228, 144, 14, 0, 228, 160,
36, 0, 0, 2, 1, 0,
7, 128, 0, 0, 228, 128,
8, 0, 0, 3, 0, 0,
1, 128, 4, 0, 228, 161,
1, 0, 228, 128, 13, 0,
0, 3, 0, 0, 2, 128,
0, 0, 0, 128, 19, 0,
0, 160, 5, 0, 0, 3,
0, 0, 4, 128, 0, 0,
0, 128, 0, 0, 85, 128,
5, 0, 0, 3, 2, 0,
7, 128, 0, 0, 170, 128,
5, 0, 228, 160, 1, 0,
0, 2, 3, 0, 7, 128,
1, 0, 228, 160, 4, 0,
0, 4, 0, 0, 7, 224,
2, 0, 228, 128, 3, 0,
228, 128, 2, 0, 228, 160,
9, 0, 0, 3, 2, 0,
1, 128, 0, 0, 228, 144,
9, 0, 228, 160, 9, 0,
0, 3, 2, 0, 2, 128,
0, 0, 228, 144, 10, 0,
228, 160, 9, 0, 0, 3,
2, 0, 4, 128, 0, 0,
228, 144, 11, 0, 228, 160,
2, 0, 0, 3, 2, 0,
7, 128, 2, 0, 228, 129,
7, 0, 228, 160, 36, 0,
0, 2, 3, 0, 7, 128,
2, 0, 228, 128, 2, 0,
0, 3, 2, 0, 7, 128,
3, 0, 228, 128, 4, 0,
228, 161, 36, 0, 0, 2,
3, 0, 7, 128, 2, 0,
228, 128, 8, 0, 0, 3,
0, 0, 4, 128, 3, 0,
228, 128, 1, 0, 228, 128,
11, 0, 0, 3, 0, 0,
4, 128, 0, 0, 170, 128,
19, 0, 0, 160, 5, 0,
0, 3, 0, 0, 2, 128,
0, 0, 85, 128, 0, 0,
170, 128, 32, 0, 0, 3,
1, 0, 1, 128, 0, 0,
85, 128, 3, 0, 255, 160,
5, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
1, 0, 0, 128, 5, 0,
0, 3, 0, 0, 7, 128,
0, 0, 0, 128, 6, 0,
228, 160, 5, 0, 0, 3,
1, 0, 7, 224, 0, 0,
228, 128, 3, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 192, 0, 0, 228, 144,
17, 0, 228, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 8, 0,
228, 160, 11, 0, 0, 3,
0, 0, 1, 128, 0, 0,
0, 128, 19, 0, 0, 160,
10, 0, 0, 3, 1, 0,
8, 224, 0, 0, 0, 128,
19, 0, 85, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 15, 0,
228, 160, 9, 0, 0, 3,
0, 0, 2, 128, 0, 0,
228, 144, 16, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 128, 0, 0, 228, 144,
18, 0, 228, 160, 4, 0,
0, 4, 0, 0, 3, 192,
0, 0, 170, 128, 0, 0,
228, 160, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 192, 0, 0, 170, 128,
1, 0, 0, 2, 0, 0,
8, 224, 1, 0, 255, 160,
255, 255, 0, 0, 83, 72,
68, 82, 176, 4, 0, 0,
64, 0, 1, 0, 44, 1,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 26, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 114, 16,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 1, 0, 0, 0,
103, 0, 0, 4, 242, 32,
16, 0, 2, 0, 0, 0,
1, 0, 0, 0, 104, 0,
0, 2, 3, 0, 0, 0,
16, 0, 0, 8, 18, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 19, 0,
0, 0, 16, 0, 0, 8,
34, 0, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
20, 0, 0, 0, 16, 0,
0, 8, 66, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 21, 0, 0, 0,
16, 0, 0, 7, 130, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 68, 0,
0, 5, 130, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 16, 0,
0, 9, 130, 0, 16, 0,
0, 0, 0, 0, 70, 130,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 29, 0,
0, 7, 18, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
0, 0, 1, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
56, 0, 0, 7, 34, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 56, 0,
0, 8, 226, 0, 16, 0,
1, 0, 0, 0, 86, 5,
16, 0, 1, 0, 0, 0,
6, 137, 32, 0, 0, 0,
0, 0, 6, 0, 0, 0,
50, 0, 0, 11, 114, 32,
16, 0, 0, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 54, 0, 0, 6,
130, 32, 16, 0, 0, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 17, 0, 0, 8,
18, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
15, 0, 0, 0, 17, 0,
0, 8, 34, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 16, 0, 0, 0,
17, 0, 0, 8, 66, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 17, 0,
0, 0, 0, 0, 0, 9,
226, 0, 16, 0, 1, 0,
0, 0, 6, 9, 16, 128,
65, 0, 0, 0, 2, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 12, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 2, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
68, 0, 0, 5, 18, 0,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 50, 0, 0, 11,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 0,
16, 0, 2, 0, 0, 0,
6, 137, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
2, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
2, 0, 0, 0, 56, 0,
0, 7, 226, 0, 16, 0,
1, 0, 0, 0, 86, 14,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 2, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
52, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 56, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 47, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 8, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 2, 0, 0, 0,
25, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 0, 0, 0, 0,
6, 0, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 9, 0,
0, 0, 56, 0, 0, 8,
114, 32, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 17, 32,
0, 8, 130, 32, 16, 0,
1, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 14, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 22, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
23, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 24, 0, 0, 0,
17, 0, 0, 8, 130, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 25, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 76, 0,
0, 0, 2, 0, 0, 0,
8, 0, 0, 0, 56, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 68, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
7, 7, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 78, 79,
82, 77, 65, 76, 0, 171,
79, 83, 71, 78, 100, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 80, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
15, 0, 0, 0, 86, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 67, 79,
76, 79, 82, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 171, 171
};

View File

@@ -0,0 +1,812 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 2, -1, 0, 1
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
#line 32 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, v1, c19.x, c19.y // ::BiasX2<0,1,2>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r1.x, r0, c12
dp3 r1.y, r0, c13
dp3 r1.z, r0, c14
nrm r0.xyz, r1 // ::worldNormal<0,1,2>
#line 36
dp3 r0.w, -c4, r0 // ::dotL<0>
#line 39
sge r1.x, r0.w, c19.z // ::zeroL<0>
mul r1.y, r0.w, r1.x // ::diffuse<0>
#line 46
mul r1.yzw, r1.y, c5.xxyz
mov r2.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad oT0.xyz, r1.yzww, r2, c2 // ::VSBasicOneLightBn<0,1,2>
#line 57
dp4 r2.x, v0, c9 // ::pos_ws<0>
dp4 r2.y, v0, c10 // ::pos_ws<1>
dp4 r2.z, v0, c11 // ::pos_ws<2>
add r1.yzw, -r2.xxyz, c7.xxyz
nrm r2.xyz, r1.yzww // ::eyeVector<0,1,2>
#line 33
add r1.yzw, r2.xxyz, -c4.xxyz
nrm r2.xyz, r1.yzww // ::halfVectors<0,1,2>
#line 37
dp3 r0.x, r2, r0 // ::dotH<0>
#line 42
max r0.x, r0.x, c19.z
mul r0.x, r1.x, r0.x
pow r1.x, r0.x, c3.w
mul r0.x, r0.w, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightBn<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightBn<10>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.z
min oT1.w, r0.x, c19.w // ::VSBasicOneLightBn<7>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 274 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightBn<8,9>
mov oPos.w, r0.z // ::VSBasicOneLightBn<11>
#line 46 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mov oT0.w, c1.w // ::VSBasicOneLightBn<3>
// approximately 43 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 3
mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.x, r0.xyzx, cb0[19].xyzx
dp3 r1.y, r0.xyzx, cb0[20].xyzx
dp3 r1.z, r0.xyzx, cb0[21].xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r1.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad o0.xyz, r1.yzwy, cb0[0].xyzx, cb0[1].xyzx
mov o0.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
dp4 o2.x, v0.xyzw, cb0[22].xyzw
dp4 o2.y, v0.xyzw, cb0[23].xyzw
dp4 o2.z, v0.xyzw, cb0[24].xyzw
dp4 o2.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightBn[] =
{
68, 88, 66, 67, 236, 183,
174, 209, 146, 179, 157, 149,
172, 229, 14, 116, 132, 71,
139, 175, 1, 0, 0, 0,
28, 15, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
104, 9, 0, 0, 92, 14,
0, 0, 176, 14, 0, 0,
65, 111, 110, 57, 48, 9,
0, 0, 48, 9, 0, 0,
0, 2, 254, 255, 192, 8,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
152, 1, 68, 66, 85, 71,
40, 0, 0, 0, 52, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 38, 0, 0, 0,
20, 1, 0, 0, 14, 0,
0, 0, 28, 5, 0, 0,
156, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 112, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 104, 6,
0, 0, 0, 0, 255, 255,
128, 6, 0, 0, 0, 0,
255, 255, 140, 6, 0, 0,
32, 0, 0, 0, 152, 6,
0, 0, 59, 0, 1, 0,
172, 6, 0, 0, 59, 0,
1, 0, 188, 6, 0, 0,
59, 0, 1, 0, 204, 6,
0, 0, 59, 0, 1, 0,
220, 6, 0, 0, 36, 0,
1, 0, 232, 6, 0, 0,
39, 0, 1, 0, 248, 6,
0, 0, 41, 0, 1, 0,
8, 7, 0, 0, 46, 0,
1, 0, 24, 7, 0, 0,
46, 0, 1, 0, 40, 7,
0, 0, 46, 0, 1, 0,
52, 7, 0, 0, 57, 0,
1, 0, 72, 7, 0, 0,
57, 0, 1, 0, 88, 7,
0, 0, 57, 0, 1, 0,
104, 7, 0, 0, 58, 0,
1, 0, 120, 7, 0, 0,
58, 0, 1, 0, 136, 7,
0, 0, 33, 0, 1, 0,
148, 7, 0, 0, 33, 0,
1, 0, 164, 7, 0, 0,
37, 0, 1, 0, 176, 7,
0, 0, 42, 0, 1, 0,
192, 7, 0, 0, 42, 0,
1, 0, 208, 7, 0, 0,
42, 0, 1, 0, 224, 7,
0, 0, 42, 0, 1, 0,
240, 7, 0, 0, 47, 0,
1, 0, 0, 8, 0, 0,
47, 0, 1, 0, 16, 8,
0, 0, 63, 0, 1, 0,
32, 8, 0, 0, 14, 0,
0, 0, 48, 8, 0, 0,
14, 0, 0, 0, 64, 8,
0, 0, 14, 0, 0, 0,
80, 8, 0, 0, 63, 0,
1, 0, 96, 8, 0, 0,
63, 0, 1, 0, 112, 8,
0, 0, 63, 0, 1, 0,
128, 8, 0, 0, 18, 1,
2, 0, 144, 8, 0, 0,
18, 1, 2, 0, 164, 8,
0, 0, 46, 0, 1, 0,
176, 8, 0, 0, 66, 105,
97, 115, 88, 50, 0, 171,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 80, 97,
114, 97, 109, 101, 116, 101,
114, 115, 0, 68, 105, 102,
102, 117, 115, 101, 67, 111,
108, 111, 114, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 12, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 86, 83, 66, 97,
115, 105, 99, 79, 110, 101,
76, 105, 103, 104, 116, 66,
110, 0, 68, 105, 102, 102,
117, 115, 101, 0, 171, 171,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 80, 111, 115, 105, 116,
105, 111, 110, 80, 83, 0,
174, 2, 0, 0, 184, 2,
0, 0, 200, 2, 0, 0,
184, 2, 0, 0, 209, 2,
0, 0, 184, 2, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 3, 0,
220, 2, 0, 0, 13, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 27, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 28, 0,
0, 0, 255, 255, 255, 255,
10, 0, 255, 255, 31, 0,
0, 0, 255, 255, 255, 255,
255, 255, 7, 0, 35, 0,
0, 0, 8, 0, 9, 0,
255, 255, 255, 255, 36, 0,
0, 0, 255, 255, 255, 255,
255, 255, 11, 0, 37, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 100, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 10, 0,
0, 0, 255, 255, 0, 0,
255, 255, 255, 255, 100, 111,
116, 72, 0, 171, 171, 171,
21, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
100, 111, 116, 76, 0, 171,
171, 171, 8, 0, 0, 0,
255, 255, 255, 255, 255, 255,
0, 0, 101, 121, 101, 86,
101, 99, 116, 111, 114, 0,
171, 171, 18, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 104, 97, 108, 102,
86, 101, 99, 116, 111, 114,
115, 0, 3, 0, 3, 0,
3, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
20, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
112, 111, 115, 95, 119, 115,
0, 171, 14, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 15, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 16, 0, 0, 0,
255, 255, 255, 255, 2, 0,
255, 255, 115, 112, 101, 99,
117, 108, 97, 114, 0, 171,
171, 171, 25, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 78, 111, 114,
109, 97, 108, 0, 44, 4,
0, 0, 184, 2, 0, 0,
53, 4, 0, 0, 96, 3,
0, 0, 5, 0, 0, 0,
1, 0, 7, 0, 1, 0,
2, 0, 60, 4, 0, 0,
1, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
2, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
118, 111, 117, 116, 0, 80,
111, 115, 95, 112, 115, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 121, 4,
0, 0, 184, 2, 0, 0,
174, 2, 0, 0, 184, 2,
0, 0, 200, 2, 0, 0,
96, 3, 0, 0, 128, 4,
0, 0, 140, 4, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
156, 4, 0, 0, 32, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 33, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 34, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 119, 111,
114, 108, 100, 78, 111, 114,
109, 97, 108, 0, 7, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 122, 101,
114, 111, 76, 0, 171, 171,
9, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
0, 0, 0, 0, 68, 2,
0, 0, 76, 2, 0, 0,
1, 0, 0, 0, 92, 2,
0, 0, 104, 2, 0, 0,
115, 2, 0, 0, 128, 2,
0, 0, 1, 0, 0, 0,
144, 2, 0, 0, 0, 0,
0, 0, 156, 2, 0, 0,
244, 2, 0, 0, 7, 0,
0, 0, 4, 3, 0, 0,
0, 0, 0, 0, 88, 3,
0, 0, 96, 3, 0, 0,
1, 0, 0, 0, 112, 3,
0, 0, 0, 0, 0, 0,
124, 3, 0, 0, 96, 3,
0, 0, 1, 0, 0, 0,
132, 3, 0, 0, 0, 0,
0, 0, 144, 3, 0, 0,
96, 3, 0, 0, 1, 0,
0, 0, 152, 3, 0, 0,
0, 0, 0, 0, 164, 3,
0, 0, 96, 3, 0, 0,
1, 0, 0, 0, 176, 3,
0, 0, 0, 0, 0, 0,
188, 3, 0, 0, 200, 3,
0, 0, 1, 0, 0, 0,
216, 3, 0, 0, 0, 0,
0, 0, 228, 3, 0, 0,
184, 2, 0, 0, 3, 0,
0, 0, 236, 3, 0, 0,
0, 0, 0, 0, 16, 4,
0, 0, 96, 3, 0, 0,
1, 0, 0, 0, 28, 4,
0, 0, 156, 2, 0, 0,
40, 4, 0, 0, 76, 4,
0, 0, 2, 0, 0, 0,
92, 4, 0, 0, 0, 0,
0, 0, 116, 4, 0, 0,
188, 4, 0, 0, 3, 0,
0, 0, 204, 4, 0, 0,
0, 0, 0, 0, 240, 4,
0, 0, 96, 3, 0, 0,
1, 0, 0, 0, 252, 4,
0, 0, 0, 0, 0, 0,
8, 5, 0, 0, 96, 3,
0, 0, 1, 0, 0, 0,
16, 5, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
19, 0, 15, 160, 0, 0,
0, 64, 0, 0, 128, 191,
0, 0, 0, 0, 0, 0,
128, 63, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
228, 144, 19, 0, 0, 160,
19, 0, 85, 160, 8, 0,
0, 3, 1, 0, 1, 128,
0, 0, 228, 128, 12, 0,
228, 160, 8, 0, 0, 3,
1, 0, 2, 128, 0, 0,
228, 128, 13, 0, 228, 160,
8, 0, 0, 3, 1, 0,
4, 128, 0, 0, 228, 128,
14, 0, 228, 160, 36, 0,
0, 2, 0, 0, 7, 128,
1, 0, 228, 128, 8, 0,
0, 3, 0, 0, 8, 128,
4, 0, 228, 161, 0, 0,
228, 128, 13, 0, 0, 3,
1, 0, 1, 128, 0, 0,
255, 128, 19, 0, 170, 160,
5, 0, 0, 3, 1, 0,
2, 128, 0, 0, 255, 128,
1, 0, 0, 128, 5, 0,
0, 3, 1, 0, 14, 128,
1, 0, 85, 128, 5, 0,
144, 160, 1, 0, 0, 2,
2, 0, 7, 128, 1, 0,
228, 160, 4, 0, 0, 4,
0, 0, 7, 224, 1, 0,
249, 128, 2, 0, 228, 128,
2, 0, 228, 160, 9, 0,
0, 3, 2, 0, 1, 128,
0, 0, 228, 144, 9, 0,
228, 160, 9, 0, 0, 3,
2, 0, 2, 128, 0, 0,
228, 144, 10, 0, 228, 160,
9, 0, 0, 3, 2, 0,
4, 128, 0, 0, 228, 144,
11, 0, 228, 160, 2, 0,
0, 3, 1, 0, 14, 128,
2, 0, 144, 129, 7, 0,
144, 160, 36, 0, 0, 2,
2, 0, 7, 128, 1, 0,
249, 128, 2, 0, 0, 3,
1, 0, 14, 128, 2, 0,
144, 128, 4, 0, 144, 161,
36, 0, 0, 2, 2, 0,
7, 128, 1, 0, 249, 128,
8, 0, 0, 3, 0, 0,
1, 128, 2, 0, 228, 128,
0, 0, 228, 128, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 19, 0,
170, 160, 5, 0, 0, 3,
0, 0, 1, 128, 1, 0,
0, 128, 0, 0, 0, 128,
32, 0, 0, 3, 1, 0,
1, 128, 0, 0, 0, 128,
3, 0, 255, 160, 5, 0,
0, 3, 0, 0, 1, 128,
0, 0, 255, 128, 1, 0,
0, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
0, 128, 6, 0, 228, 160,
5, 0, 0, 3, 1, 0,
7, 224, 0, 0, 228, 128,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 17, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 8, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
19, 0, 170, 160, 10, 0,
0, 3, 1, 0, 8, 224,
0, 0, 0, 128, 19, 0,
255, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 15, 0, 228, 160,
9, 0, 0, 3, 0, 0,
2, 128, 0, 0, 228, 144,
16, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 128,
0, 0, 228, 144, 18, 0,
228, 160, 4, 0, 0, 4,
0, 0, 3, 192, 0, 0,
170, 128, 0, 0, 228, 160,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 192,
0, 0, 170, 128, 1, 0,
0, 2, 0, 0, 8, 224,
1, 0, 255, 160, 255, 255,
0, 0, 83, 72, 68, 82,
236, 4, 0, 0, 64, 0,
1, 0, 59, 1, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
26, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 95, 0,
0, 3, 114, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
1, 0, 0, 0, 103, 0,
0, 4, 242, 32, 16, 0,
2, 0, 0, 0, 1, 0,
0, 0, 104, 0, 0, 2,
3, 0, 0, 0, 50, 0,
0, 15, 114, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 64, 0, 0, 0, 64,
0, 0, 0, 64, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 191, 0, 0,
128, 191, 0, 0, 128, 191,
0, 0, 0, 0, 16, 0,
0, 8, 18, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 19, 0, 0, 0,
16, 0, 0, 8, 34, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 20, 0,
0, 0, 16, 0, 0, 8,
66, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
21, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 16, 0, 0, 9,
130, 0, 16, 0, 0, 0,
0, 0, 70, 130, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 29, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
1, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 56, 0,
0, 7, 34, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 56, 0, 0, 8,
226, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
1, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
6, 0, 0, 0, 50, 0,
0, 11, 114, 32, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
54, 0, 0, 6, 130, 32,
16, 0, 0, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
17, 0, 0, 8, 18, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 15, 0,
0, 0, 17, 0, 0, 8,
34, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
16, 0, 0, 0, 17, 0,
0, 8, 66, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 17, 0, 0, 0,
0, 0, 0, 9, 226, 0,
16, 0, 1, 0, 0, 0,
6, 9, 16, 128, 65, 0,
0, 0, 2, 0, 0, 0,
6, 137, 32, 0, 0, 0,
0, 0, 12, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 2, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 2, 0, 0, 0,
50, 0, 0, 11, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 6, 137,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 2, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
68, 0, 0, 5, 18, 0,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 56, 0, 0, 7,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 0,
16, 0, 2, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 52, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
0, 0, 56, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
47, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 58, 128,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 25, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 8, 114, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 9, 0, 0, 0,
56, 0, 0, 8, 114, 32,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 17, 32, 0, 8,
130, 32, 16, 0, 1, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
14, 0, 0, 0, 17, 0,
0, 8, 18, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 22, 0, 0, 0,
17, 0, 0, 8, 34, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 23, 0,
0, 0, 17, 0, 0, 8,
66, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
24, 0, 0, 0, 17, 0,
0, 8, 130, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 25, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 76, 0, 0, 0,
2, 0, 0, 0, 8, 0,
0, 0, 56, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 68, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 7, 7,
0, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 78, 79, 82, 77,
65, 76, 0, 171, 79, 83,
71, 78, 100, 0, 0, 0,
3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 80, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 0,
0, 0, 86, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 0,
0, 0, 67, 79, 76, 79,
82, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 171, 171
};

View File

@@ -0,0 +1,829 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
dcl_texcoord2 v2 // vin<7,8>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r0.x, v1, c12
dp3 r0.y, v1, c13
dp3 r0.z, v1, c14
nrm r1.xyz, r0 // ::worldNormal<0,1,2>
#line 36
dp3 r0.x, -c4, r1 // ::dotL<0>
#line 39
sge r0.y, r0.x, c19.x // ::zeroL<0>
mul r0.z, r0.x, r0.y // ::diffuse<0>
#line 46
mul r2.xyz, r0.z, c5
mov r3.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad oT0.xyz, r2, r3, c2 // ::VSBasicOneLightTx<0,1,2>
#line 57
dp4 r2.x, v0, c9 // ::pos_ws<0>
dp4 r2.y, v0, c10 // ::pos_ws<1>
dp4 r2.z, v0, c11 // ::pos_ws<2>
add r2.xyz, -r2, c7
nrm r3.xyz, r2 // ::eyeVector<0,1,2>
#line 33
add r2.xyz, r3, -c4
nrm r3.xyz, r2 // ::halfVectors<0,1,2>
#line 37
dp3 r0.z, r3, r1 // ::dotH<0>
#line 42
max r0.z, r0.z, c19.x
mul r0.y, r0.y, r0.z
pow r1.x, r0.y, c3.w
mul r0.x, r0.x, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightTx<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightTx<12>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.x
min oT1.w, r0.x, c19.y // ::VSBasicOneLightTx<7>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 316 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightTx<10,11>
mov oPos.w, r0.z // ::VSBasicOneLightTx<13>
#line 46 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mov oT0.w, c1.w // ::VSBasicOneLightTx<3>
#line 323 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mov oT2.xy, v2 // ::VSBasicOneLightTx<8,9>
// approximately 43 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output_siv o3.xyzw, position
dcl_temps 3
dp3 r0.x, v1.xyzx, cb0[19].xyzx
dp3 r0.y, v1.xyzx, cb0[20].xyzx
dp3 r0.z, v1.xyzx, cb0[21].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad o0.xyz, r1.yzwy, cb0[0].xyzx, cb0[1].xyzx
mov o0.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
mov o2.xy, v2.xyxx
dp4 o3.x, v0.xyzw, cb0[22].xyzw
dp4 o3.y, v0.xyzw, cb0[23].xyzw
dp4 o3.z, v0.xyzw, cb0[24].xyzw
dp4 o3.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightTx[] =
{
68, 88, 66, 67, 252, 165,
51, 240, 77, 192, 21, 37,
57, 51, 159, 232, 160, 80,
247, 196, 1, 0, 0, 0,
100, 15, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
128, 9, 0, 0, 100, 14,
0, 0, 216, 14, 0, 0,
65, 111, 110, 57, 72, 9,
0, 0, 72, 9, 0, 0,
0, 2, 254, 255, 216, 8,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
157, 1, 68, 66, 85, 71,
40, 0, 0, 0, 72, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 39, 0, 0, 0,
20, 1, 0, 0, 13, 0,
0, 0, 68, 5, 0, 0,
128, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 124, 6,
0, 0, 0, 0, 255, 255,
148, 6, 0, 0, 0, 0,
255, 255, 160, 6, 0, 0,
0, 0, 255, 255, 172, 6,
0, 0, 59, 0, 0, 0,
184, 6, 0, 0, 59, 0,
0, 0, 200, 6, 0, 0,
59, 0, 0, 0, 216, 6,
0, 0, 59, 0, 0, 0,
232, 6, 0, 0, 36, 0,
0, 0, 244, 6, 0, 0,
39, 0, 0, 0, 4, 7,
0, 0, 41, 0, 0, 0,
20, 7, 0, 0, 46, 0,
0, 0, 36, 7, 0, 0,
46, 0, 0, 0, 52, 7,
0, 0, 46, 0, 0, 0,
64, 7, 0, 0, 57, 0,
0, 0, 84, 7, 0, 0,
57, 0, 0, 0, 100, 7,
0, 0, 57, 0, 0, 0,
116, 7, 0, 0, 58, 0,
0, 0, 132, 7, 0, 0,
58, 0, 0, 0, 148, 7,
0, 0, 33, 0, 0, 0,
160, 7, 0, 0, 33, 0,
0, 0, 176, 7, 0, 0,
37, 0, 0, 0, 188, 7,
0, 0, 42, 0, 0, 0,
204, 7, 0, 0, 42, 0,
0, 0, 220, 7, 0, 0,
42, 0, 0, 0, 236, 7,
0, 0, 42, 0, 0, 0,
252, 7, 0, 0, 47, 0,
0, 0, 12, 8, 0, 0,
47, 0, 0, 0, 28, 8,
0, 0, 63, 0, 0, 0,
44, 8, 0, 0, 14, 0,
1, 0, 60, 8, 0, 0,
14, 0, 1, 0, 76, 8,
0, 0, 14, 0, 1, 0,
92, 8, 0, 0, 63, 0,
0, 0, 108, 8, 0, 0,
63, 0, 0, 0, 124, 8,
0, 0, 63, 0, 0, 0,
140, 8, 0, 0, 60, 1,
2, 0, 156, 8, 0, 0,
60, 1, 2, 0, 176, 8,
0, 0, 46, 0, 0, 0,
188, 8, 0, 0, 67, 1,
2, 0, 200, 8, 0, 0,
80, 97, 114, 97, 109, 101,
116, 101, 114, 115, 0, 68,
105, 102, 102, 117, 115, 101,
67, 111, 108, 111, 114, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 12, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 86, 83,
66, 97, 115, 105, 99, 79,
110, 101, 76, 105, 103, 104,
116, 84, 120, 0, 68, 105,
102, 102, 117, 115, 101, 0,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
83, 112, 101, 99, 117, 108,
97, 114, 0, 84, 101, 120,
67, 111, 111, 114, 100, 0,
171, 171, 1, 0, 3, 0,
1, 0, 2, 0, 1, 0,
0, 0, 0, 0, 0, 0,
80, 111, 115, 105, 116, 105,
111, 110, 80, 83, 0, 171,
146, 2, 0, 0, 156, 2,
0, 0, 172, 2, 0, 0,
156, 2, 0, 0, 181, 2,
0, 0, 192, 2, 0, 0,
208, 2, 0, 0, 156, 2,
0, 0, 5, 0, 0, 0,
1, 0, 14, 0, 1, 0,
4, 0, 220, 2, 0, 0,
13, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
27, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
28, 0, 0, 0, 255, 255,
255, 255, 12, 0, 255, 255,
31, 0, 0, 0, 255, 255,
255, 255, 255, 255, 7, 0,
35, 0, 0, 0, 10, 0,
11, 0, 255, 255, 255, 255,
36, 0, 0, 0, 255, 255,
255, 255, 255, 255, 13, 0,
37, 0, 0, 0, 255, 255,
255, 255, 255, 255, 3, 0,
38, 0, 0, 0, 8, 0,
9, 0, 255, 255, 255, 255,
100, 105, 102, 102, 117, 115,
101, 0, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
10, 0, 0, 0, 255, 255,
255, 255, 0, 0, 255, 255,
100, 111, 116, 72, 0, 171,
171, 171, 21, 0, 0, 0,
255, 255, 255, 255, 0, 0,
255, 255, 100, 111, 116, 76,
0, 171, 171, 171, 8, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 101, 121,
101, 86, 101, 99, 116, 111,
114, 0, 171, 171, 18, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 104, 97,
108, 102, 86, 101, 99, 116,
111, 114, 115, 0, 3, 0,
3, 0, 3, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 20, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 112, 111, 115, 95,
119, 115, 0, 171, 14, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 15, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 16, 0,
0, 0, 255, 255, 255, 255,
2, 0, 255, 255, 115, 112,
101, 99, 117, 108, 97, 114,
0, 171, 171, 171, 25, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 118, 105,
110, 0, 80, 111, 115, 105,
116, 105, 111, 110, 0, 78,
111, 114, 109, 97, 108, 0,
64, 4, 0, 0, 156, 2,
0, 0, 73, 4, 0, 0,
116, 3, 0, 0, 181, 2,
0, 0, 192, 2, 0, 0,
5, 0, 0, 0, 1, 0,
9, 0, 1, 0, 3, 0,
80, 4, 0, 0, 1, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 2, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 3, 0,
0, 0, 7, 0, 8, 0,
255, 255, 255, 255, 118, 111,
117, 116, 0, 80, 111, 115,
95, 112, 115, 0, 70, 111,
103, 70, 97, 99, 116, 111,
114, 0, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 161, 4, 0, 0,
156, 2, 0, 0, 146, 2,
0, 0, 156, 2, 0, 0,
172, 2, 0, 0, 116, 3,
0, 0, 168, 4, 0, 0,
180, 4, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 4, 0, 196, 4,
0, 0, 32, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 33, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 34, 0, 0, 0,
255, 255, 255, 255, 3, 0,
255, 255, 119, 111, 114, 108,
100, 78, 111, 114, 109, 97,
108, 0, 7, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 122, 101, 114, 111,
76, 0, 171, 171, 9, 0,
0, 0, 255, 255, 0, 0,
255, 255, 255, 255, 76, 2,
0, 0, 87, 2, 0, 0,
100, 2, 0, 0, 1, 0,
0, 0, 116, 2, 0, 0,
0, 0, 0, 0, 128, 2,
0, 0, 252, 2, 0, 0,
8, 0, 0, 0, 12, 3,
0, 0, 0, 0, 0, 0,
108, 3, 0, 0, 116, 3,
0, 0, 1, 0, 0, 0,
132, 3, 0, 0, 0, 0,
0, 0, 144, 3, 0, 0,
116, 3, 0, 0, 1, 0,
0, 0, 152, 3, 0, 0,
0, 0, 0, 0, 164, 3,
0, 0, 116, 3, 0, 0,
1, 0, 0, 0, 172, 3,
0, 0, 0, 0, 0, 0,
184, 3, 0, 0, 116, 3,
0, 0, 1, 0, 0, 0,
196, 3, 0, 0, 0, 0,
0, 0, 208, 3, 0, 0,
220, 3, 0, 0, 1, 0,
0, 0, 236, 3, 0, 0,
0, 0, 0, 0, 248, 3,
0, 0, 156, 2, 0, 0,
3, 0, 0, 0, 0, 4,
0, 0, 0, 0, 0, 0,
36, 4, 0, 0, 116, 3,
0, 0, 1, 0, 0, 0,
48, 4, 0, 0, 128, 2,
0, 0, 60, 4, 0, 0,
104, 4, 0, 0, 3, 0,
0, 0, 120, 4, 0, 0,
0, 0, 0, 0, 156, 4,
0, 0, 228, 4, 0, 0,
3, 0, 0, 0, 244, 4,
0, 0, 0, 0, 0, 0,
24, 5, 0, 0, 116, 3,
0, 0, 1, 0, 0, 0,
36, 5, 0, 0, 0, 0,
0, 0, 48, 5, 0, 0,
116, 3, 0, 0, 1, 0,
0, 0, 56, 5, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 81, 0,
0, 5, 19, 0, 15, 160,
0, 0, 0, 0, 0, 0,
128, 63, 0, 0, 0, 0,
0, 0, 0, 0, 31, 0,
0, 2, 5, 0, 0, 128,
0, 0, 15, 144, 31, 0,
0, 2, 5, 0, 1, 128,
1, 0, 15, 144, 31, 0,
0, 2, 5, 0, 2, 128,
2, 0, 15, 144, 8, 0,
0, 3, 0, 0, 1, 128,
1, 0, 228, 144, 12, 0,
228, 160, 8, 0, 0, 3,
0, 0, 2, 128, 1, 0,
228, 144, 13, 0, 228, 160,
8, 0, 0, 3, 0, 0,
4, 128, 1, 0, 228, 144,
14, 0, 228, 160, 36, 0,
0, 2, 1, 0, 7, 128,
0, 0, 228, 128, 8, 0,
0, 3, 0, 0, 1, 128,
4, 0, 228, 161, 1, 0,
228, 128, 13, 0, 0, 3,
0, 0, 2, 128, 0, 0,
0, 128, 19, 0, 0, 160,
5, 0, 0, 3, 0, 0,
4, 128, 0, 0, 0, 128,
0, 0, 85, 128, 5, 0,
0, 3, 2, 0, 7, 128,
0, 0, 170, 128, 5, 0,
228, 160, 1, 0, 0, 2,
3, 0, 7, 128, 1, 0,
228, 160, 4, 0, 0, 4,
0, 0, 7, 224, 2, 0,
228, 128, 3, 0, 228, 128,
2, 0, 228, 160, 9, 0,
0, 3, 2, 0, 1, 128,
0, 0, 228, 144, 9, 0,
228, 160, 9, 0, 0, 3,
2, 0, 2, 128, 0, 0,
228, 144, 10, 0, 228, 160,
9, 0, 0, 3, 2, 0,
4, 128, 0, 0, 228, 144,
11, 0, 228, 160, 2, 0,
0, 3, 2, 0, 7, 128,
2, 0, 228, 129, 7, 0,
228, 160, 36, 0, 0, 2,
3, 0, 7, 128, 2, 0,
228, 128, 2, 0, 0, 3,
2, 0, 7, 128, 3, 0,
228, 128, 4, 0, 228, 161,
36, 0, 0, 2, 3, 0,
7, 128, 2, 0, 228, 128,
8, 0, 0, 3, 0, 0,
4, 128, 3, 0, 228, 128,
1, 0, 228, 128, 11, 0,
0, 3, 0, 0, 4, 128,
0, 0, 170, 128, 19, 0,
0, 160, 5, 0, 0, 3,
0, 0, 2, 128, 0, 0,
85, 128, 0, 0, 170, 128,
32, 0, 0, 3, 1, 0,
1, 128, 0, 0, 85, 128,
3, 0, 255, 160, 5, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 1, 0,
0, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
0, 128, 6, 0, 228, 160,
5, 0, 0, 3, 1, 0,
7, 224, 0, 0, 228, 128,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 17, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 8, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
19, 0, 0, 160, 10, 0,
0, 3, 1, 0, 8, 224,
0, 0, 0, 128, 19, 0,
85, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 15, 0, 228, 160,
9, 0, 0, 3, 0, 0,
2, 128, 0, 0, 228, 144,
16, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 128,
0, 0, 228, 144, 18, 0,
228, 160, 4, 0, 0, 4,
0, 0, 3, 192, 0, 0,
170, 128, 0, 0, 228, 160,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 192,
0, 0, 170, 128, 1, 0,
0, 2, 0, 0, 8, 224,
1, 0, 255, 160, 1, 0,
0, 2, 2, 0, 3, 224,
2, 0, 228, 144, 255, 255,
0, 0, 83, 72, 68, 82,
220, 4, 0, 0, 64, 0,
1, 0, 55, 1, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
26, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 95, 0,
0, 3, 114, 16, 16, 0,
1, 0, 0, 0, 95, 0,
0, 3, 50, 16, 16, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 50, 32, 16, 0,
2, 0, 0, 0, 103, 0,
0, 4, 242, 32, 16, 0,
3, 0, 0, 0, 1, 0,
0, 0, 104, 0, 0, 2,
3, 0, 0, 0, 16, 0,
0, 8, 18, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 19, 0, 0, 0,
16, 0, 0, 8, 34, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 20, 0,
0, 0, 16, 0, 0, 8,
66, 0, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
21, 0, 0, 0, 16, 0,
0, 7, 130, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 68, 0, 0, 5,
130, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
0, 0, 0, 0, 246, 15,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 16, 0, 0, 9,
130, 0, 16, 0, 0, 0,
0, 0, 70, 130, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 29, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
1, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 56, 0,
0, 7, 34, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 56, 0, 0, 8,
226, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
1, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
6, 0, 0, 0, 50, 0,
0, 11, 114, 32, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
54, 0, 0, 6, 130, 32,
16, 0, 0, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
17, 0, 0, 8, 18, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 15, 0,
0, 0, 17, 0, 0, 8,
34, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
16, 0, 0, 0, 17, 0,
0, 8, 66, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 17, 0, 0, 0,
0, 0, 0, 9, 226, 0,
16, 0, 1, 0, 0, 0,
6, 9, 16, 128, 65, 0,
0, 0, 2, 0, 0, 0,
6, 137, 32, 0, 0, 0,
0, 0, 12, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 2, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 2, 0, 0, 0,
50, 0, 0, 11, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 6, 137,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 2, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
68, 0, 0, 5, 18, 0,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 56, 0, 0, 7,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 0,
16, 0, 2, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 52, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
0, 0, 56, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
47, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 58, 128,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 25, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 8, 114, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 9, 0, 0, 0,
56, 0, 0, 8, 114, 32,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 17, 32, 0, 8,
130, 32, 16, 0, 1, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
14, 0, 0, 0, 54, 0,
0, 5, 50, 32, 16, 0,
2, 0, 0, 0, 70, 16,
16, 0, 2, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 22, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
23, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 24, 0, 0, 0,
17, 0, 0, 8, 130, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 25, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 108, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 92, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
7, 7, 0, 0, 99, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
3, 3, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 78, 79,
82, 77, 65, 76, 0, 84,
69, 88, 67, 79, 79, 82,
68, 0, 79, 83, 71, 78,
132, 0, 0, 0, 4, 0,
0, 0, 8, 0, 0, 0,
104, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
104, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
110, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 12, 0, 0,
119, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171
};

View File

@@ -0,0 +1,857 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
// TEXCOORD 0 xy 2 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 2, -1, 0, 1
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
dcl_texcoord2 v2 // vin<7,8>
#line 32 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, v1, c19.x, c19.y // ::BiasX2<0,1,2>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r1.x, r0, c12
dp3 r1.y, r0, c13
dp3 r1.z, r0, c14
nrm r0.xyz, r1 // ::worldNormal<0,1,2>
#line 36
dp3 r0.w, -c4, r0 // ::dotL<0>
#line 39
sge r1.x, r0.w, c19.z // ::zeroL<0>
mul r1.y, r0.w, r1.x // ::diffuse<0>
#line 46
mul r1.yzw, r1.y, c5.xxyz
mov r2.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad oT0.xyz, r1.yzww, r2, c2 // ::VSBasicOneLightTxBn<0,1,2>
#line 57
dp4 r2.x, v0, c9 // ::pos_ws<0>
dp4 r2.y, v0, c10 // ::pos_ws<1>
dp4 r2.z, v0, c11 // ::pos_ws<2>
add r1.yzw, -r2.xxyz, c7.xxyz
nrm r2.xyz, r1.yzww // ::eyeVector<0,1,2>
#line 33
add r1.yzw, r2.xxyz, -c4.xxyz
nrm r2.xyz, r1.yzww // ::halfVectors<0,1,2>
#line 37
dp3 r0.x, r2, r0 // ::dotH<0>
#line 42
max r0.x, r0.x, c19.z
mul r0.x, r1.x, r0.x
pow r1.x, r0.x, c3.w
mul r0.x, r0.w, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightTxBn<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightTxBn<12>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.z
min oT1.w, r0.x, c19.w // ::VSBasicOneLightTxBn<7>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 328 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightTxBn<10,11>
mov oPos.w, r0.z // ::VSBasicOneLightTxBn<13>
#line 46 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
mov oT0.w, c1.w // ::VSBasicOneLightTxBn<3>
#line 337 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mov oT2.xy, v2 // ::VSBasicOneLightTxBn<8,9>
// approximately 44 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output_siv o3.xyzw, position
dcl_temps 3
mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.x, r0.xyzx, cb0[19].xyzx
dp3 r1.y, r0.xyzx, cb0[20].xyzx
dp3 r1.z, r0.xyzx, cb0[21].xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r1.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad o0.xyz, r1.yzwy, cb0[0].xyzx, cb0[1].xyzx
mov o0.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
mov o2.xy, v2.xyxx
dp4 o3.x, v0.xyzw, cb0[22].xyzw
dp4 o3.y, v0.xyzw, cb0[23].xyzw
dp4 o3.z, v0.xyzw, cb0[24].xyzw
dp4 o3.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightTxBn[] =
{
68, 88, 66, 67, 122, 36,
25, 216, 196, 97, 107, 225,
67, 69, 38, 146, 109, 220,
106, 182, 1, 0, 0, 0,
244, 15, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
212, 9, 0, 0, 244, 14,
0, 0, 104, 15, 0, 0,
65, 111, 110, 57, 156, 9,
0, 0, 156, 9, 0, 0,
0, 2, 254, 255, 44, 9,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
173, 1, 68, 66, 85, 71,
40, 0, 0, 0, 136, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 40, 0, 0, 0,
20, 1, 0, 0, 14, 0,
0, 0, 112, 5, 0, 0,
172, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 112, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 188, 6,
0, 0, 0, 0, 255, 255,
212, 6, 0, 0, 0, 0,
255, 255, 224, 6, 0, 0,
0, 0, 255, 255, 236, 6,
0, 0, 32, 0, 0, 0,
248, 6, 0, 0, 59, 0,
1, 0, 12, 7, 0, 0,
59, 0, 1, 0, 28, 7,
0, 0, 59, 0, 1, 0,
44, 7, 0, 0, 59, 0,
1, 0, 60, 7, 0, 0,
36, 0, 1, 0, 72, 7,
0, 0, 39, 0, 1, 0,
88, 7, 0, 0, 41, 0,
1, 0, 104, 7, 0, 0,
46, 0, 1, 0, 120, 7,
0, 0, 46, 0, 1, 0,
136, 7, 0, 0, 46, 0,
1, 0, 148, 7, 0, 0,
57, 0, 1, 0, 168, 7,
0, 0, 57, 0, 1, 0,
184, 7, 0, 0, 57, 0,
1, 0, 200, 7, 0, 0,
58, 0, 1, 0, 216, 7,
0, 0, 58, 0, 1, 0,
232, 7, 0, 0, 33, 0,
1, 0, 244, 7, 0, 0,
33, 0, 1, 0, 4, 8,
0, 0, 37, 0, 1, 0,
16, 8, 0, 0, 42, 0,
1, 0, 32, 8, 0, 0,
42, 0, 1, 0, 48, 8,
0, 0, 42, 0, 1, 0,
64, 8, 0, 0, 42, 0,
1, 0, 80, 8, 0, 0,
47, 0, 1, 0, 96, 8,
0, 0, 47, 0, 1, 0,
112, 8, 0, 0, 63, 0,
1, 0, 128, 8, 0, 0,
14, 0, 0, 0, 144, 8,
0, 0, 14, 0, 0, 0,
160, 8, 0, 0, 14, 0,
0, 0, 176, 8, 0, 0,
63, 0, 1, 0, 192, 8,
0, 0, 63, 0, 1, 0,
208, 8, 0, 0, 63, 0,
1, 0, 224, 8, 0, 0,
72, 1, 2, 0, 240, 8,
0, 0, 72, 1, 2, 0,
4, 9, 0, 0, 46, 0,
1, 0, 16, 9, 0, 0,
81, 1, 2, 0, 28, 9,
0, 0, 66, 105, 97, 115,
88, 50, 0, 171, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 4, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 80, 97, 114, 97,
109, 101, 116, 101, 114, 115,
0, 68, 105, 102, 102, 117,
115, 101, 67, 111, 108, 111,
114, 0, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
13, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
86, 83, 66, 97, 115, 105,
99, 79, 110, 101, 76, 105,
103, 104, 116, 84, 120, 66,
110, 0, 68, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 84,
101, 120, 67, 111, 111, 114,
100, 0, 171, 171, 1, 0,
3, 0, 1, 0, 2, 0,
1, 0, 0, 0, 0, 0,
0, 0, 80, 111, 115, 105,
116, 105, 111, 110, 80, 83,
0, 171, 192, 2, 0, 0,
200, 2, 0, 0, 216, 2,
0, 0, 200, 2, 0, 0,
225, 2, 0, 0, 236, 2,
0, 0, 252, 2, 0, 0,
200, 2, 0, 0, 5, 0,
0, 0, 1, 0, 14, 0,
1, 0, 4, 0, 8, 3,
0, 0, 14, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 28, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 29, 0, 0, 0,
255, 255, 255, 255, 12, 0,
255, 255, 32, 0, 0, 0,
255, 255, 255, 255, 255, 255,
7, 0, 36, 0, 0, 0,
10, 0, 11, 0, 255, 255,
255, 255, 37, 0, 0, 0,
255, 255, 255, 255, 255, 255,
13, 0, 38, 0, 0, 0,
255, 255, 255, 255, 255, 255,
3, 0, 39, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 100, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 11, 0, 0, 0,
255, 255, 0, 0, 255, 255,
255, 255, 100, 111, 116, 72,
0, 171, 171, 171, 22, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 100, 111,
116, 76, 0, 171, 171, 171,
9, 0, 0, 0, 255, 255,
255, 255, 255, 255, 0, 0,
101, 121, 101, 86, 101, 99,
116, 111, 114, 0, 171, 171,
19, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
104, 97, 108, 102, 86, 101,
99, 116, 111, 114, 115, 0,
3, 0, 3, 0, 3, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 21, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 112, 111,
115, 95, 119, 115, 0, 171,
15, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
16, 0, 0, 0, 255, 255,
1, 0, 255, 255, 255, 255,
17, 0, 0, 0, 255, 255,
255, 255, 2, 0, 255, 255,
115, 112, 101, 99, 117, 108,
97, 114, 0, 171, 171, 171,
26, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
118, 105, 110, 0, 80, 111,
115, 105, 116, 105, 111, 110,
0, 78, 111, 114, 109, 97,
108, 0, 108, 4, 0, 0,
200, 2, 0, 0, 117, 4,
0, 0, 160, 3, 0, 0,
225, 2, 0, 0, 236, 2,
0, 0, 5, 0, 0, 0,
1, 0, 9, 0, 1, 0,
3, 0, 124, 4, 0, 0,
1, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
2, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
3, 0, 0, 0, 7, 0,
8, 0, 255, 255, 255, 255,
118, 111, 117, 116, 0, 80,
111, 115, 95, 112, 115, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 205, 4,
0, 0, 200, 2, 0, 0,
192, 2, 0, 0, 200, 2,
0, 0, 216, 2, 0, 0,
160, 3, 0, 0, 212, 4,
0, 0, 224, 4, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
240, 4, 0, 0, 33, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 34, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 35, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 119, 111,
114, 108, 100, 78, 111, 114,
109, 97, 108, 0, 8, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 122, 101,
114, 111, 76, 0, 171, 171,
10, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
0, 0, 0, 0, 84, 2,
0, 0, 92, 2, 0, 0,
1, 0, 0, 0, 108, 2,
0, 0, 120, 2, 0, 0,
131, 2, 0, 0, 144, 2,
0, 0, 1, 0, 0, 0,
160, 2, 0, 0, 0, 0,
0, 0, 172, 2, 0, 0,
40, 3, 0, 0, 8, 0,
0, 0, 56, 3, 0, 0,
0, 0, 0, 0, 152, 3,
0, 0, 160, 3, 0, 0,
1, 0, 0, 0, 176, 3,
0, 0, 0, 0, 0, 0,
188, 3, 0, 0, 160, 3,
0, 0, 1, 0, 0, 0,
196, 3, 0, 0, 0, 0,
0, 0, 208, 3, 0, 0,
160, 3, 0, 0, 1, 0,
0, 0, 216, 3, 0, 0,
0, 0, 0, 0, 228, 3,
0, 0, 160, 3, 0, 0,
1, 0, 0, 0, 240, 3,
0, 0, 0, 0, 0, 0,
252, 3, 0, 0, 8, 4,
0, 0, 1, 0, 0, 0,
24, 4, 0, 0, 0, 0,
0, 0, 36, 4, 0, 0,
200, 2, 0, 0, 3, 0,
0, 0, 44, 4, 0, 0,
0, 0, 0, 0, 80, 4,
0, 0, 160, 3, 0, 0,
1, 0, 0, 0, 92, 4,
0, 0, 172, 2, 0, 0,
104, 4, 0, 0, 148, 4,
0, 0, 3, 0, 0, 0,
164, 4, 0, 0, 0, 0,
0, 0, 200, 4, 0, 0,
16, 5, 0, 0, 3, 0,
0, 0, 32, 5, 0, 0,
0, 0, 0, 0, 68, 5,
0, 0, 160, 3, 0, 0,
1, 0, 0, 0, 80, 5,
0, 0, 0, 0, 0, 0,
92, 5, 0, 0, 160, 3,
0, 0, 1, 0, 0, 0,
100, 5, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
19, 0, 15, 160, 0, 0,
0, 64, 0, 0, 128, 191,
0, 0, 0, 0, 0, 0,
128, 63, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 31, 0, 0, 2,
5, 0, 2, 128, 2, 0,
15, 144, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
228, 144, 19, 0, 0, 160,
19, 0, 85, 160, 8, 0,
0, 3, 1, 0, 1, 128,
0, 0, 228, 128, 12, 0,
228, 160, 8, 0, 0, 3,
1, 0, 2, 128, 0, 0,
228, 128, 13, 0, 228, 160,
8, 0, 0, 3, 1, 0,
4, 128, 0, 0, 228, 128,
14, 0, 228, 160, 36, 0,
0, 2, 0, 0, 7, 128,
1, 0, 228, 128, 8, 0,
0, 3, 0, 0, 8, 128,
4, 0, 228, 161, 0, 0,
228, 128, 13, 0, 0, 3,
1, 0, 1, 128, 0, 0,
255, 128, 19, 0, 170, 160,
5, 0, 0, 3, 1, 0,
2, 128, 0, 0, 255, 128,
1, 0, 0, 128, 5, 0,
0, 3, 1, 0, 14, 128,
1, 0, 85, 128, 5, 0,
144, 160, 1, 0, 0, 2,
2, 0, 7, 128, 1, 0,
228, 160, 4, 0, 0, 4,
0, 0, 7, 224, 1, 0,
249, 128, 2, 0, 228, 128,
2, 0, 228, 160, 9, 0,
0, 3, 2, 0, 1, 128,
0, 0, 228, 144, 9, 0,
228, 160, 9, 0, 0, 3,
2, 0, 2, 128, 0, 0,
228, 144, 10, 0, 228, 160,
9, 0, 0, 3, 2, 0,
4, 128, 0, 0, 228, 144,
11, 0, 228, 160, 2, 0,
0, 3, 1, 0, 14, 128,
2, 0, 144, 129, 7, 0,
144, 160, 36, 0, 0, 2,
2, 0, 7, 128, 1, 0,
249, 128, 2, 0, 0, 3,
1, 0, 14, 128, 2, 0,
144, 128, 4, 0, 144, 161,
36, 0, 0, 2, 2, 0,
7, 128, 1, 0, 249, 128,
8, 0, 0, 3, 0, 0,
1, 128, 2, 0, 228, 128,
0, 0, 228, 128, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 19, 0,
170, 160, 5, 0, 0, 3,
0, 0, 1, 128, 1, 0,
0, 128, 0, 0, 0, 128,
32, 0, 0, 3, 1, 0,
1, 128, 0, 0, 0, 128,
3, 0, 255, 160, 5, 0,
0, 3, 0, 0, 1, 128,
0, 0, 255, 128, 1, 0,
0, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
0, 128, 6, 0, 228, 160,
5, 0, 0, 3, 1, 0,
7, 224, 0, 0, 228, 128,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 17, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 8, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
19, 0, 170, 160, 10, 0,
0, 3, 1, 0, 8, 224,
0, 0, 0, 128, 19, 0,
255, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 15, 0, 228, 160,
9, 0, 0, 3, 0, 0,
2, 128, 0, 0, 228, 144,
16, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 128,
0, 0, 228, 144, 18, 0,
228, 160, 4, 0, 0, 4,
0, 0, 3, 192, 0, 0,
170, 128, 0, 0, 228, 160,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 192,
0, 0, 170, 128, 1, 0,
0, 2, 0, 0, 8, 224,
1, 0, 255, 160, 1, 0,
0, 2, 2, 0, 3, 224,
2, 0, 228, 144, 255, 255,
0, 0, 83, 72, 68, 82,
24, 5, 0, 0, 64, 0,
1, 0, 70, 1, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
26, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 95, 0,
0, 3, 114, 16, 16, 0,
1, 0, 0, 0, 95, 0,
0, 3, 50, 16, 16, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 50, 32, 16, 0,
2, 0, 0, 0, 103, 0,
0, 4, 242, 32, 16, 0,
3, 0, 0, 0, 1, 0,
0, 0, 104, 0, 0, 2,
3, 0, 0, 0, 50, 0,
0, 15, 114, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
2, 64, 0, 0, 0, 0,
0, 64, 0, 0, 0, 64,
0, 0, 0, 64, 0, 0,
0, 0, 2, 64, 0, 0,
0, 0, 128, 191, 0, 0,
128, 191, 0, 0, 128, 191,
0, 0, 0, 0, 16, 0,
0, 8, 18, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 19, 0, 0, 0,
16, 0, 0, 8, 34, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 20, 0,
0, 0, 16, 0, 0, 8,
66, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
21, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 114, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 16, 0, 0, 9,
130, 0, 16, 0, 0, 0,
0, 0, 70, 130, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 29, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
1, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 1, 64, 0, 0,
0, 0, 128, 63, 56, 0,
0, 7, 34, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 56, 0, 0, 8,
226, 0, 16, 0, 1, 0,
0, 0, 86, 5, 16, 0,
1, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
6, 0, 0, 0, 50, 0,
0, 11, 114, 32, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
54, 0, 0, 6, 130, 32,
16, 0, 0, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
17, 0, 0, 8, 18, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 15, 0,
0, 0, 17, 0, 0, 8,
34, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
16, 0, 0, 0, 17, 0,
0, 8, 66, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 17, 0, 0, 0,
0, 0, 0, 9, 226, 0,
16, 0, 1, 0, 0, 0,
6, 9, 16, 128, 65, 0,
0, 0, 2, 0, 0, 0,
6, 137, 32, 0, 0, 0,
0, 0, 12, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 2, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 2, 0, 0, 0,
50, 0, 0, 11, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 6, 137,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 2, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
68, 0, 0, 5, 18, 0,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 56, 0, 0, 7,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 0,
16, 0, 2, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 52, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
0, 0, 56, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
47, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 58, 128,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 25, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 8, 114, 0, 16, 0,
0, 0, 0, 0, 6, 0,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 9, 0, 0, 0,
56, 0, 0, 8, 114, 32,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 17, 32, 0, 8,
130, 32, 16, 0, 1, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
14, 0, 0, 0, 54, 0,
0, 5, 50, 32, 16, 0,
2, 0, 0, 0, 70, 16,
16, 0, 2, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 22, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
23, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 24, 0, 0, 0,
17, 0, 0, 8, 130, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 25, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 108, 0,
0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 92, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
7, 7, 0, 0, 99, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
3, 3, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 78, 79,
82, 77, 65, 76, 0, 84,
69, 88, 67, 79, 79, 82,
68, 0, 79, 83, 71, 78,
132, 0, 0, 0, 4, 0,
0, 0, 8, 0, 0, 0,
104, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
104, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
110, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 12, 0, 0,
119, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171
};

View File

@@ -0,0 +1,876 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
// TEXCOORD 0 xy 2 NONE float xy
// COLOR 0 xyzw 3 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
dcl_texcoord2 v2 // vin<7,8>
dcl_texcoord3 v3 // vin<9,10,11,12>
#line 57 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c9 // ::pos_ws<0>
dp4 r0.y, v0, c10 // ::pos_ws<1>
dp4 r0.z, v0, c11 // ::pos_ws<2>
add r0.xyz, -r0, c7
nrm r1.xyz, r0 // ::eyeVector<0,1,2>
#line 33
add r0.xyz, r1, -c4
nrm r1.xyz, r0 // ::halfVectors<0,1,2>
#line 59
dp3 r0.x, v1, c12
dp3 r0.y, v1, c13
dp3 r0.z, v1, c14
nrm r2.xyz, r0 // ::worldNormal<0,1,2>
#line 37
dp3 r0.x, r1, r2 // ::dotH<0>
dp3 r0.y, -c4, r2 // ::dotL<0>
#line 42
max r0.x, r0.x, c19.x
#line 39
sge r0.z, r0.y, c19.x // ::zeroL<0>
#line 42
mul r0.x, r0.z, r0.x
mul r0.z, r0.y, r0.z // ::diffuse<0>
#line 46
mul r1.xyz, r0.z, c5
mov r2.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad r1.xyz, r1, r2, c2 // ::result<0,1,2>
#line 352 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.xyz, r1, v3 // ::VSBasicOneLightTxVc<0,1,2>
#line 42 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
pow r1.x, r0.x, c3.w
mul r0.x, r0.y, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightTxVc<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightTxVc<12>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.x
min oT1.w, r0.x, c19.y // ::VSBasicOneLightTxVc<7>
#line 352 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.w, v3.w, c1.w // ::VSBasicOneLightTxVc<3>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 344 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightTxVc<10,11>
mov oPos.w, r0.z // ::VSBasicOneLightTxVc<13>
#line 351
mov oT2.xy, v2 // ::VSBasicOneLightTxVc<8,9>
// approximately 44 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v3.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output_siv o3.xyzw, position
dcl_temps 3
dp3 r0.x, v1.xyzx, cb0[19].xyzx
dp3 r0.y, v1.xyzx, cb0[20].xyzx
dp3 r0.z, v1.xyzx, cb0[21].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad r1.yzw, r1.yyzw, cb0[0].xxyz, cb0[1].xxyz
mul o0.xyz, r1.yzwy, v3.xyzx
mul o0.w, v3.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
mov o2.xy, v2.xyxx
dp4 o3.x, v0.xyzw, cb0[22].xyzw
dp4 o3.y, v0.xyzw, cb0[23].xyzw
dp4 o3.z, v0.xyzw, cb0[24].xyzw
dp4 o3.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightTxVc[] =
{
68, 88, 66, 67, 142, 185,
48, 27, 238, 227, 226, 19,
201, 80, 120, 76, 141, 169,
217, 114, 1, 0, 0, 0,
72, 16, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
20, 10, 0, 0, 40, 15,
0, 0, 188, 15, 0, 0,
65, 111, 110, 57, 220, 9,
0, 0, 220, 9, 0, 0,
0, 2, 254, 255, 108, 9,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
186, 1, 68, 66, 85, 71,
40, 0, 0, 0, 188, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 41, 0, 0, 0,
20, 1, 0, 0, 14, 0,
0, 0, 164, 5, 0, 0,
144, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 190, 0, 0, 0,
0, 0, 255, 255, 240, 6,
0, 0, 0, 0, 255, 255,
8, 7, 0, 0, 0, 0,
255, 255, 20, 7, 0, 0,
0, 0, 255, 255, 32, 7,
0, 0, 0, 0, 255, 255,
44, 7, 0, 0, 57, 0,
0, 0, 56, 7, 0, 0,
57, 0, 0, 0, 72, 7,
0, 0, 57, 0, 0, 0,
88, 7, 0, 0, 58, 0,
0, 0, 104, 7, 0, 0,
58, 0, 0, 0, 120, 7,
0, 0, 33, 0, 0, 0,
132, 7, 0, 0, 33, 0,
0, 0, 148, 7, 0, 0,
59, 0, 0, 0, 160, 7,
0, 0, 59, 0, 0, 0,
176, 7, 0, 0, 59, 0,
0, 0, 192, 7, 0, 0,
59, 0, 0, 0, 208, 7,
0, 0, 37, 0, 0, 0,
220, 7, 0, 0, 36, 0,
0, 0, 236, 7, 0, 0,
42, 0, 0, 0, 252, 7,
0, 0, 39, 0, 0, 0,
12, 8, 0, 0, 42, 0,
0, 0, 28, 8, 0, 0,
41, 0, 0, 0, 44, 8,
0, 0, 46, 0, 0, 0,
60, 8, 0, 0, 46, 0,
0, 0, 76, 8, 0, 0,
46, 0, 0, 0, 88, 8,
0, 0, 96, 1, 1, 0,
108, 8, 0, 0, 42, 0,
0, 0, 124, 8, 0, 0,
42, 0, 0, 0, 140, 8,
0, 0, 47, 0, 0, 0,
156, 8, 0, 0, 47, 0,
0, 0, 172, 8, 0, 0,
63, 0, 0, 0, 188, 8,
0, 0, 14, 0, 2, 0,
204, 8, 0, 0, 14, 0,
2, 0, 220, 8, 0, 0,
14, 0, 2, 0, 236, 8,
0, 0, 96, 1, 1, 0,
252, 8, 0, 0, 63, 0,
0, 0, 12, 9, 0, 0,
63, 0, 0, 0, 28, 9,
0, 0, 63, 0, 0, 0,
44, 9, 0, 0, 88, 1,
1, 0, 60, 9, 0, 0,
88, 1, 1, 0, 80, 9,
0, 0, 95, 1, 1, 0,
92, 9, 0, 0, 80, 97,
114, 97, 109, 101, 116, 101,
114, 115, 0, 68, 105, 102,
102, 117, 115, 101, 67, 111,
108, 111, 114, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 23, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 86, 83, 66, 97,
115, 105, 99, 79, 110, 101,
76, 105, 103, 104, 116, 84,
120, 86, 99, 0, 68, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 84, 101, 120, 67, 111,
111, 114, 100, 0, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 80, 111,
115, 105, 116, 105, 111, 110,
80, 83, 0, 171, 164, 2,
0, 0, 172, 2, 0, 0,
188, 2, 0, 0, 172, 2,
0, 0, 197, 2, 0, 0,
208, 2, 0, 0, 224, 2,
0, 0, 172, 2, 0, 0,
5, 0, 0, 0, 1, 0,
14, 0, 1, 0, 4, 0,
236, 2, 0, 0, 25, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 29, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 30, 0,
0, 0, 255, 255, 255, 255,
12, 0, 255, 255, 33, 0,
0, 0, 255, 255, 255, 255,
255, 255, 7, 0, 34, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 38, 0,
0, 0, 10, 0, 11, 0,
255, 255, 255, 255, 39, 0,
0, 0, 255, 255, 255, 255,
255, 255, 13, 0, 40, 0,
0, 0, 8, 0, 9, 0,
255, 255, 255, 255, 100, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 21, 0,
0, 0, 255, 255, 255, 255,
0, 0, 255, 255, 100, 111,
116, 72, 0, 171, 171, 171,
16, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
100, 111, 116, 76, 0, 171,
171, 171, 17, 0, 0, 0,
255, 255, 0, 0, 255, 255,
255, 255, 101, 121, 101, 86,
101, 99, 116, 111, 114, 0,
171, 171, 9, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 104, 97, 108, 102,
86, 101, 99, 116, 111, 114,
115, 0, 3, 0, 3, 0,
3, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
11, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
112, 111, 115, 95, 119, 115,
0, 171, 5, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 6, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 7, 0, 0, 0,
255, 255, 255, 255, 2, 0,
255, 255, 114, 101, 115, 117,
108, 116, 0, 171, 164, 2,
0, 0, 132, 3, 0, 0,
188, 2, 0, 0, 132, 3,
0, 0, 5, 0, 0, 0,
1, 0, 6, 0, 1, 0,
2, 0, 60, 4, 0, 0,
24, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
115, 112, 101, 99, 117, 108,
97, 114, 0, 171, 171, 171,
27, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
118, 105, 110, 0, 80, 111,
115, 105, 116, 105, 111, 110,
0, 78, 111, 114, 109, 97,
108, 0, 67, 111, 108, 111,
114, 0, 171, 171, 132, 4,
0, 0, 172, 2, 0, 0,
141, 4, 0, 0, 132, 3,
0, 0, 197, 2, 0, 0,
208, 2, 0, 0, 148, 4,
0, 0, 172, 2, 0, 0,
5, 0, 0, 0, 1, 0,
13, 0, 1, 0, 4, 0,
156, 4, 0, 0, 1, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 2, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 3, 0,
0, 0, 7, 0, 8, 0,
255, 255, 255, 255, 4, 0,
0, 0, 9, 0, 10, 0,
11, 0, 12, 0, 118, 111,
117, 116, 0, 80, 111, 115,
95, 112, 115, 0, 70, 111,
103, 70, 97, 99, 116, 111,
114, 0, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 1, 5, 0, 0,
172, 2, 0, 0, 164, 2,
0, 0, 172, 2, 0, 0,
188, 2, 0, 0, 132, 3,
0, 0, 8, 5, 0, 0,
20, 5, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 4, 0, 36, 5,
0, 0, 35, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 36, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 37, 0, 0, 0,
255, 255, 255, 255, 3, 0,
255, 255, 119, 111, 114, 108,
100, 78, 111, 114, 109, 97,
108, 0, 15, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 122, 101, 114, 111,
76, 0, 171, 171, 19, 0,
0, 0, 255, 255, 255, 255,
0, 0, 255, 255, 92, 2,
0, 0, 103, 2, 0, 0,
116, 2, 0, 0, 1, 0,
0, 0, 132, 2, 0, 0,
0, 0, 0, 0, 144, 2,
0, 0, 12, 3, 0, 0,
8, 0, 0, 0, 28, 3,
0, 0, 0, 0, 0, 0,
124, 3, 0, 0, 132, 3,
0, 0, 1, 0, 0, 0,
148, 3, 0, 0, 0, 0,
0, 0, 160, 3, 0, 0,
132, 3, 0, 0, 1, 0,
0, 0, 168, 3, 0, 0,
0, 0, 0, 0, 180, 3,
0, 0, 132, 3, 0, 0,
1, 0, 0, 0, 188, 3,
0, 0, 0, 0, 0, 0,
200, 3, 0, 0, 132, 3,
0, 0, 1, 0, 0, 0,
212, 3, 0, 0, 0, 0,
0, 0, 224, 3, 0, 0,
236, 3, 0, 0, 1, 0,
0, 0, 252, 3, 0, 0,
0, 0, 0, 0, 8, 4,
0, 0, 172, 2, 0, 0,
3, 0, 0, 0, 16, 4,
0, 0, 0, 0, 0, 0,
52, 4, 0, 0, 76, 4,
0, 0, 1, 0, 0, 0,
92, 4, 0, 0, 0, 0,
0, 0, 104, 4, 0, 0,
132, 3, 0, 0, 1, 0,
0, 0, 116, 4, 0, 0,
144, 2, 0, 0, 128, 4,
0, 0, 188, 4, 0, 0,
4, 0, 0, 0, 204, 4,
0, 0, 0, 0, 0, 0,
252, 4, 0, 0, 68, 5,
0, 0, 3, 0, 0, 0,
84, 5, 0, 0, 0, 0,
0, 0, 120, 5, 0, 0,
132, 3, 0, 0, 1, 0,
0, 0, 132, 5, 0, 0,
0, 0, 0, 0, 144, 5,
0, 0, 132, 3, 0, 0,
1, 0, 0, 0, 152, 5,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
81, 0, 0, 5, 19, 0,
15, 160, 0, 0, 0, 0,
0, 0, 128, 63, 0, 0,
0, 0, 0, 0, 0, 0,
31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144,
31, 0, 0, 2, 5, 0,
1, 128, 1, 0, 15, 144,
31, 0, 0, 2, 5, 0,
2, 128, 2, 0, 15, 144,
31, 0, 0, 2, 5, 0,
3, 128, 3, 0, 15, 144,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
9, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 10, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 11, 0, 228, 160,
2, 0, 0, 3, 0, 0,
7, 128, 0, 0, 228, 129,
7, 0, 228, 160, 36, 0,
0, 2, 1, 0, 7, 128,
0, 0, 228, 128, 2, 0,
0, 3, 0, 0, 7, 128,
1, 0, 228, 128, 4, 0,
228, 161, 36, 0, 0, 2,
1, 0, 7, 128, 0, 0,
228, 128, 8, 0, 0, 3,
0, 0, 1, 128, 1, 0,
228, 144, 12, 0, 228, 160,
8, 0, 0, 3, 0, 0,
2, 128, 1, 0, 228, 144,
13, 0, 228, 160, 8, 0,
0, 3, 0, 0, 4, 128,
1, 0, 228, 144, 14, 0,
228, 160, 36, 0, 0, 2,
2, 0, 7, 128, 0, 0,
228, 128, 8, 0, 0, 3,
0, 0, 1, 128, 1, 0,
228, 128, 2, 0, 228, 128,
8, 0, 0, 3, 0, 0,
2, 128, 4, 0, 228, 161,
2, 0, 228, 128, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 19, 0,
0, 160, 13, 0, 0, 3,
0, 0, 4, 128, 0, 0,
85, 128, 19, 0, 0, 160,
5, 0, 0, 3, 0, 0,
1, 128, 0, 0, 170, 128,
0, 0, 0, 128, 5, 0,
0, 3, 0, 0, 4, 128,
0, 0, 85, 128, 0, 0,
170, 128, 5, 0, 0, 3,
1, 0, 7, 128, 0, 0,
170, 128, 5, 0, 228, 160,
1, 0, 0, 2, 2, 0,
7, 128, 1, 0, 228, 160,
4, 0, 0, 4, 1, 0,
7, 128, 1, 0, 228, 128,
2, 0, 228, 128, 2, 0,
228, 160, 5, 0, 0, 3,
0, 0, 7, 224, 1, 0,
228, 128, 3, 0, 228, 144,
32, 0, 0, 3, 1, 0,
1, 128, 0, 0, 0, 128,
3, 0, 255, 160, 5, 0,
0, 3, 0, 0, 1, 128,
0, 0, 85, 128, 1, 0,
0, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
0, 128, 6, 0, 228, 160,
5, 0, 0, 3, 1, 0,
7, 224, 0, 0, 228, 128,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 17, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 8, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
19, 0, 0, 160, 10, 0,
0, 3, 1, 0, 8, 224,
0, 0, 0, 128, 19, 0,
85, 160, 5, 0, 0, 3,
0, 0, 8, 224, 3, 0,
255, 144, 1, 0, 255, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
15, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 16, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 18, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 1, 0, 0, 2,
2, 0, 3, 224, 2, 0,
228, 144, 255, 255, 0, 0,
83, 72, 68, 82, 12, 5,
0, 0, 64, 0, 1, 0,
67, 1, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 26, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 95, 0, 0, 3,
114, 16, 16, 0, 1, 0,
0, 0, 95, 0, 0, 3,
50, 16, 16, 0, 2, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 3, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
50, 32, 16, 0, 2, 0,
0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 3, 0,
0, 0, 1, 0, 0, 0,
104, 0, 0, 2, 3, 0,
0, 0, 16, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
19, 0, 0, 0, 16, 0,
0, 8, 34, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 20, 0, 0, 0,
16, 0, 0, 8, 66, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 21, 0,
0, 0, 16, 0, 0, 7,
130, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
68, 0, 0, 5, 130, 0,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
114, 0, 16, 0, 0, 0,
0, 0, 246, 15, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
16, 0, 0, 9, 130, 0,
16, 0, 0, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
29, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 1, 0,
0, 7, 18, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 56, 0, 0, 7,
34, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
56, 0, 0, 8, 226, 0,
16, 0, 1, 0, 0, 0,
86, 5, 16, 0, 1, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 6, 0,
0, 0, 50, 0, 0, 11,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 56, 0,
0, 7, 114, 32, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 18, 16, 0, 3, 0,
0, 0, 56, 0, 0, 8,
130, 32, 16, 0, 0, 0,
0, 0, 58, 16, 16, 0,
3, 0, 0, 0, 58, 128,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 0,
0, 8, 18, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 15, 0, 0, 0,
17, 0, 0, 8, 34, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 16, 0,
0, 0, 17, 0, 0, 8,
66, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
17, 0, 0, 0, 0, 0,
0, 9, 226, 0, 16, 0,
1, 0, 0, 0, 6, 9,
16, 128, 65, 0, 0, 0,
2, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
12, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
2, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
2, 0, 0, 0, 50, 0,
0, 11, 226, 0, 16, 0,
1, 0, 0, 0, 86, 14,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 2, 0,
0, 0, 6, 137, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 2, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 2, 0, 0, 0,
56, 0, 0, 7, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 52, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 47, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 25, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
114, 0, 16, 0, 0, 0,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
9, 0, 0, 0, 56, 0,
0, 8, 114, 32, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 2, 0, 0, 0,
17, 32, 0, 8, 130, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 54, 0, 0, 5,
50, 32, 16, 0, 2, 0,
0, 0, 70, 16, 16, 0,
2, 0, 0, 0, 17, 0,
0, 8, 18, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 22, 0, 0, 0,
17, 0, 0, 8, 34, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 23, 0,
0, 0, 17, 0, 0, 8,
66, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
24, 0, 0, 0, 17, 0,
0, 8, 130, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 25, 0, 0, 0,
62, 0, 0, 1, 73, 83,
71, 78, 140, 0, 0, 0,
4, 0, 0, 0, 8, 0,
0, 0, 104, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 116, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 7, 7,
0, 0, 123, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 3, 3,
0, 0, 132, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
3, 0, 0, 0, 15, 15,
0, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 78, 79, 82, 77,
65, 76, 0, 84, 69, 88,
67, 79, 79, 82, 68, 0,
67, 79, 76, 79, 82, 0,
171, 171, 79, 83, 71, 78,
132, 0, 0, 0, 4, 0,
0, 0, 8, 0, 0, 0,
104, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
104, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
110, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 12, 0, 0,
119, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
67, 79, 76, 79, 82, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171
};

View File

@@ -0,0 +1,905 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
// TEXCOORD 0 xy 2 NONE float xy
// COLOR 0 xyzw 3 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 2, -1, 0, 1
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
dcl_texcoord2 v2 // vin<7,8>
dcl_texcoord3 v3 // vin<9,10,11,12>
#line 57 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c9 // ::pos_ws<0>
dp4 r0.y, v0, c10 // ::pos_ws<1>
dp4 r0.z, v0, c11 // ::pos_ws<2>
add r0.xyz, -r0, c7
nrm r1.xyz, r0 // ::eyeVector<0,1,2>
#line 33
add r0.xyz, r1, -c4
nrm r1.xyz, r0 // ::halfVectors<0,1,2>
#line 32 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, v1, c19.x, c19.y // ::BiasX2<0,1,2>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r2.x, r0, c12
dp3 r2.y, r0, c13
dp3 r2.z, r0, c14
nrm r0.xyz, r2 // ::worldNormal<0,1,2>
#line 37
dp3 r0.w, r1, r0 // ::dotH<0>
dp3 r0.x, -c4, r0 // ::dotL<0>
#line 42
max r0.y, r0.w, c19.z
#line 39
sge r0.z, r0.x, c19.z // ::zeroL<0>
#line 42
mul r0.y, r0.z, r0.y
mul r0.z, r0.x, r0.z // ::diffuse<0>
#line 46
mul r1.xyz, r0.z, c5
mov r2.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad r1.xyz, r1, r2, c2 // ::result<0,1,2>
#line 367 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.xyz, r1, v3 // ::VSBasicOneLightTxVcBn<0,1,2>
#line 42 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
pow r1.x, r0.y, c3.w
mul r0.x, r0.x, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightTxVcBn<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightTxVcBn<12>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.z
min oT1.w, r0.x, c19.w // ::VSBasicOneLightTxVcBn<7>
#line 367 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.w, v3.w, c1.w // ::VSBasicOneLightTxVcBn<3>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 357 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightTxVcBn<10,11>
mov oPos.w, r0.z // ::VSBasicOneLightTxVcBn<13>
#line 366
mov oT2.xy, v2 // ::VSBasicOneLightTxVcBn<8,9>
// approximately 45 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v3.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output_siv o3.xyzw, position
dcl_temps 3
mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.x, r0.xyzx, cb0[19].xyzx
dp3 r1.y, r0.xyzx, cb0[20].xyzx
dp3 r1.z, r0.xyzx, cb0[21].xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r1.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad r1.yzw, r1.yyzw, cb0[0].xxyz, cb0[1].xxyz
mul o0.xyz, r1.yzwy, v3.xyzx
mul o0.w, v3.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
mov o2.xy, v2.xyxx
dp4 o3.x, v0.xyzw, cb0[22].xyzw
dp4 o3.y, v0.xyzw, cb0[23].xyzw
dp4 o3.z, v0.xyzw, cb0[24].xyzw
dp4 o3.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightTxVcBn[] =
{
68, 88, 66, 67, 184, 199,
115, 14, 219, 27, 227, 201,
185, 136, 146, 98, 114, 141,
170, 146, 1, 0, 0, 0,
220, 16, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
108, 10, 0, 0, 188, 15,
0, 0, 80, 16, 0, 0,
65, 111, 110, 57, 52, 10,
0, 0, 52, 10, 0, 0,
0, 2, 254, 255, 196, 9,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
203, 1, 68, 66, 85, 71,
40, 0, 0, 0, 0, 7,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 42, 0, 0, 0,
20, 1, 0, 0, 15, 0,
0, 0, 212, 5, 0, 0,
188, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 52, 7,
0, 0, 0, 0, 255, 255,
76, 7, 0, 0, 0, 0,
255, 255, 88, 7, 0, 0,
0, 0, 255, 255, 100, 7,
0, 0, 0, 0, 255, 255,
112, 7, 0, 0, 57, 0,
0, 0, 124, 7, 0, 0,
57, 0, 0, 0, 140, 7,
0, 0, 57, 0, 0, 0,
156, 7, 0, 0, 58, 0,
0, 0, 172, 7, 0, 0,
58, 0, 0, 0, 188, 7,
0, 0, 33, 0, 0, 0,
200, 7, 0, 0, 33, 0,
0, 0, 216, 7, 0, 0,
32, 0, 1, 0, 228, 7,
0, 0, 59, 0, 0, 0,
248, 7, 0, 0, 59, 0,
0, 0, 8, 8, 0, 0,
59, 0, 0, 0, 24, 8,
0, 0, 59, 0, 0, 0,
40, 8, 0, 0, 37, 0,
0, 0, 52, 8, 0, 0,
36, 0, 0, 0, 68, 8,
0, 0, 42, 0, 0, 0,
84, 8, 0, 0, 39, 0,
0, 0, 100, 8, 0, 0,
42, 0, 0, 0, 116, 8,
0, 0, 41, 0, 0, 0,
132, 8, 0, 0, 46, 0,
0, 0, 148, 8, 0, 0,
46, 0, 0, 0, 164, 8,
0, 0, 46, 0, 0, 0,
176, 8, 0, 0, 111, 1,
2, 0, 196, 8, 0, 0,
42, 0, 0, 0, 212, 8,
0, 0, 42, 0, 0, 0,
228, 8, 0, 0, 47, 0,
0, 0, 244, 8, 0, 0,
47, 0, 0, 0, 4, 9,
0, 0, 63, 0, 0, 0,
20, 9, 0, 0, 14, 0,
1, 0, 36, 9, 0, 0,
14, 0, 1, 0, 52, 9,
0, 0, 14, 0, 1, 0,
68, 9, 0, 0, 111, 1,
2, 0, 84, 9, 0, 0,
63, 0, 0, 0, 100, 9,
0, 0, 63, 0, 0, 0,
116, 9, 0, 0, 63, 0,
0, 0, 132, 9, 0, 0,
101, 1, 2, 0, 148, 9,
0, 0, 101, 1, 2, 0,
168, 9, 0, 0, 110, 1,
2, 0, 180, 9, 0, 0,
66, 105, 97, 115, 88, 50,
0, 171, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
12, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
80, 97, 114, 97, 109, 101,
116, 101, 114, 115, 0, 68,
105, 102, 102, 117, 115, 101,
67, 111, 108, 111, 114, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 24, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 86, 83,
66, 97, 115, 105, 99, 79,
110, 101, 76, 105, 103, 104,
116, 84, 120, 86, 99, 66,
110, 0, 68, 105, 102, 102,
117, 115, 101, 0, 171, 171,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 83, 112,
101, 99, 117, 108, 97, 114,
0, 84, 101, 120, 67, 111,
111, 114, 100, 0, 171, 171,
1, 0, 3, 0, 1, 0,
2, 0, 1, 0, 0, 0,
0, 0, 0, 0, 80, 111,
115, 105, 116, 105, 111, 110,
80, 83, 0, 171, 210, 2,
0, 0, 220, 2, 0, 0,
236, 2, 0, 0, 220, 2,
0, 0, 245, 2, 0, 0,
0, 3, 0, 0, 16, 3,
0, 0, 220, 2, 0, 0,
5, 0, 0, 0, 1, 0,
14, 0, 1, 0, 4, 0,
28, 3, 0, 0, 26, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 30, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 31, 0,
0, 0, 255, 255, 255, 255,
12, 0, 255, 255, 34, 0,
0, 0, 255, 255, 255, 255,
255, 255, 7, 0, 35, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 39, 0,
0, 0, 10, 0, 11, 0,
255, 255, 255, 255, 40, 0,
0, 0, 255, 255, 255, 255,
255, 255, 13, 0, 41, 0,
0, 0, 8, 0, 9, 0,
255, 255, 255, 255, 100, 105,
102, 102, 117, 115, 101, 0,
1, 0, 3, 0, 1, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 22, 0,
0, 0, 255, 255, 255, 255,
0, 0, 255, 255, 100, 111,
116, 72, 0, 171, 171, 171,
17, 0, 0, 0, 255, 255,
255, 255, 255, 255, 0, 0,
100, 111, 116, 76, 0, 171,
171, 171, 18, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 101, 121, 101, 86,
101, 99, 116, 111, 114, 0,
171, 171, 9, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 104, 97, 108, 102,
86, 101, 99, 116, 111, 114,
115, 0, 3, 0, 3, 0,
3, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
11, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
112, 111, 115, 95, 119, 115,
0, 171, 5, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 6, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 7, 0, 0, 0,
255, 255, 255, 255, 2, 0,
255, 255, 114, 101, 115, 117,
108, 116, 0, 171, 210, 2,
0, 0, 180, 3, 0, 0,
236, 2, 0, 0, 180, 3,
0, 0, 5, 0, 0, 0,
1, 0, 6, 0, 1, 0,
2, 0, 108, 4, 0, 0,
25, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
115, 112, 101, 99, 117, 108,
97, 114, 0, 171, 171, 171,
28, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
118, 105, 110, 0, 80, 111,
115, 105, 116, 105, 111, 110,
0, 78, 111, 114, 109, 97,
108, 0, 67, 111, 108, 111,
114, 0, 171, 171, 180, 4,
0, 0, 220, 2, 0, 0,
189, 4, 0, 0, 180, 3,
0, 0, 245, 2, 0, 0,
0, 3, 0, 0, 196, 4,
0, 0, 220, 2, 0, 0,
5, 0, 0, 0, 1, 0,
13, 0, 1, 0, 4, 0,
204, 4, 0, 0, 1, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 2, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 3, 0,
0, 0, 7, 0, 8, 0,
255, 255, 255, 255, 4, 0,
0, 0, 9, 0, 10, 0,
11, 0, 12, 0, 118, 111,
117, 116, 0, 80, 111, 115,
95, 112, 115, 0, 70, 111,
103, 70, 97, 99, 116, 111,
114, 0, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 49, 5, 0, 0,
220, 2, 0, 0, 210, 2,
0, 0, 220, 2, 0, 0,
236, 2, 0, 0, 180, 3,
0, 0, 56, 5, 0, 0,
68, 5, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 4, 0, 84, 5,
0, 0, 36, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 37, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 38, 0, 0, 0,
255, 255, 255, 255, 3, 0,
255, 255, 119, 111, 114, 108,
100, 78, 111, 114, 109, 97,
108, 0, 16, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 122, 101, 114, 111,
76, 0, 171, 171, 20, 0,
0, 0, 255, 255, 255, 255,
0, 0, 255, 255, 0, 0,
0, 0, 100, 2, 0, 0,
108, 2, 0, 0, 1, 0,
0, 0, 124, 2, 0, 0,
136, 2, 0, 0, 147, 2,
0, 0, 160, 2, 0, 0,
1, 0, 0, 0, 176, 2,
0, 0, 0, 0, 0, 0,
188, 2, 0, 0, 60, 3,
0, 0, 8, 0, 0, 0,
76, 3, 0, 0, 0, 0,
0, 0, 172, 3, 0, 0,
180, 3, 0, 0, 1, 0,
0, 0, 196, 3, 0, 0,
0, 0, 0, 0, 208, 3,
0, 0, 180, 3, 0, 0,
1, 0, 0, 0, 216, 3,
0, 0, 0, 0, 0, 0,
228, 3, 0, 0, 180, 3,
0, 0, 1, 0, 0, 0,
236, 3, 0, 0, 0, 0,
0, 0, 248, 3, 0, 0,
180, 3, 0, 0, 1, 0,
0, 0, 4, 4, 0, 0,
0, 0, 0, 0, 16, 4,
0, 0, 28, 4, 0, 0,
1, 0, 0, 0, 44, 4,
0, 0, 0, 0, 0, 0,
56, 4, 0, 0, 220, 2,
0, 0, 3, 0, 0, 0,
64, 4, 0, 0, 0, 0,
0, 0, 100, 4, 0, 0,
124, 4, 0, 0, 1, 0,
0, 0, 140, 4, 0, 0,
0, 0, 0, 0, 152, 4,
0, 0, 180, 3, 0, 0,
1, 0, 0, 0, 164, 4,
0, 0, 188, 2, 0, 0,
176, 4, 0, 0, 236, 4,
0, 0, 4, 0, 0, 0,
252, 4, 0, 0, 0, 0,
0, 0, 44, 5, 0, 0,
116, 5, 0, 0, 3, 0,
0, 0, 132, 5, 0, 0,
0, 0, 0, 0, 168, 5,
0, 0, 180, 3, 0, 0,
1, 0, 0, 0, 180, 5,
0, 0, 0, 0, 0, 0,
192, 5, 0, 0, 180, 3,
0, 0, 1, 0, 0, 0,
200, 5, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
19, 0, 15, 160, 0, 0,
0, 64, 0, 0, 128, 191,
0, 0, 0, 0, 0, 0,
128, 63, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 31, 0, 0, 2,
5, 0, 2, 128, 2, 0,
15, 144, 31, 0, 0, 2,
5, 0, 3, 128, 3, 0,
15, 144, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 9, 0, 228, 160,
9, 0, 0, 3, 0, 0,
2, 128, 0, 0, 228, 144,
10, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 128,
0, 0, 228, 144, 11, 0,
228, 160, 2, 0, 0, 3,
0, 0, 7, 128, 0, 0,
228, 129, 7, 0, 228, 160,
36, 0, 0, 2, 1, 0,
7, 128, 0, 0, 228, 128,
2, 0, 0, 3, 0, 0,
7, 128, 1, 0, 228, 128,
4, 0, 228, 161, 36, 0,
0, 2, 1, 0, 7, 128,
0, 0, 228, 128, 4, 0,
0, 4, 0, 0, 7, 128,
1, 0, 228, 144, 19, 0,
0, 160, 19, 0, 85, 160,
8, 0, 0, 3, 2, 0,
1, 128, 0, 0, 228, 128,
12, 0, 228, 160, 8, 0,
0, 3, 2, 0, 2, 128,
0, 0, 228, 128, 13, 0,
228, 160, 8, 0, 0, 3,
2, 0, 4, 128, 0, 0,
228, 128, 14, 0, 228, 160,
36, 0, 0, 2, 0, 0,
7, 128, 2, 0, 228, 128,
8, 0, 0, 3, 0, 0,
8, 128, 1, 0, 228, 128,
0, 0, 228, 128, 8, 0,
0, 3, 0, 0, 1, 128,
4, 0, 228, 161, 0, 0,
228, 128, 11, 0, 0, 3,
0, 0, 2, 128, 0, 0,
255, 128, 19, 0, 170, 160,
13, 0, 0, 3, 0, 0,
4, 128, 0, 0, 0, 128,
19, 0, 170, 160, 5, 0,
0, 3, 0, 0, 2, 128,
0, 0, 170, 128, 0, 0,
85, 128, 5, 0, 0, 3,
0, 0, 4, 128, 0, 0,
0, 128, 0, 0, 170, 128,
5, 0, 0, 3, 1, 0,
7, 128, 0, 0, 170, 128,
5, 0, 228, 160, 1, 0,
0, 2, 2, 0, 7, 128,
1, 0, 228, 160, 4, 0,
0, 4, 1, 0, 7, 128,
1, 0, 228, 128, 2, 0,
228, 128, 2, 0, 228, 160,
5, 0, 0, 3, 0, 0,
7, 224, 1, 0, 228, 128,
3, 0, 228, 144, 32, 0,
0, 3, 1, 0, 1, 128,
0, 0, 85, 128, 3, 0,
255, 160, 5, 0, 0, 3,
0, 0, 1, 128, 0, 0,
0, 128, 1, 0, 0, 128,
5, 0, 0, 3, 0, 0,
7, 128, 0, 0, 0, 128,
6, 0, 228, 160, 5, 0,
0, 3, 1, 0, 7, 224,
0, 0, 228, 128, 3, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 192, 0, 0,
228, 144, 17, 0, 228, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
8, 0, 228, 160, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 19, 0,
170, 160, 10, 0, 0, 3,
1, 0, 8, 224, 0, 0,
0, 128, 19, 0, 255, 160,
5, 0, 0, 3, 0, 0,
8, 224, 3, 0, 255, 144,
1, 0, 255, 160, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 15, 0,
228, 160, 9, 0, 0, 3,
0, 0, 2, 128, 0, 0,
228, 144, 16, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 128, 0, 0, 228, 144,
18, 0, 228, 160, 4, 0,
0, 4, 0, 0, 3, 192,
0, 0, 170, 128, 0, 0,
228, 160, 0, 0, 228, 128,
1, 0, 0, 2, 0, 0,
8, 192, 0, 0, 170, 128,
1, 0, 0, 2, 2, 0,
3, 224, 2, 0, 228, 144,
255, 255, 0, 0, 83, 72,
68, 82, 72, 5, 0, 0,
64, 0, 1, 0, 82, 1,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 26, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 114, 16,
16, 0, 1, 0, 0, 0,
95, 0, 0, 3, 50, 16,
16, 0, 2, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 3, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 50, 32,
16, 0, 2, 0, 0, 0,
103, 0, 0, 4, 242, 32,
16, 0, 3, 0, 0, 0,
1, 0, 0, 0, 104, 0,
0, 2, 3, 0, 0, 0,
50, 0, 0, 15, 114, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 64, 0, 0,
0, 64, 0, 0, 0, 64,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 191,
0, 0, 128, 191, 0, 0,
128, 191, 0, 0, 0, 0,
16, 0, 0, 8, 18, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 19, 0,
0, 0, 16, 0, 0, 8,
34, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
20, 0, 0, 0, 16, 0,
0, 8, 66, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 21, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 114, 0,
16, 0, 0, 0, 0, 0,
6, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 16, 0,
0, 9, 130, 0, 16, 0,
0, 0, 0, 0, 70, 130,
32, 128, 65, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 29, 0,
0, 7, 18, 0, 16, 0,
1, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0,
0, 0, 1, 0, 0, 7,
18, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 1, 64,
0, 0, 0, 0, 128, 63,
56, 0, 0, 7, 34, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
1, 0, 0, 0, 56, 0,
0, 8, 226, 0, 16, 0,
1, 0, 0, 0, 86, 5,
16, 0, 1, 0, 0, 0,
6, 137, 32, 0, 0, 0,
0, 0, 6, 0, 0, 0,
50, 0, 0, 11, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 56, 0, 0, 7,
114, 32, 16, 0, 0, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 70, 18,
16, 0, 3, 0, 0, 0,
56, 0, 0, 8, 130, 32,
16, 0, 0, 0, 0, 0,
58, 16, 16, 0, 3, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 17, 0, 0, 8,
18, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
15, 0, 0, 0, 17, 0,
0, 8, 34, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 16, 0, 0, 0,
17, 0, 0, 8, 66, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 17, 0,
0, 0, 0, 0, 0, 9,
226, 0, 16, 0, 1, 0,
0, 0, 6, 9, 16, 128,
65, 0, 0, 0, 2, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 12, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 2, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
68, 0, 0, 5, 18, 0,
16, 0, 2, 0, 0, 0,
10, 0, 16, 0, 2, 0,
0, 0, 50, 0, 0, 11,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 0,
16, 0, 2, 0, 0, 0,
6, 137, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
2, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
2, 0, 0, 0, 56, 0,
0, 7, 226, 0, 16, 0,
1, 0, 0, 0, 86, 14,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 2, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
52, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 56, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 47, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 8, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 2, 0, 0, 0,
25, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 114, 0,
16, 0, 0, 0, 0, 0,
6, 0, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 9, 0,
0, 0, 56, 0, 0, 8,
114, 32, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 17, 32,
0, 8, 130, 32, 16, 0,
1, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 14, 0, 0, 0,
54, 0, 0, 5, 50, 32,
16, 0, 2, 0, 0, 0,
70, 16, 16, 0, 2, 0,
0, 0, 17, 0, 0, 8,
18, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
22, 0, 0, 0, 17, 0,
0, 8, 34, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 23, 0, 0, 0,
17, 0, 0, 8, 66, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 24, 0,
0, 0, 17, 0, 0, 8,
130, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
25, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
140, 0, 0, 0, 4, 0,
0, 0, 8, 0, 0, 0,
104, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
116, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 7, 0, 0,
123, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 3, 3, 0, 0,
132, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
78, 79, 82, 77, 65, 76,
0, 84, 69, 88, 67, 79,
79, 82, 68, 0, 67, 79,
76, 79, 82, 0, 171, 171,
79, 83, 71, 78, 132, 0,
0, 0, 4, 0, 0, 0,
8, 0, 0, 0, 104, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 104, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
15, 0, 0, 0, 110, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
3, 12, 0, 0, 119, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 3, 0, 0, 0,
15, 0, 0, 0, 67, 79,
76, 79, 82, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 83, 86, 95, 80, 111,
115, 105, 116, 105, 111, 110,
0, 171
};

View File

@@ -0,0 +1,831 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
// COLOR 0 xyzw 2 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
dcl_texcoord2 v2 // vin<7,8,9,10>
#line 57 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c9 // ::pos_ws<0>
dp4 r0.y, v0, c10 // ::pos_ws<1>
dp4 r0.z, v0, c11 // ::pos_ws<2>
add r0.xyz, -r0, c7
nrm r1.xyz, r0 // ::eyeVector<0,1,2>
#line 33
add r0.xyz, r1, -c4
nrm r1.xyz, r0 // ::halfVectors<0,1,2>
#line 59
dp3 r0.x, v1, c12
dp3 r0.y, v1, c13
dp3 r0.z, v1, c14
nrm r2.xyz, r0 // ::worldNormal<0,1,2>
#line 37
dp3 r0.x, r1, r2 // ::dotH<0>
dp3 r0.y, -c4, r2 // ::dotL<0>
#line 42
max r0.x, r0.x, c19.x
#line 39
sge r0.z, r0.y, c19.x // ::zeroL<0>
#line 42
mul r0.x, r0.z, r0.x
mul r0.z, r0.y, r0.z // ::diffuse<0>
#line 46
mul r1.xyz, r0.z, c5
mov r2.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad r1.xyz, r1, r2, c2 // ::result<0,1,2>
#line 295 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.xyz, r1, v2 // ::VSBasicOneLightVc<0,1,2>
#line 42 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
pow r1.x, r0.x, c3.w
mul r0.x, r0.y, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightVc<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightVc<10>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.x
min oT1.w, r0.x, c19.y // ::VSBasicOneLightVc<7>
#line 295 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.w, v2.w, c1.w // ::VSBasicOneLightVc<3>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 288 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightVc<8,9>
mov oPos.w, r0.z // ::VSBasicOneLightVc<11>
// approximately 43 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 3
dp3 r0.x, v1.xyzx, cb0[19].xyzx
dp3 r0.y, v1.xyzx, cb0[20].xyzx
dp3 r0.z, v1.xyzx, cb0[21].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad r1.yzw, r1.yyzw, cb0[0].xxyz, cb0[1].xxyz
mul o0.xyz, r1.yzwy, v2.xyzx
mul o0.w, v2.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
dp4 o2.x, v0.xyzw, cb0[22].xyzw
dp4 o2.y, v0.xyzw, cb0[23].xyzw
dp4 o2.z, v0.xyzw, cb0[24].xyzw
dp4 o2.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightVc[] =
{
68, 88, 66, 67, 70, 215,
141, 216, 72, 191, 225, 237,
12, 52, 127, 198, 67, 99,
28, 86, 1, 0, 0, 0,
112, 15, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
168, 9, 0, 0, 144, 14,
0, 0, 4, 15, 0, 0,
65, 111, 110, 57, 112, 9,
0, 0, 112, 9, 0, 0,
0, 2, 254, 255, 0, 9,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
165, 1, 68, 66, 85, 71,
40, 0, 0, 0, 104, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 39, 0, 0, 0,
20, 1, 0, 0, 14, 0,
0, 0, 80, 5, 0, 0,
128, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 67,
111, 109, 109, 111, 110, 46,
102, 120, 104, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 190, 0, 0, 0,
0, 0, 255, 255, 156, 6,
0, 0, 0, 0, 255, 255,
180, 6, 0, 0, 0, 0,
255, 255, 192, 6, 0, 0,
0, 0, 255, 255, 204, 6,
0, 0, 57, 0, 0, 0,
216, 6, 0, 0, 57, 0,
0, 0, 232, 6, 0, 0,
57, 0, 0, 0, 248, 6,
0, 0, 58, 0, 0, 0,
8, 7, 0, 0, 58, 0,
0, 0, 24, 7, 0, 0,
33, 0, 0, 0, 36, 7,
0, 0, 33, 0, 0, 0,
52, 7, 0, 0, 59, 0,
0, 0, 64, 7, 0, 0,
59, 0, 0, 0, 80, 7,
0, 0, 59, 0, 0, 0,
96, 7, 0, 0, 59, 0,
0, 0, 112, 7, 0, 0,
37, 0, 0, 0, 124, 7,
0, 0, 36, 0, 0, 0,
140, 7, 0, 0, 42, 0,
0, 0, 156, 7, 0, 0,
39, 0, 0, 0, 172, 7,
0, 0, 42, 0, 0, 0,
188, 7, 0, 0, 41, 0,
0, 0, 204, 7, 0, 0,
46, 0, 0, 0, 220, 7,
0, 0, 46, 0, 0, 0,
236, 7, 0, 0, 46, 0,
0, 0, 248, 7, 0, 0,
39, 1, 1, 0, 12, 8,
0, 0, 42, 0, 0, 0,
28, 8, 0, 0, 42, 0,
0, 0, 44, 8, 0, 0,
47, 0, 0, 0, 60, 8,
0, 0, 47, 0, 0, 0,
76, 8, 0, 0, 63, 0,
0, 0, 92, 8, 0, 0,
14, 0, 2, 0, 108, 8,
0, 0, 14, 0, 2, 0,
124, 8, 0, 0, 14, 0,
2, 0, 140, 8, 0, 0,
39, 1, 1, 0, 156, 8,
0, 0, 63, 0, 0, 0,
172, 8, 0, 0, 63, 0,
0, 0, 188, 8, 0, 0,
63, 0, 0, 0, 204, 8,
0, 0, 32, 1, 1, 0,
220, 8, 0, 0, 32, 1,
1, 0, 240, 8, 0, 0,
80, 97, 114, 97, 109, 101,
116, 101, 114, 115, 0, 68,
105, 102, 102, 117, 115, 101,
67, 111, 108, 111, 114, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 22, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 86, 83,
66, 97, 115, 105, 99, 79,
110, 101, 76, 105, 103, 104,
116, 86, 99, 0, 68, 105,
102, 102, 117, 115, 101, 0,
171, 171, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
83, 112, 101, 99, 117, 108,
97, 114, 0, 80, 111, 115,
105, 116, 105, 111, 110, 80,
83, 0, 146, 2, 0, 0,
156, 2, 0, 0, 172, 2,
0, 0, 156, 2, 0, 0,
181, 2, 0, 0, 156, 2,
0, 0, 5, 0, 0, 0,
1, 0, 12, 0, 1, 0,
3, 0, 192, 2, 0, 0,
24, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
28, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
29, 0, 0, 0, 255, 255,
255, 255, 10, 0, 255, 255,
32, 0, 0, 0, 255, 255,
255, 255, 255, 255, 7, 0,
33, 0, 0, 0, 255, 255,
255, 255, 255, 255, 3, 0,
37, 0, 0, 0, 8, 0,
9, 0, 255, 255, 255, 255,
38, 0, 0, 0, 255, 255,
255, 255, 255, 255, 11, 0,
100, 105, 102, 102, 117, 115,
101, 0, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
20, 0, 0, 0, 255, 255,
255, 255, 0, 0, 255, 255,
100, 111, 116, 72, 0, 171,
171, 171, 15, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 100, 111, 116, 76,
0, 171, 171, 171, 16, 0,
0, 0, 255, 255, 0, 0,
255, 255, 255, 255, 101, 121,
101, 86, 101, 99, 116, 111,
114, 0, 171, 171, 8, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 104, 97,
108, 102, 86, 101, 99, 116,
111, 114, 115, 0, 3, 0,
3, 0, 3, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 10, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 112, 111, 115, 95,
119, 115, 0, 171, 4, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 5, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 6, 0,
0, 0, 255, 255, 255, 255,
2, 0, 255, 255, 114, 101,
115, 117, 108, 116, 0, 171,
146, 2, 0, 0, 68, 3,
0, 0, 172, 2, 0, 0,
68, 3, 0, 0, 5, 0,
0, 0, 1, 0, 6, 0,
1, 0, 2, 0, 252, 3,
0, 0, 23, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 115, 112, 101, 99,
117, 108, 97, 114, 0, 171,
171, 171, 26, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 118, 105, 110, 0,
80, 111, 115, 105, 116, 105,
111, 110, 0, 78, 111, 114,
109, 97, 108, 0, 67, 111,
108, 111, 114, 0, 171, 171,
68, 4, 0, 0, 156, 2,
0, 0, 77, 4, 0, 0,
68, 3, 0, 0, 84, 4,
0, 0, 156, 2, 0, 0,
5, 0, 0, 0, 1, 0,
11, 0, 1, 0, 3, 0,
92, 4, 0, 0, 1, 0,
0, 0, 0, 0, 1, 0,
2, 0, 3, 0, 2, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 3, 0,
0, 0, 7, 0, 8, 0,
9, 0, 10, 0, 118, 111,
117, 116, 0, 80, 111, 115,
95, 112, 115, 0, 70, 111,
103, 70, 97, 99, 116, 111,
114, 0, 171, 171, 0, 0,
3, 0, 1, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 0, 173, 4, 0, 0,
156, 2, 0, 0, 146, 2,
0, 0, 156, 2, 0, 0,
172, 2, 0, 0, 68, 3,
0, 0, 180, 4, 0, 0,
192, 4, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 4, 0, 208, 4,
0, 0, 34, 0, 0, 0,
0, 0, 255, 255, 255, 255,
255, 255, 35, 0, 0, 0,
255, 255, 1, 0, 255, 255,
255, 255, 36, 0, 0, 0,
255, 255, 255, 255, 3, 0,
255, 255, 119, 111, 114, 108,
100, 78, 111, 114, 109, 97,
108, 0, 14, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 122, 101, 114, 111,
76, 0, 171, 171, 18, 0,
0, 0, 255, 255, 255, 255,
0, 0, 255, 255, 76, 2,
0, 0, 87, 2, 0, 0,
100, 2, 0, 0, 1, 0,
0, 0, 116, 2, 0, 0,
0, 0, 0, 0, 128, 2,
0, 0, 216, 2, 0, 0,
7, 0, 0, 0, 232, 2,
0, 0, 0, 0, 0, 0,
60, 3, 0, 0, 68, 3,
0, 0, 1, 0, 0, 0,
84, 3, 0, 0, 0, 0,
0, 0, 96, 3, 0, 0,
68, 3, 0, 0, 1, 0,
0, 0, 104, 3, 0, 0,
0, 0, 0, 0, 116, 3,
0, 0, 68, 3, 0, 0,
1, 0, 0, 0, 124, 3,
0, 0, 0, 0, 0, 0,
136, 3, 0, 0, 68, 3,
0, 0, 1, 0, 0, 0,
148, 3, 0, 0, 0, 0,
0, 0, 160, 3, 0, 0,
172, 3, 0, 0, 1, 0,
0, 0, 188, 3, 0, 0,
0, 0, 0, 0, 200, 3,
0, 0, 156, 2, 0, 0,
3, 0, 0, 0, 208, 3,
0, 0, 0, 0, 0, 0,
244, 3, 0, 0, 12, 4,
0, 0, 1, 0, 0, 0,
28, 4, 0, 0, 0, 0,
0, 0, 40, 4, 0, 0,
68, 3, 0, 0, 1, 0,
0, 0, 52, 4, 0, 0,
128, 2, 0, 0, 64, 4,
0, 0, 116, 4, 0, 0,
3, 0, 0, 0, 132, 4,
0, 0, 0, 0, 0, 0,
168, 4, 0, 0, 240, 4,
0, 0, 3, 0, 0, 0,
0, 5, 0, 0, 0, 0,
0, 0, 36, 5, 0, 0,
68, 3, 0, 0, 1, 0,
0, 0, 48, 5, 0, 0,
0, 0, 0, 0, 60, 5,
0, 0, 68, 3, 0, 0,
1, 0, 0, 0, 68, 5,
0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32,
40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 49, 48, 46, 49, 0,
81, 0, 0, 5, 19, 0,
15, 160, 0, 0, 0, 0,
0, 0, 128, 63, 0, 0,
0, 0, 0, 0, 0, 0,
31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144,
31, 0, 0, 2, 5, 0,
1, 128, 1, 0, 15, 144,
31, 0, 0, 2, 5, 0,
2, 128, 2, 0, 15, 144,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
9, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 10, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 11, 0, 228, 160,
2, 0, 0, 3, 0, 0,
7, 128, 0, 0, 228, 129,
7, 0, 228, 160, 36, 0,
0, 2, 1, 0, 7, 128,
0, 0, 228, 128, 2, 0,
0, 3, 0, 0, 7, 128,
1, 0, 228, 128, 4, 0,
228, 161, 36, 0, 0, 2,
1, 0, 7, 128, 0, 0,
228, 128, 8, 0, 0, 3,
0, 0, 1, 128, 1, 0,
228, 144, 12, 0, 228, 160,
8, 0, 0, 3, 0, 0,
2, 128, 1, 0, 228, 144,
13, 0, 228, 160, 8, 0,
0, 3, 0, 0, 4, 128,
1, 0, 228, 144, 14, 0,
228, 160, 36, 0, 0, 2,
2, 0, 7, 128, 0, 0,
228, 128, 8, 0, 0, 3,
0, 0, 1, 128, 1, 0,
228, 128, 2, 0, 228, 128,
8, 0, 0, 3, 0, 0,
2, 128, 4, 0, 228, 161,
2, 0, 228, 128, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 19, 0,
0, 160, 13, 0, 0, 3,
0, 0, 4, 128, 0, 0,
85, 128, 19, 0, 0, 160,
5, 0, 0, 3, 0, 0,
1, 128, 0, 0, 170, 128,
0, 0, 0, 128, 5, 0,
0, 3, 0, 0, 4, 128,
0, 0, 85, 128, 0, 0,
170, 128, 5, 0, 0, 3,
1, 0, 7, 128, 0, 0,
170, 128, 5, 0, 228, 160,
1, 0, 0, 2, 2, 0,
7, 128, 1, 0, 228, 160,
4, 0, 0, 4, 1, 0,
7, 128, 1, 0, 228, 128,
2, 0, 228, 128, 2, 0,
228, 160, 5, 0, 0, 3,
0, 0, 7, 224, 1, 0,
228, 128, 2, 0, 228, 144,
32, 0, 0, 3, 1, 0,
1, 128, 0, 0, 0, 128,
3, 0, 255, 160, 5, 0,
0, 3, 0, 0, 1, 128,
0, 0, 85, 128, 1, 0,
0, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
0, 128, 6, 0, 228, 160,
5, 0, 0, 3, 1, 0,
7, 224, 0, 0, 228, 128,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 17, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 8, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
19, 0, 0, 160, 10, 0,
0, 3, 1, 0, 8, 224,
0, 0, 0, 128, 19, 0,
85, 160, 5, 0, 0, 3,
0, 0, 8, 224, 2, 0,
255, 144, 1, 0, 255, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
15, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 16, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 18, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 255, 255, 0, 0,
83, 72, 68, 82, 224, 4,
0, 0, 64, 0, 1, 0,
56, 1, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 26, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 95, 0, 0, 3,
114, 16, 16, 0, 1, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 2, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 1, 0,
0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 2, 0,
0, 0, 1, 0, 0, 0,
104, 0, 0, 2, 3, 0,
0, 0, 16, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
19, 0, 0, 0, 16, 0,
0, 8, 34, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 20, 0, 0, 0,
16, 0, 0, 8, 66, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 21, 0,
0, 0, 16, 0, 0, 7,
130, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
68, 0, 0, 5, 130, 0,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
114, 0, 16, 0, 0, 0,
0, 0, 246, 15, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
16, 0, 0, 9, 130, 0,
16, 0, 0, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
29, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 1, 0,
0, 7, 18, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 56, 0, 0, 7,
34, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
56, 0, 0, 8, 226, 0,
16, 0, 1, 0, 0, 0,
86, 5, 16, 0, 1, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 6, 0,
0, 0, 50, 0, 0, 11,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 56, 0,
0, 7, 114, 32, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 18, 16, 0, 2, 0,
0, 0, 56, 0, 0, 8,
130, 32, 16, 0, 0, 0,
0, 0, 58, 16, 16, 0,
2, 0, 0, 0, 58, 128,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 0,
0, 8, 18, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 15, 0, 0, 0,
17, 0, 0, 8, 34, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 16, 0,
0, 0, 17, 0, 0, 8,
66, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
17, 0, 0, 0, 0, 0,
0, 9, 226, 0, 16, 0,
1, 0, 0, 0, 6, 9,
16, 128, 65, 0, 0, 0,
2, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
12, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
2, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
2, 0, 0, 0, 50, 0,
0, 11, 226, 0, 16, 0,
1, 0, 0, 0, 86, 14,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 2, 0,
0, 0, 6, 137, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 2, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 2, 0, 0, 0,
56, 0, 0, 7, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 52, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 47, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 25, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
114, 0, 16, 0, 0, 0,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
9, 0, 0, 0, 56, 0,
0, 8, 114, 32, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 2, 0, 0, 0,
17, 32, 0, 8, 130, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 17, 0, 0, 8,
18, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
22, 0, 0, 0, 17, 0,
0, 8, 34, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 23, 0, 0, 0,
17, 0, 0, 8, 66, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 24, 0,
0, 0, 17, 0, 0, 8,
130, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
25, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
108, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
92, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 7, 0, 0,
99, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
78, 79, 82, 77, 65, 76,
0, 67, 79, 76, 79, 82,
0, 171, 171, 171, 79, 83,
71, 78, 100, 0, 0, 0,
3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 80, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 0,
0, 0, 86, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 0,
0, 0, 67, 79, 76, 79,
82, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 171, 171
};

View File

@@ -0,0 +1,859 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
// COLOR 0 xyzw 2 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xyzw 0 NONE float xyzw
// COLOR 1 xyzw 1 NONE float xyzw
// SV_Position 0 xyzw 2 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 4 ( FLT, FLT, FLT, FLT)
// c5 cb0 6 1 ( FLT, FLT, FLT, FLT)
// c6 cb0 9 1 ( FLT, FLT, FLT, FLT)
// c7 cb0 12 1 ( FLT, FLT, FLT, FLT)
// c8 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c12 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c19, 2, -1, 0, 1
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
dcl_texcoord2 v2 // vin<7,8,9,10>
#line 57 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c9 // ::pos_ws<0>
dp4 r0.y, v0, c10 // ::pos_ws<1>
dp4 r0.z, v0, c11 // ::pos_ws<2>
add r0.xyz, -r0, c7
nrm r1.xyz, r0 // ::eyeVector<0,1,2>
#line 33
add r0.xyz, r1, -c4
nrm r1.xyz, r0 // ::halfVectors<0,1,2>
#line 32 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, v1, c19.x, c19.y // ::BiasX2<0,1,2>
#line 59 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r2.x, r0, c12
dp3 r2.y, r0, c13
dp3 r2.z, r0, c14
nrm r0.xyz, r2 // ::worldNormal<0,1,2>
#line 37
dp3 r0.w, r1, r0 // ::dotH<0>
dp3 r0.x, -c4, r0 // ::dotL<0>
#line 42
max r0.y, r0.w, c19.z
#line 39
sge r0.z, r0.x, c19.z // ::zeroL<0>
#line 42
mul r0.y, r0.z, r0.y
mul r0.z, r0.x, r0.z // ::diffuse<0>
#line 46
mul r1.xyz, r0.z, c5
mov r2.xyz, c1 // Parameters::DiffuseColor<0,1,2>
mad r1.xyz, r1, r2, c2 // ::result<0,1,2>
#line 309 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.xyz, r1, v2 // ::VSBasicOneLightVcBn<0,1,2>
#line 42 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
pow r1.x, r0.y, c3.w
mul r0.x, r0.x, r1.x // ::specular<0>
#line 47
mul r0.xyz, r0.x, c6
mul oT1.xyz, r0, c3 // ::VSBasicOneLightVcBn<4,5,6>
#line 63
dp4 oPos.z, v0, c17 // ::VSBasicOneLightVcBn<10>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c8
max r0.x, r0.x, c19.z
min oT1.w, r0.x, c19.w // ::VSBasicOneLightVcBn<7>
#line 309 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mul oT0.w, v2.w, c1.w // ::VSBasicOneLightVcBn<3>
#line 63 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c15 // ::vout<0>
dp4 r0.y, v0, c16 // ::vout<1>
dp4 r0.z, v0, c18 // ::vout<3>
#line 300 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicOneLightVcBn<8,9>
mov oPos.w, r0.z // ::VSBasicOneLightVcBn<11>
// approximately 44 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 3
mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.x, r0.xyzx, cb0[19].xyzx
dp3 r1.y, r0.xyzx, cb0[20].xyzx
dp3 r1.z, r0.xyzx, cb0[21].xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r1.xyzx
dp3 r0.w, -cb0[3].xyzx, r0.xyzx
ge r1.x, r0.w, l(0.000000)
and r1.x, r1.x, l(0x3f800000)
mul r1.y, r0.w, r1.x
mul r1.yzw, r1.yyyy, cb0[6].xxyz
mad r1.yzw, r1.yyzw, cb0[0].xxyz, cb0[1].xxyz
mul o0.xyz, r1.yzwy, v2.xyzx
mul o0.w, v2.w, cb0[0].w
dp4 r2.x, v0.xyzw, cb0[15].xyzw
dp4 r2.y, v0.xyzw, cb0[16].xyzw
dp4 r2.z, v0.xyzw, cb0[17].xyzw
add r1.yzw, -r2.xxyz, cb0[12].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mad r1.yzw, r1.yyzw, r2.xxxx, -cb0[3].xxyz
dp3 r2.x, r1.yzwy, r1.yzwy
rsq r2.x, r2.x
mul r1.yzw, r1.yyzw, r2.xxxx
dp3 r0.x, r1.yzwy, r0.xyzx
max r0.x, r0.x, l(0.000000)
mul r0.x, r1.x, r0.x
log r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
exp r0.x, r0.x
mul r0.x, r0.w, r0.x
mul r0.xyz, r0.xxxx, cb0[9].xyzx
mul o1.xyz, r0.xyzx, cb0[2].xyzx
dp4_sat o1.w, v0.xyzw, cb0[14].xyzw
dp4 o2.x, v0.xyzw, cb0[22].xyzw
dp4 o2.y, v0.xyzw, cb0[23].xyzw
dp4 o2.z, v0.xyzw, cb0[24].xyzw
dp4 o2.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicOneLightVcBn[] =
{
68, 88, 66, 67, 151, 158,
14, 24, 197, 9, 98, 149,
231, 196, 217, 79, 30, 239,
12, 251, 1, 0, 0, 0,
0, 16, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
252, 9, 0, 0, 32, 15,
0, 0, 148, 15, 0, 0,
65, 111, 110, 57, 196, 9,
0, 0, 196, 9, 0, 0,
0, 2, 254, 255, 84, 9,
0, 0, 112, 0, 0, 0,
6, 0, 36, 0, 0, 0,
108, 0, 0, 0, 108, 0,
0, 0, 36, 0, 1, 0,
108, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 6, 0,
1, 0, 5, 0, 0, 0,
0, 0, 0, 0, 9, 0,
1, 0, 6, 0, 0, 0,
0, 0, 0, 0, 12, 0,
1, 0, 7, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 8, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 12, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
181, 1, 68, 66, 85, 71,
40, 0, 0, 0, 168, 6,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 40, 0, 0, 0,
20, 1, 0, 0, 15, 0,
0, 0, 124, 5, 0, 0,
172, 2, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 220, 6,
0, 0, 0, 0, 255, 255,
244, 6, 0, 0, 0, 0,
255, 255, 0, 7, 0, 0,
0, 0, 255, 255, 12, 7,
0, 0, 57, 0, 0, 0,
24, 7, 0, 0, 57, 0,
0, 0, 40, 7, 0, 0,
57, 0, 0, 0, 56, 7,
0, 0, 58, 0, 0, 0,
72, 7, 0, 0, 58, 0,
0, 0, 88, 7, 0, 0,
33, 0, 0, 0, 100, 7,
0, 0, 33, 0, 0, 0,
116, 7, 0, 0, 32, 0,
1, 0, 128, 7, 0, 0,
59, 0, 0, 0, 148, 7,
0, 0, 59, 0, 0, 0,
164, 7, 0, 0, 59, 0,
0, 0, 180, 7, 0, 0,
59, 0, 0, 0, 196, 7,
0, 0, 37, 0, 0, 0,
208, 7, 0, 0, 36, 0,
0, 0, 224, 7, 0, 0,
42, 0, 0, 0, 240, 7,
0, 0, 39, 0, 0, 0,
0, 8, 0, 0, 42, 0,
0, 0, 16, 8, 0, 0,
41, 0, 0, 0, 32, 8,
0, 0, 46, 0, 0, 0,
48, 8, 0, 0, 46, 0,
0, 0, 64, 8, 0, 0,
46, 0, 0, 0, 76, 8,
0, 0, 53, 1, 2, 0,
96, 8, 0, 0, 42, 0,
0, 0, 112, 8, 0, 0,
42, 0, 0, 0, 128, 8,
0, 0, 47, 0, 0, 0,
144, 8, 0, 0, 47, 0,
0, 0, 160, 8, 0, 0,
63, 0, 0, 0, 176, 8,
0, 0, 14, 0, 1, 0,
192, 8, 0, 0, 14, 0,
1, 0, 208, 8, 0, 0,
14, 0, 1, 0, 224, 8,
0, 0, 53, 1, 2, 0,
240, 8, 0, 0, 63, 0,
0, 0, 0, 9, 0, 0,
63, 0, 0, 0, 16, 9,
0, 0, 63, 0, 0, 0,
32, 9, 0, 0, 44, 1,
2, 0, 48, 9, 0, 0,
44, 1, 2, 0, 68, 9,
0, 0, 66, 105, 97, 115,
88, 50, 0, 171, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 11, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 80, 97, 114, 97,
109, 101, 116, 101, 114, 115,
0, 68, 105, 102, 102, 117,
115, 101, 67, 111, 108, 111,
114, 0, 1, 0, 3, 0,
1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0,
23, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
86, 83, 66, 97, 115, 105,
99, 79, 110, 101, 76, 105,
103, 104, 116, 86, 99, 66,
110, 0, 68, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 83, 112, 101, 99,
117, 108, 97, 114, 0, 80,
111, 115, 105, 116, 105, 111,
110, 80, 83, 0, 192, 2,
0, 0, 200, 2, 0, 0,
216, 2, 0, 0, 200, 2,
0, 0, 225, 2, 0, 0,
200, 2, 0, 0, 5, 0,
0, 0, 1, 0, 12, 0,
1, 0, 3, 0, 236, 2,
0, 0, 25, 0, 0, 0,
0, 0, 1, 0, 2, 0,
255, 255, 29, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 30, 0, 0, 0,
255, 255, 255, 255, 10, 0,
255, 255, 33, 0, 0, 0,
255, 255, 255, 255, 255, 255,
7, 0, 34, 0, 0, 0,
255, 255, 255, 255, 255, 255,
3, 0, 38, 0, 0, 0,
8, 0, 9, 0, 255, 255,
255, 255, 39, 0, 0, 0,
255, 255, 255, 255, 255, 255,
11, 0, 100, 105, 102, 102,
117, 115, 101, 0, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 21, 0, 0, 0,
255, 255, 255, 255, 0, 0,
255, 255, 100, 111, 116, 72,
0, 171, 171, 171, 16, 0,
0, 0, 255, 255, 255, 255,
255, 255, 0, 0, 100, 111,
116, 76, 0, 171, 171, 171,
17, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
101, 121, 101, 86, 101, 99,
116, 111, 114, 0, 171, 171,
8, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
104, 97, 108, 102, 86, 101,
99, 116, 111, 114, 115, 0,
3, 0, 3, 0, 3, 0,
3, 0, 1, 0, 0, 0,
0, 0, 0, 0, 10, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 112, 111,
115, 95, 119, 115, 0, 171,
4, 0, 0, 0, 0, 0,
255, 255, 255, 255, 255, 255,
5, 0, 0, 0, 255, 255,
1, 0, 255, 255, 255, 255,
6, 0, 0, 0, 255, 255,
255, 255, 2, 0, 255, 255,
114, 101, 115, 117, 108, 116,
0, 171, 192, 2, 0, 0,
112, 3, 0, 0, 216, 2,
0, 0, 112, 3, 0, 0,
5, 0, 0, 0, 1, 0,
6, 0, 1, 0, 2, 0,
40, 4, 0, 0, 24, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 115, 112,
101, 99, 117, 108, 97, 114,
0, 171, 171, 171, 27, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 118, 105,
110, 0, 80, 111, 115, 105,
116, 105, 111, 110, 0, 78,
111, 114, 109, 97, 108, 0,
67, 111, 108, 111, 114, 0,
171, 171, 112, 4, 0, 0,
200, 2, 0, 0, 121, 4,
0, 0, 112, 3, 0, 0,
128, 4, 0, 0, 200, 2,
0, 0, 5, 0, 0, 0,
1, 0, 11, 0, 1, 0,
3, 0, 136, 4, 0, 0,
1, 0, 0, 0, 0, 0,
1, 0, 2, 0, 3, 0,
2, 0, 0, 0, 4, 0,
5, 0, 6, 0, 255, 255,
3, 0, 0, 0, 7, 0,
8, 0, 9, 0, 10, 0,
118, 111, 117, 116, 0, 80,
111, 115, 95, 112, 115, 0,
70, 111, 103, 70, 97, 99,
116, 111, 114, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 217, 4,
0, 0, 200, 2, 0, 0,
192, 2, 0, 0, 200, 2,
0, 0, 216, 2, 0, 0,
112, 3, 0, 0, 224, 4,
0, 0, 236, 4, 0, 0,
5, 0, 0, 0, 1, 0,
12, 0, 1, 0, 4, 0,
252, 4, 0, 0, 35, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 36, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 37, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 119, 111,
114, 108, 100, 78, 111, 114,
109, 97, 108, 0, 15, 0,
0, 0, 0, 0, 1, 0,
2, 0, 255, 255, 122, 101,
114, 111, 76, 0, 171, 171,
19, 0, 0, 0, 255, 255,
255, 255, 0, 0, 255, 255,
0, 0, 0, 0, 84, 2,
0, 0, 92, 2, 0, 0,
1, 0, 0, 0, 108, 2,
0, 0, 120, 2, 0, 0,
131, 2, 0, 0, 144, 2,
0, 0, 1, 0, 0, 0,
160, 2, 0, 0, 0, 0,
0, 0, 172, 2, 0, 0,
4, 3, 0, 0, 7, 0,
0, 0, 20, 3, 0, 0,
0, 0, 0, 0, 104, 3,
0, 0, 112, 3, 0, 0,
1, 0, 0, 0, 128, 3,
0, 0, 0, 0, 0, 0,
140, 3, 0, 0, 112, 3,
0, 0, 1, 0, 0, 0,
148, 3, 0, 0, 0, 0,
0, 0, 160, 3, 0, 0,
112, 3, 0, 0, 1, 0,
0, 0, 168, 3, 0, 0,
0, 0, 0, 0, 180, 3,
0, 0, 112, 3, 0, 0,
1, 0, 0, 0, 192, 3,
0, 0, 0, 0, 0, 0,
204, 3, 0, 0, 216, 3,
0, 0, 1, 0, 0, 0,
232, 3, 0, 0, 0, 0,
0, 0, 244, 3, 0, 0,
200, 2, 0, 0, 3, 0,
0, 0, 252, 3, 0, 0,
0, 0, 0, 0, 32, 4,
0, 0, 56, 4, 0, 0,
1, 0, 0, 0, 72, 4,
0, 0, 0, 0, 0, 0,
84, 4, 0, 0, 112, 3,
0, 0, 1, 0, 0, 0,
96, 4, 0, 0, 172, 2,
0, 0, 108, 4, 0, 0,
160, 4, 0, 0, 3, 0,
0, 0, 176, 4, 0, 0,
0, 0, 0, 0, 212, 4,
0, 0, 28, 5, 0, 0,
3, 0, 0, 0, 44, 5,
0, 0, 0, 0, 0, 0,
80, 5, 0, 0, 112, 3,
0, 0, 1, 0, 0, 0,
92, 5, 0, 0, 0, 0,
0, 0, 104, 5, 0, 0,
112, 3, 0, 0, 1, 0,
0, 0, 112, 5, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 81, 0,
0, 5, 19, 0, 15, 160,
0, 0, 0, 64, 0, 0,
128, 191, 0, 0, 0, 0,
0, 0, 128, 63, 31, 0,
0, 2, 5, 0, 0, 128,
0, 0, 15, 144, 31, 0,
0, 2, 5, 0, 1, 128,
1, 0, 15, 144, 31, 0,
0, 2, 5, 0, 2, 128,
2, 0, 15, 144, 9, 0,
0, 3, 0, 0, 1, 128,
0, 0, 228, 144, 9, 0,
228, 160, 9, 0, 0, 3,
0, 0, 2, 128, 0, 0,
228, 144, 10, 0, 228, 160,
9, 0, 0, 3, 0, 0,
4, 128, 0, 0, 228, 144,
11, 0, 228, 160, 2, 0,
0, 3, 0, 0, 7, 128,
0, 0, 228, 129, 7, 0,
228, 160, 36, 0, 0, 2,
1, 0, 7, 128, 0, 0,
228, 128, 2, 0, 0, 3,
0, 0, 7, 128, 1, 0,
228, 128, 4, 0, 228, 161,
36, 0, 0, 2, 1, 0,
7, 128, 0, 0, 228, 128,
4, 0, 0, 4, 0, 0,
7, 128, 1, 0, 228, 144,
19, 0, 0, 160, 19, 0,
85, 160, 8, 0, 0, 3,
2, 0, 1, 128, 0, 0,
228, 128, 12, 0, 228, 160,
8, 0, 0, 3, 2, 0,
2, 128, 0, 0, 228, 128,
13, 0, 228, 160, 8, 0,
0, 3, 2, 0, 4, 128,
0, 0, 228, 128, 14, 0,
228, 160, 36, 0, 0, 2,
0, 0, 7, 128, 2, 0,
228, 128, 8, 0, 0, 3,
0, 0, 8, 128, 1, 0,
228, 128, 0, 0, 228, 128,
8, 0, 0, 3, 0, 0,
1, 128, 4, 0, 228, 161,
0, 0, 228, 128, 11, 0,
0, 3, 0, 0, 2, 128,
0, 0, 255, 128, 19, 0,
170, 160, 13, 0, 0, 3,
0, 0, 4, 128, 0, 0,
0, 128, 19, 0, 170, 160,
5, 0, 0, 3, 0, 0,
2, 128, 0, 0, 170, 128,
0, 0, 85, 128, 5, 0,
0, 3, 0, 0, 4, 128,
0, 0, 0, 128, 0, 0,
170, 128, 5, 0, 0, 3,
1, 0, 7, 128, 0, 0,
170, 128, 5, 0, 228, 160,
1, 0, 0, 2, 2, 0,
7, 128, 1, 0, 228, 160,
4, 0, 0, 4, 1, 0,
7, 128, 1, 0, 228, 128,
2, 0, 228, 128, 2, 0,
228, 160, 5, 0, 0, 3,
0, 0, 7, 224, 1, 0,
228, 128, 2, 0, 228, 144,
32, 0, 0, 3, 1, 0,
1, 128, 0, 0, 85, 128,
3, 0, 255, 160, 5, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 1, 0,
0, 128, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0,
0, 128, 6, 0, 228, 160,
5, 0, 0, 3, 1, 0,
7, 224, 0, 0, 228, 128,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 17, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 8, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
19, 0, 170, 160, 10, 0,
0, 3, 1, 0, 8, 224,
0, 0, 0, 128, 19, 0,
255, 160, 5, 0, 0, 3,
0, 0, 8, 224, 2, 0,
255, 144, 1, 0, 255, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
15, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 16, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 18, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 255, 255, 0, 0,
83, 72, 68, 82, 28, 5,
0, 0, 64, 0, 1, 0,
71, 1, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 26, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0,
0, 0, 95, 0, 0, 3,
114, 16, 16, 0, 1, 0,
0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 2, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 1, 0,
0, 0, 103, 0, 0, 4,
242, 32, 16, 0, 2, 0,
0, 0, 1, 0, 0, 0,
104, 0, 0, 2, 3, 0,
0, 0, 50, 0, 0, 15,
114, 0, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
1, 0, 0, 0, 2, 64,
0, 0, 0, 0, 0, 64,
0, 0, 0, 64, 0, 0,
0, 64, 0, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 191, 0, 0, 128, 191,
0, 0, 128, 191, 0, 0,
0, 0, 16, 0, 0, 8,
18, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
19, 0, 0, 0, 16, 0,
0, 8, 34, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 20, 0, 0, 0,
16, 0, 0, 8, 66, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 21, 0,
0, 0, 16, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
68, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
114, 0, 16, 0, 0, 0,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 1, 0, 0, 0,
16, 0, 0, 9, 130, 0,
16, 0, 0, 0, 0, 0,
70, 130, 32, 128, 65, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
29, 0, 0, 7, 18, 0,
16, 0, 1, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 1, 0,
0, 7, 18, 0, 16, 0,
1, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
1, 64, 0, 0, 0, 0,
128, 63, 56, 0, 0, 7,
34, 0, 16, 0, 1, 0,
0, 0, 58, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 1, 0, 0, 0,
56, 0, 0, 8, 226, 0,
16, 0, 1, 0, 0, 0,
86, 5, 16, 0, 1, 0,
0, 0, 6, 137, 32, 0,
0, 0, 0, 0, 6, 0,
0, 0, 50, 0, 0, 11,
226, 0, 16, 0, 1, 0,
0, 0, 86, 14, 16, 0,
1, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 56, 0,
0, 7, 114, 32, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 18, 16, 0, 2, 0,
0, 0, 56, 0, 0, 8,
130, 32, 16, 0, 0, 0,
0, 0, 58, 16, 16, 0,
2, 0, 0, 0, 58, 128,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 0,
0, 8, 18, 0, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 15, 0, 0, 0,
17, 0, 0, 8, 34, 0,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 16, 0,
0, 0, 17, 0, 0, 8,
66, 0, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
17, 0, 0, 0, 0, 0,
0, 9, 226, 0, 16, 0,
1, 0, 0, 0, 6, 9,
16, 128, 65, 0, 0, 0,
2, 0, 0, 0, 6, 137,
32, 0, 0, 0, 0, 0,
12, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
2, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 68, 0, 0, 5,
18, 0, 16, 0, 2, 0,
0, 0, 10, 0, 16, 0,
2, 0, 0, 0, 50, 0,
0, 11, 226, 0, 16, 0,
1, 0, 0, 0, 86, 14,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 2, 0,
0, 0, 6, 137, 32, 128,
65, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 2, 0, 0, 0,
150, 7, 16, 0, 1, 0,
0, 0, 150, 7, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
2, 0, 0, 0, 10, 0,
16, 0, 2, 0, 0, 0,
56, 0, 0, 7, 226, 0,
16, 0, 1, 0, 0, 0,
86, 14, 16, 0, 1, 0,
0, 0, 6, 0, 16, 0,
2, 0, 0, 0, 16, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 150, 7,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 52, 0, 0, 7,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 1, 64,
0, 0, 0, 0, 0, 0,
56, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 1, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 47, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 8, 18, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 25, 0, 0, 5,
18, 0, 16, 0, 0, 0,
0, 0, 10, 0, 16, 0,
0, 0, 0, 0, 56, 0,
0, 7, 18, 0, 16, 0,
0, 0, 0, 0, 58, 0,
16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 8,
114, 0, 16, 0, 0, 0,
0, 0, 6, 0, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
9, 0, 0, 0, 56, 0,
0, 8, 114, 32, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 2, 0, 0, 0,
17, 32, 0, 8, 130, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 17, 0, 0, 8,
18, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
22, 0, 0, 0, 17, 0,
0, 8, 34, 32, 16, 0,
2, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 23, 0, 0, 0,
17, 0, 0, 8, 66, 32,
16, 0, 2, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 24, 0,
0, 0, 17, 0, 0, 8,
130, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
25, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
108, 0, 0, 0, 3, 0,
0, 0, 8, 0, 0, 0,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
92, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 7, 0, 0,
99, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
78, 79, 82, 77, 65, 76,
0, 67, 79, 76, 79, 82,
0, 171, 171, 171, 79, 83,
71, 78, 100, 0, 0, 0,
3, 0, 0, 0, 8, 0,
0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 80, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 0,
0, 0, 86, 0, 0, 0,
0, 0, 0, 0, 1, 0,
0, 0, 3, 0, 0, 0,
2, 0, 0, 0, 15, 0,
0, 0, 67, 79, 76, 79,
82, 0, 83, 86, 95, 80,
111, 115, 105, 116, 105, 111,
110, 0, 171, 171
};

View File

@@ -0,0 +1,504 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float xyzw
// TEXCOORD 1 xyz 1 NONE float xyz
// COLOR 0 xyzw 2 NONE float xyzw
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c6 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c13, 0, 1, 0, 0
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
#line 85 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 oPos.z, v0, c11 // ::VSBasicPixelLighting<13>
dp4 oT0.x, v0, c3 // ::VSBasicPixelLighting<0>
dp4 oT0.y, v0, c4 // ::VSBasicPixelLighting<1>
dp4 oT0.z, v0, c5 // ::VSBasicPixelLighting<2>
dp3 r0.x, v1, c6
dp3 r0.y, v1, c7
dp3 r0.z, v1, c8
dp3 r0.w, r0, r0
rsq r0.w, r0.w
mul oT1.xyz, r0.w, r0 // ::VSBasicPixelLighting<4,5,6>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c2
max r0.x, r0.x, c13.x
min oT0.w, r0.x, c13.y // ::VSBasicPixelLighting<3>
#line 85 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c9 // ::vout<0>
dp4 r0.y, v0, c10 // ::vout<1>
dp4 r0.z, v0, c12 // ::vout<3>
#line 374 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicPixelLighting<11,12>
mov oPos.w, r0.z // ::VSBasicPixelLighting<14>
#line 381
mov r0.xy, c13
mad oT2, c1.w, r0.xxxy, r0.yyyx // ::VSBasicPixelLighting<7,8,9,10>
// approximately 20 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output_siv o3.xyzw, position
dcl_temps 1
dp4 o0.x, v0.xyzw, cb0[15].xyzw
dp4 o0.y, v0.xyzw, cb0[16].xyzw
dp4 o0.z, v0.xyzw, cb0[17].xyzw
dp4_sat o0.w, v0.xyzw, cb0[14].xyzw
dp3 r0.x, v1.xyzx, cb0[19].xyzx
dp3 r0.y, v1.xyzx, cb0[20].xyzx
dp3 r0.z, v1.xyzx, cb0[21].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul o1.xyz, r0.wwww, r0.xyzx
mov o2.xyz, l(1.000000,1.000000,1.000000,0)
mov o2.w, cb0[0].w
dp4 o3.x, v0.xyzw, cb0[22].xyzw
dp4 o3.y, v0.xyzw, cb0[23].xyzw
dp4 o3.z, v0.xyzw, cb0[24].xyzw
dp4 o3.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicPixelLighting[] =
{
68, 88, 66, 67, 246, 92,
82, 186, 93, 45, 228, 15,
126, 213, 228, 175, 247, 61,
185, 98, 1, 0, 0, 0,
64, 9, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
4, 6, 0, 0, 96, 8,
0, 0, 180, 8, 0, 0,
65, 111, 110, 57, 204, 5,
0, 0, 204, 5, 0, 0,
0, 2, 254, 255, 128, 5,
0, 0, 76, 0, 0, 0,
3, 0, 36, 0, 0, 0,
72, 0, 0, 0, 72, 0,
0, 0, 36, 0, 1, 0,
72, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 2, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 6, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
2, 1, 68, 66, 85, 71,
40, 0, 0, 0, 220, 3,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 23, 0, 0, 0,
20, 1, 0, 0, 3, 0,
0, 0, 160, 3, 0, 0,
204, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 16, 4,
0, 0, 0, 0, 255, 255,
40, 4, 0, 0, 0, 0,
255, 255, 52, 4, 0, 0,
85, 0, 0, 0, 64, 4,
0, 0, 86, 0, 0, 0,
80, 4, 0, 0, 86, 0,
0, 0, 96, 4, 0, 0,
86, 0, 0, 0, 112, 4,
0, 0, 87, 0, 0, 0,
128, 4, 0, 0, 87, 0,
0, 0, 144, 4, 0, 0,
87, 0, 0, 0, 160, 4,
0, 0, 87, 0, 0, 0,
176, 4, 0, 0, 87, 0,
0, 0, 192, 4, 0, 0,
87, 0, 0, 0, 204, 4,
0, 0, 14, 0, 1, 0,
220, 4, 0, 0, 14, 0,
1, 0, 236, 4, 0, 0,
14, 0, 1, 0, 252, 4,
0, 0, 85, 0, 0, 0,
12, 5, 0, 0, 85, 0,
0, 0, 28, 5, 0, 0,
85, 0, 0, 0, 44, 5,
0, 0, 118, 1, 2, 0,
60, 5, 0, 0, 118, 1,
2, 0, 80, 5, 0, 0,
125, 1, 2, 0, 92, 5,
0, 0, 125, 1, 2, 0,
104, 5, 0, 0, 86, 83,
66, 97, 115, 105, 99, 80,
105, 120, 101, 108, 76, 105,
103, 104, 116, 105, 110, 103,
0, 80, 111, 115, 105, 116,
105, 111, 110, 87, 83, 0,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 78, 111,
114, 109, 97, 108, 87, 83,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 68, 105, 102, 102,
117, 115, 101, 0, 80, 111,
115, 105, 116, 105, 111, 110,
80, 83, 0, 171, 225, 1,
0, 0, 236, 1, 0, 0,
252, 1, 0, 0, 8, 2,
0, 0, 24, 2, 0, 0,
236, 1, 0, 0, 32, 2,
0, 0, 236, 1, 0, 0,
5, 0, 0, 0, 1, 0,
15, 0, 1, 0, 4, 0,
44, 2, 0, 0, 3, 0,
0, 0, 255, 255, 255, 255,
13, 0, 255, 255, 4, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 5, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 6, 0,
0, 0, 255, 255, 255, 255,
2, 0, 255, 255, 12, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 15, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 19, 0,
0, 0, 11, 0, 12, 0,
255, 255, 255, 255, 20, 0,
0, 0, 255, 255, 255, 255,
255, 255, 14, 0, 22, 0,
0, 0, 7, 0, 8, 0,
9, 0, 10, 0, 118, 105,
110, 0, 80, 111, 115, 105,
116, 105, 111, 110, 0, 78,
111, 114, 109, 97, 108, 0,
204, 2, 0, 0, 236, 1,
0, 0, 213, 2, 0, 0,
8, 2, 0, 0, 5, 0,
0, 0, 1, 0, 7, 0,
1, 0, 2, 0, 220, 2,
0, 0, 1, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 2, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 118, 111, 117, 116,
0, 80, 111, 115, 95, 112,
115, 0, 80, 111, 115, 95,
119, 115, 0, 78, 111, 114,
109, 97, 108, 95, 119, 115,
0, 70, 111, 103, 70, 97,
99, 116, 111, 114, 0, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 25, 3,
0, 0, 236, 1, 0, 0,
32, 3, 0, 0, 8, 2,
0, 0, 39, 3, 0, 0,
8, 2, 0, 0, 49, 3,
0, 0, 60, 3, 0, 0,
5, 0, 0, 0, 1, 0,
11, 0, 1, 0, 4, 0,
76, 3, 0, 0, 16, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 17, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 18, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 0, 0,
0, 0, 204, 1, 0, 0,
76, 2, 0, 0, 9, 0,
0, 0, 92, 2, 0, 0,
204, 1, 0, 0, 200, 2,
0, 0, 236, 2, 0, 0,
2, 0, 0, 0, 252, 2,
0, 0, 0, 0, 0, 0,
20, 3, 0, 0, 108, 3,
0, 0, 3, 0, 0, 0,
124, 3, 0, 0, 77, 105,
99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32,
72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108,
101, 114, 32, 49, 48, 46,
49, 0, 81, 0, 0, 5,
13, 0, 15, 160, 0, 0,
0, 0, 0, 0, 128, 63,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
5, 0, 0, 128, 0, 0,
15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0,
15, 144, 9, 0, 0, 3,
0, 0, 4, 192, 0, 0,
228, 144, 11, 0, 228, 160,
9, 0, 0, 3, 0, 0,
1, 224, 0, 0, 228, 144,
3, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 224,
0, 0, 228, 144, 4, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 224, 0, 0,
228, 144, 5, 0, 228, 160,
8, 0, 0, 3, 0, 0,
1, 128, 1, 0, 228, 144,
6, 0, 228, 160, 8, 0,
0, 3, 0, 0, 2, 128,
1, 0, 228, 144, 7, 0,
228, 160, 8, 0, 0, 3,
0, 0, 4, 128, 1, 0,
228, 144, 8, 0, 228, 160,
8, 0, 0, 3, 0, 0,
8, 128, 0, 0, 228, 128,
0, 0, 228, 128, 7, 0,
0, 2, 0, 0, 8, 128,
0, 0, 255, 128, 5, 0,
0, 3, 1, 0, 7, 224,
0, 0, 255, 128, 0, 0,
228, 128, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 2, 0, 228, 160,
11, 0, 0, 3, 0, 0,
1, 128, 0, 0, 0, 128,
13, 0, 0, 160, 10, 0,
0, 3, 0, 0, 8, 224,
0, 0, 0, 128, 13, 0,
85, 160, 9, 0, 0, 3,
0, 0, 1, 128, 0, 0,
228, 144, 9, 0, 228, 160,
9, 0, 0, 3, 0, 0,
2, 128, 0, 0, 228, 144,
10, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 128,
0, 0, 228, 144, 12, 0,
228, 160, 4, 0, 0, 4,
0, 0, 3, 192, 0, 0,
170, 128, 0, 0, 228, 160,
0, 0, 228, 128, 1, 0,
0, 2, 0, 0, 8, 192,
0, 0, 170, 128, 1, 0,
0, 2, 0, 0, 3, 128,
13, 0, 228, 160, 4, 0,
0, 4, 2, 0, 15, 224,
1, 0, 255, 160, 0, 0,
64, 128, 0, 0, 21, 128,
255, 255, 0, 0, 83, 72,
68, 82, 84, 2, 0, 0,
64, 0, 1, 0, 149, 0,
0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0,
0, 0, 26, 0, 0, 0,
95, 0, 0, 3, 242, 16,
16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 114, 16,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 114, 32,
16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32,
16, 0, 2, 0, 0, 0,
103, 0, 0, 4, 242, 32,
16, 0, 3, 0, 0, 0,
1, 0, 0, 0, 104, 0,
0, 2, 1, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 0, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 15, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
16, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 17, 0, 0, 0,
17, 32, 0, 8, 130, 32,
16, 0, 0, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 14, 0,
0, 0, 16, 0, 0, 8,
18, 0, 16, 0, 0, 0,
0, 0, 70, 18, 16, 0,
1, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
19, 0, 0, 0, 16, 0,
0, 8, 34, 0, 16, 0,
0, 0, 0, 0, 70, 18,
16, 0, 1, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 20, 0, 0, 0,
16, 0, 0, 8, 66, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 21, 0,
0, 0, 16, 0, 0, 7,
130, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
68, 0, 0, 5, 130, 0,
16, 0, 0, 0, 0, 0,
58, 0, 16, 0, 0, 0,
0, 0, 56, 0, 0, 7,
114, 32, 16, 0, 1, 0,
0, 0, 246, 15, 16, 0,
0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
54, 0, 0, 8, 114, 32,
16, 0, 2, 0, 0, 0,
2, 64, 0, 0, 0, 0,
128, 63, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
0, 0, 54, 0, 0, 6,
130, 32, 16, 0, 2, 0,
0, 0, 58, 128, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 17, 0, 0, 8,
18, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
22, 0, 0, 0, 17, 0,
0, 8, 34, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 23, 0, 0, 0,
17, 0, 0, 8, 66, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 24, 0,
0, 0, 17, 0, 0, 8,
130, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
25, 0, 0, 0, 62, 0,
0, 1, 73, 83, 71, 78,
76, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0,
68, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 7, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
78, 79, 82, 77, 65, 76,
0, 171, 79, 83, 71, 78,
132, 0, 0, 0, 4, 0,
0, 0, 8, 0, 0, 0,
104, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
104, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 8, 0, 0,
113, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 0,
119, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 67, 79, 76,
79, 82, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105,
111, 110, 0, 171
};

View File

@@ -0,0 +1,535 @@
#if 0
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 NONE float xyzw
// NORMAL 0 xyz 1 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float xyzw
// TEXCOORD 1 xyz 1 NONE float xyz
// COLOR 0 xyzw 2 NONE float xyzw
// SV_Position 0 xyzw 3 POS float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c1 cb0 0 1 ( FLT, FLT, FLT, FLT)
// c2 cb0 14 4 ( FLT, FLT, FLT, FLT)
// c6 cb0 19 7 ( FLT, FLT, FLT, FLT)
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_0
def c13, 2, -1, 0, 1
dcl_texcoord v0 // vin<0,1,2,3>
dcl_texcoord1 v1 // vin<4,5,6>
#line 85 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 oPos.z, v0, c11 // ::VSBasicPixelLightingBn<13>
dp4 oT0.x, v0, c3 // ::VSBasicPixelLightingBn<0>
dp4 oT0.y, v0, c4 // ::VSBasicPixelLightingBn<1>
dp4 oT0.z, v0, c5 // ::VSBasicPixelLightingBn<2>
#line 32 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
mad r0.xyz, v1, c13.x, c13.y // ::BiasX2<0,1,2>
#line 87 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp3 r1.x, r0, c6
dp3 r1.y, r0, c7
dp3 r1.z, r0, c8
dp3 r0.x, r1, r1
rsq r0.x, r0.x
mul oT1.xyz, r0.x, r1 // ::VSBasicPixelLightingBn<4,5,6>
#line 14 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Common.fxh"
dp4 r0.x, v0, c2
max r0.x, r0.x, c13.z
min oT0.w, r0.x, c13.w // ::VSBasicPixelLightingBn<3>
#line 85 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\Lighting.fxh"
dp4 r0.x, v0, c9 // ::vout<0>
dp4 r0.y, v0, c10 // ::vout<1>
dp4 r0.z, v0, c12 // ::vout<3>
#line 386 "C:\Users\ChuckW\Desktop\D3D11 Projects\DirectXTK\Src\Shaders\BasicEffect.fx"
mad oPos.xy, r0.z, c0, r0 // ::VSBasicPixelLightingBn<11,12>
mov oPos.w, r0.z // ::VSBasicPixelLightingBn<14>
#line 395
mov r0.zw, c13
mad oT2, c1.w, r0.zzzw, r0.wwwz // ::VSBasicPixelLightingBn<7,8,9,10>
// approximately 21 instruction slots used
vs_4_0
dcl_constantbuffer CB0[26], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output_siv o3.xyzw, position
dcl_temps 2
dp4 o0.x, v0.xyzw, cb0[15].xyzw
dp4 o0.y, v0.xyzw, cb0[16].xyzw
dp4 o0.z, v0.xyzw, cb0[17].xyzw
dp4_sat o0.w, v0.xyzw, cb0[14].xyzw
mad r0.xyz, v1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.x, r0.xyzx, cb0[19].xyzx
dp3 r1.y, r0.xyzx, cb0[20].xyzx
dp3 r1.z, r0.xyzx, cb0[21].xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul o1.xyz, r0.xxxx, r1.xyzx
mov o2.xyz, l(1.000000,1.000000,1.000000,0)
mov o2.w, cb0[0].w
dp4 o3.x, v0.xyzw, cb0[22].xyzw
dp4 o3.y, v0.xyzw, cb0[23].xyzw
dp4 o3.z, v0.xyzw, cb0[24].xyzw
dp4 o3.w, v0.xyzw, cb0[25].xyzw
ret
// Approximately 0 instruction slots used
#endif
const BYTE BasicEffect_VSBasicPixelLightingBn[] =
{
68, 88, 66, 67, 67, 122,
222, 110, 95, 58, 223, 198,
204, 173, 215, 114, 202, 24,
43, 84, 1, 0, 0, 0,
212, 9, 0, 0, 4, 0,
0, 0, 48, 0, 0, 0,
92, 6, 0, 0, 244, 8,
0, 0, 72, 9, 0, 0,
65, 111, 110, 57, 36, 6,
0, 0, 36, 6, 0, 0,
0, 2, 254, 255, 216, 5,
0, 0, 76, 0, 0, 0,
3, 0, 36, 0, 0, 0,
72, 0, 0, 0, 72, 0,
0, 0, 36, 0, 1, 0,
72, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 14, 0,
4, 0, 2, 0, 0, 0,
0, 0, 0, 0, 19, 0,
7, 0, 6, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 2, 254, 255, 254, 255,
19, 1, 68, 66, 85, 71,
40, 0, 0, 0, 32, 4,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 8, 1,
0, 0, 24, 0, 0, 0,
20, 1, 0, 0, 4, 0,
0, 0, 208, 3, 0, 0,
248, 1, 0, 0, 67, 58,
92, 85, 115, 101, 114, 115,
92, 67, 104, 117, 99, 107,
87, 92, 68, 101, 115, 107,
116, 111, 112, 92, 68, 51,
68, 49, 49, 32, 80, 114,
111, 106, 101, 99, 116, 115,
92, 68, 105, 114, 101, 99,
116, 88, 84, 75, 92, 83,
114, 99, 92, 83, 104, 97,
100, 101, 114, 115, 92, 76,
105, 103, 104, 116, 105, 110,
103, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 67, 111, 109, 109, 111,
110, 46, 102, 120, 104, 0,
67, 58, 92, 85, 115, 101,
114, 115, 92, 67, 104, 117,
99, 107, 87, 92, 68, 101,
115, 107, 116, 111, 112, 92,
68, 51, 68, 49, 49, 32,
80, 114, 111, 106, 101, 99,
116, 115, 92, 68, 105, 114,
101, 99, 116, 88, 84, 75,
92, 83, 114, 99, 92, 83,
104, 97, 100, 101, 114, 115,
92, 66, 97, 115, 105, 99,
69, 102, 102, 101, 99, 116,
46, 102, 120, 0, 171, 171,
40, 0, 0, 0, 114, 0,
0, 0, 186, 0, 0, 0,
0, 0, 255, 255, 84, 4,
0, 0, 0, 0, 255, 255,
108, 4, 0, 0, 0, 0,
255, 255, 120, 4, 0, 0,
85, 0, 0, 0, 132, 4,
0, 0, 86, 0, 0, 0,
148, 4, 0, 0, 86, 0,
0, 0, 164, 4, 0, 0,
86, 0, 0, 0, 180, 4,
0, 0, 32, 0, 1, 0,
196, 4, 0, 0, 87, 0,
0, 0, 216, 4, 0, 0,
87, 0, 0, 0, 232, 4,
0, 0, 87, 0, 0, 0,
248, 4, 0, 0, 87, 0,
0, 0, 8, 5, 0, 0,
87, 0, 0, 0, 24, 5,
0, 0, 87, 0, 0, 0,
36, 5, 0, 0, 14, 0,
1, 0, 52, 5, 0, 0,
14, 0, 1, 0, 68, 5,
0, 0, 14, 0, 1, 0,
84, 5, 0, 0, 85, 0,
0, 0, 100, 5, 0, 0,
85, 0, 0, 0, 116, 5,
0, 0, 85, 0, 0, 0,
132, 5, 0, 0, 130, 1,
2, 0, 148, 5, 0, 0,
130, 1, 2, 0, 168, 5,
0, 0, 139, 1, 2, 0,
180, 5, 0, 0, 139, 1,
2, 0, 192, 5, 0, 0,
66, 105, 97, 115, 88, 50,
0, 171, 1, 0, 3, 0,
1, 0, 3, 0, 1, 0,
0, 0, 0, 0, 0, 0,
7, 0, 0, 0, 0, 0,
1, 0, 2, 0, 255, 255,
86, 83, 66, 97, 115, 105,
99, 80, 105, 120, 101, 108,
76, 105, 103, 104, 116, 105,
110, 103, 66, 110, 0, 80,
111, 115, 105, 116, 105, 111,
110, 87, 83, 0, 171, 171,
1, 0, 3, 0, 1, 0,
4, 0, 1, 0, 0, 0,
0, 0, 0, 0, 78, 111,
114, 109, 97, 108, 87, 83,
0, 171, 171, 171, 1, 0,
3, 0, 1, 0, 3, 0,
1, 0, 0, 0, 0, 0,
0, 0, 68, 105, 102, 102,
117, 115, 101, 0, 80, 111,
115, 105, 116, 105, 111, 110,
80, 83, 0, 171, 15, 2,
0, 0, 28, 2, 0, 0,
44, 2, 0, 0, 56, 2,
0, 0, 72, 2, 0, 0,
28, 2, 0, 0, 80, 2,
0, 0, 28, 2, 0, 0,
5, 0, 0, 0, 1, 0,
15, 0, 1, 0, 4, 0,
92, 2, 0, 0, 3, 0,
0, 0, 255, 255, 255, 255,
13, 0, 255, 255, 4, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 5, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 6, 0,
0, 0, 255, 255, 255, 255,
2, 0, 255, 255, 13, 0,
0, 0, 4, 0, 5, 0,
6, 0, 255, 255, 16, 0,
0, 0, 255, 255, 255, 255,
255, 255, 3, 0, 20, 0,
0, 0, 11, 0, 12, 0,
255, 255, 255, 255, 21, 0,
0, 0, 255, 255, 255, 255,
255, 255, 14, 0, 23, 0,
0, 0, 7, 0, 8, 0,
9, 0, 10, 0, 118, 105,
110, 0, 80, 111, 115, 105,
116, 105, 111, 110, 0, 78,
111, 114, 109, 97, 108, 0,
252, 2, 0, 0, 28, 2,
0, 0, 5, 3, 0, 0,
56, 2, 0, 0, 5, 0,
0, 0, 1, 0, 7, 0,
1, 0, 2, 0, 12, 3,
0, 0, 1, 0, 0, 0,
0, 0, 1, 0, 2, 0,
3, 0, 2, 0, 0, 0,
4, 0, 5, 0, 6, 0,
255, 255, 118, 111, 117, 116,
0, 80, 111, 115, 95, 112,
115, 0, 80, 111, 115, 95,
119, 115, 0, 78, 111, 114,
109, 97, 108, 95, 119, 115,
0, 70, 111, 103, 70, 97,
99, 116, 111, 114, 0, 171,
0, 0, 3, 0, 1, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 73, 3,
0, 0, 28, 2, 0, 0,
80, 3, 0, 0, 56, 2,
0, 0, 87, 3, 0, 0,
56, 2, 0, 0, 97, 3,
0, 0, 108, 3, 0, 0,
5, 0, 0, 0, 1, 0,
11, 0, 1, 0, 4, 0,
124, 3, 0, 0, 17, 0,
0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 18, 0,
0, 0, 255, 255, 1, 0,
255, 255, 255, 255, 19, 0,
0, 0, 255, 255, 255, 255,
3, 0, 255, 255, 0, 0,
0, 0, 212, 1, 0, 0,
220, 1, 0, 0, 1, 0,
0, 0, 236, 1, 0, 0,
0, 0, 0, 0, 248, 1,
0, 0, 124, 2, 0, 0,
9, 0, 0, 0, 140, 2,
0, 0, 248, 1, 0, 0,
248, 2, 0, 0, 28, 3,
0, 0, 2, 0, 0, 0,
44, 3, 0, 0, 0, 0,
0, 0, 68, 3, 0, 0,
156, 3, 0, 0, 3, 0,
0, 0, 172, 3, 0, 0,
77, 105, 99, 114, 111, 115,
111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76,
32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112,
105, 108, 101, 114, 32, 49,
48, 46, 49, 0, 81, 0,
0, 5, 13, 0, 15, 160,
0, 0, 0, 64, 0, 0,
128, 191, 0, 0, 0, 0,
0, 0, 128, 63, 31, 0,
0, 2, 5, 0, 0, 128,
0, 0, 15, 144, 31, 0,
0, 2, 5, 0, 1, 128,
1, 0, 15, 144, 9, 0,
0, 3, 0, 0, 4, 192,
0, 0, 228, 144, 11, 0,
228, 160, 9, 0, 0, 3,
0, 0, 1, 224, 0, 0,
228, 144, 3, 0, 228, 160,
9, 0, 0, 3, 0, 0,
2, 224, 0, 0, 228, 144,
4, 0, 228, 160, 9, 0,
0, 3, 0, 0, 4, 224,
0, 0, 228, 144, 5, 0,
228, 160, 4, 0, 0, 4,
0, 0, 7, 128, 1, 0,
228, 144, 13, 0, 0, 160,
13, 0, 85, 160, 8, 0,
0, 3, 1, 0, 1, 128,
0, 0, 228, 128, 6, 0,
228, 160, 8, 0, 0, 3,
1, 0, 2, 128, 0, 0,
228, 128, 7, 0, 228, 160,
8, 0, 0, 3, 1, 0,
4, 128, 0, 0, 228, 128,
8, 0, 228, 160, 8, 0,
0, 3, 0, 0, 1, 128,
1, 0, 228, 128, 1, 0,
228, 128, 7, 0, 0, 2,
0, 0, 1, 128, 0, 0,
0, 128, 5, 0, 0, 3,
1, 0, 7, 224, 0, 0,
0, 128, 1, 0, 228, 128,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
2, 0, 228, 160, 11, 0,
0, 3, 0, 0, 1, 128,
0, 0, 0, 128, 13, 0,
170, 160, 10, 0, 0, 3,
0, 0, 8, 224, 0, 0,
0, 128, 13, 0, 255, 160,
9, 0, 0, 3, 0, 0,
1, 128, 0, 0, 228, 144,
9, 0, 228, 160, 9, 0,
0, 3, 0, 0, 2, 128,
0, 0, 228, 144, 10, 0,
228, 160, 9, 0, 0, 3,
0, 0, 4, 128, 0, 0,
228, 144, 12, 0, 228, 160,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 170, 128,
0, 0, 228, 160, 0, 0,
228, 128, 1, 0, 0, 2,
0, 0, 8, 192, 0, 0,
170, 128, 1, 0, 0, 2,
0, 0, 12, 128, 13, 0,
228, 160, 4, 0, 0, 4,
2, 0, 15, 224, 1, 0,
255, 160, 0, 0, 234, 128,
0, 0, 191, 128, 255, 255,
0, 0, 83, 72, 68, 82,
144, 2, 0, 0, 64, 0,
1, 0, 164, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
26, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 95, 0,
0, 3, 114, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 114, 32, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
2, 0, 0, 0, 103, 0,
0, 4, 242, 32, 16, 0,
3, 0, 0, 0, 1, 0,
0, 0, 104, 0, 0, 2,
2, 0, 0, 0, 17, 0,
0, 8, 18, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 15, 0, 0, 0,
17, 0, 0, 8, 34, 32,
16, 0, 0, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 16, 0,
0, 0, 17, 0, 0, 8,
66, 32, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
17, 0, 0, 0, 17, 32,
0, 8, 130, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 14, 0, 0, 0,
50, 0, 0, 15, 114, 0,
16, 0, 0, 0, 0, 0,
70, 18, 16, 0, 1, 0,
0, 0, 2, 64, 0, 0,
0, 0, 0, 64, 0, 0,
0, 64, 0, 0, 0, 64,
0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 191,
0, 0, 128, 191, 0, 0,
128, 191, 0, 0, 0, 0,
16, 0, 0, 8, 18, 0,
16, 0, 1, 0, 0, 0,
70, 2, 16, 0, 0, 0,
0, 0, 70, 130, 32, 0,
0, 0, 0, 0, 19, 0,
0, 0, 16, 0, 0, 8,
34, 0, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
0, 0, 0, 0, 70, 130,
32, 0, 0, 0, 0, 0,
20, 0, 0, 0, 16, 0,
0, 8, 66, 0, 16, 0,
1, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0,
70, 130, 32, 0, 0, 0,
0, 0, 21, 0, 0, 0,
16, 0, 0, 7, 18, 0,
16, 0, 0, 0, 0, 0,
70, 2, 16, 0, 1, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 68, 0,
0, 5, 18, 0, 16, 0,
0, 0, 0, 0, 10, 0,
16, 0, 0, 0, 0, 0,
56, 0, 0, 7, 114, 32,
16, 0, 1, 0, 0, 0,
6, 0, 16, 0, 0, 0,
0, 0, 70, 2, 16, 0,
1, 0, 0, 0, 54, 0,
0, 8, 114, 32, 16, 0,
2, 0, 0, 0, 2, 64,
0, 0, 0, 0, 128, 63,
0, 0, 128, 63, 0, 0,
128, 63, 0, 0, 0, 0,
54, 0, 0, 6, 130, 32,
16, 0, 2, 0, 0, 0,
58, 128, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
17, 0, 0, 8, 18, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 22, 0,
0, 0, 17, 0, 0, 8,
34, 32, 16, 0, 3, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
23, 0, 0, 0, 17, 0,
0, 8, 66, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 24, 0, 0, 0,
17, 0, 0, 8, 130, 32,
16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0,
0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 25, 0,
0, 0, 62, 0, 0, 1,
73, 83, 71, 78, 76, 0,
0, 0, 2, 0, 0, 0,
8, 0, 0, 0, 56, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 68, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
7, 7, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 78, 79,
82, 77, 65, 76, 0, 171,
79, 83, 71, 78, 132, 0,
0, 0, 4, 0, 0, 0,
8, 0, 0, 0, 104, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 104, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
7, 8, 0, 0, 113, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 119, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 3, 0, 0, 0,
15, 0, 0, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 67, 79, 76, 79, 82,
0, 83, 86, 95, 80, 111,
115, 105, 116, 105, 111, 110,
0, 171
};

Some files were not shown because too many files have changed in this diff Show More