本文整理汇总了C++中ConstantBuffer::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstantBuffer::Initialize方法的具体用法?C++ ConstantBuffer::Initialize怎么用?C++ ConstantBuffer::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstantBuffer
的用法示例。
在下文中一共展示了ConstantBuffer::Initialize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
bool LightingApp::Init()
{
if(!D3DApp::Init())
return false;
mWaves.Init(160, 160, 1.0f, 0.03f, 3.25f, 0.4f);
BuildLandGeometryBuffers();
BuildWaveGeometryBuffers();
BuildFX();
BuildVertexLayout();
mObjectConstantBuffer.Initialize(md3dDevice);
mFrameConstantBuffer.Initialize(md3dDevice);
return true;
}
示例2: Init
bool HillsApp::Init()
{
if(!D3DApp::Init())
return false;
BuildGeometryBuffers();
BuildFX();
BuildVertexLayout();
BuildRasterState();
mObjectConstantBuffer.Initialize(md3dDevice);
return true;
}
示例3: Initialize
void Initialize(ID3D11Device* device)
{
TwBar* tweakBar = Settings.TweakBar();
MSAAMode.Initialize(tweakBar, "MSAAMode", "Anti Aliasing", "MSAAMode", "", MSAAModes::MSAA4x, 4, MSAAModesLabels);
Settings.AddSetting(&MSAAMode);
ResolveFilterType.Initialize(tweakBar, "ResolveFilterType", "Anti Aliasing", "Resolve Filter Type", "", FilterTypes::BSpline, 10, FilterTypesLabels);
Settings.AddSetting(&ResolveFilterType);
ResolveFilterDiameter.Initialize(tweakBar, "ResolveFilterDiameter", "Anti Aliasing", "Resolve Filter Diameter", "", 2.0000f, 0.0000f, 6.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&ResolveFilterDiameter);
GaussianSigma.Initialize(tweakBar, "GaussianSigma", "Anti Aliasing", "Gaussian Sigma", "", 0.5000f, 0.0100f, 1.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&GaussianSigma);
CubicB.Initialize(tweakBar, "CubicB", "Anti Aliasing", "Cubic B", "", 0.3300f, 0.0000f, 1.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&CubicB);
CubicC.Initialize(tweakBar, "CubicC", "Anti Aliasing", "Cubic C", "", 0.3300f, 0.0000f, 1.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&CubicC);
UseStandardResolve.Initialize(tweakBar, "UseStandardResolve", "Anti Aliasing", "Use Standard Resolve", "", false);
Settings.AddSetting(&UseStandardResolve);
InverseLuminanceFiltering.Initialize(tweakBar, "InverseLuminanceFiltering", "Anti Aliasing", "Inverse Luminance Filtering", "", true);
Settings.AddSetting(&InverseLuminanceFiltering);
UseExposureFiltering.Initialize(tweakBar, "UseExposureFiltering", "Anti Aliasing", "Use Exposure Filtering", "", true);
Settings.AddSetting(&UseExposureFiltering);
ExposureFilterOffset.Initialize(tweakBar, "ExposureFilterOffset", "Anti Aliasing", "Exposure Filter Offset", "", 2.0000f, -16.0000f, 16.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&ExposureFilterOffset);
UseGradientMipLevel.Initialize(tweakBar, "UseGradientMipLevel", "Anti Aliasing", "Use Gradient Mip Level", "", false);
Settings.AddSetting(&UseGradientMipLevel);
CentroidSampling.Initialize(tweakBar, "CentroidSampling", "Anti Aliasing", "Centroid Sampling", "", true);
Settings.AddSetting(&CentroidSampling);
EnableTemporalAA.Initialize(tweakBar, "EnableTemporalAA", "Anti Aliasing", "Enable Temporal AA", "", true);
Settings.AddSetting(&EnableTemporalAA);
TemporalAABlendFactor.Initialize(tweakBar, "TemporalAABlendFactor", "Anti Aliasing", "Temporal AABlend Factor", "", 0.9000f, 0.0000f, 1.0000f, 0.0010f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&TemporalAABlendFactor);
UseTemporalColorWeighting.Initialize(tweakBar, "UseTemporalColorWeighting", "Anti Aliasing", "Use Temporal Color Weighting", "", false);
Settings.AddSetting(&UseTemporalColorWeighting);
NeighborhoodClampMode.Initialize(tweakBar, "NeighborhoodClampMode", "Anti Aliasing", "Neighborhood Clamp Mode", "", ClampModes::Variance_Clip, 4, ClampModesLabels);
Settings.AddSetting(&NeighborhoodClampMode);
VarianceClipGamma.Initialize(tweakBar, "VarianceClipGamma", "Anti Aliasing", "Variance Clip Gamma", "", 1.5000f, 0.0000f, 2.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&VarianceClipGamma);
JitterMode.Initialize(tweakBar, "JitterMode", "Anti Aliasing", "Jitter Mode", "", JitterModes::Hammersley4x, 5, JitterModesLabels);
Settings.AddSetting(&JitterMode);
JitterScale.Initialize(tweakBar, "JitterScale", "Anti Aliasing", "Jitter Scale", "", 1.0000f, 0.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&JitterScale);
LowFreqWeight.Initialize(tweakBar, "LowFreqWeight", "Anti Aliasing", "Low Freq Weight", "", 0.2500f, 0.0000f, 100.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&LowFreqWeight);
HiFreqWeight.Initialize(tweakBar, "HiFreqWeight", "Anti Aliasing", "Hi Freq Weight", "", 0.8500f, 0.0000f, 100.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&HiFreqWeight);
SharpeningAmount.Initialize(tweakBar, "SharpeningAmount", "Anti Aliasing", "Sharpening Amount", "", 0.0000f, 0.0000f, 1.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&SharpeningAmount);
DilationMode.Initialize(tweakBar, "DilationMode", "Anti Aliasing", "Dilation Mode", "", DilationModes::DilateNearestDepth, 3, DilationModesLabels);
Settings.AddSetting(&DilationMode);
MipBias.Initialize(tweakBar, "MipBias", "Anti Aliasing", "Mip Bias", "", 0.0000f, -340282300000000000000000000000000000000.0000f, 0.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&MipBias);
ReprojectionFilter.Initialize(tweakBar, "ReprojectionFilter", "Anti Aliasing", "Reprojection Filter", "", FilterTypes::CatmullRom, 10, FilterTypesLabels);
Settings.AddSetting(&ReprojectionFilter);
UseStandardReprojection.Initialize(tweakBar, "UseStandardReprojection", "Anti Aliasing", "Use Standard Reprojection", "", false);
Settings.AddSetting(&UseStandardReprojection);
CurrentScene.Initialize(tweakBar, "CurrentScene", "Scene Controls", "Current Scene", "", Scenes::RoboHand, 5, ScenesLabels);
Settings.AddSetting(&CurrentScene);
LightDirection.Initialize(tweakBar, "LightDirection", "Scene Controls", "Light Direction", "The direction of the light", Float3(-0.7500f, 0.9770f, -0.4000f));
Settings.AddSetting(&LightDirection);
LightColor.Initialize(tweakBar, "LightColor", "Scene Controls", "Light Color", "The color of the light", Float3(20.0000f, 16.0000f, 10.0000f), true, 0.0000f, 20.0000f, 0.1000f, ColorUnit::None);
Settings.AddSetting(&LightColor);
EnableDirectLighting.Initialize(tweakBar, "EnableDirectLighting", "Scene Controls", "Enable Direct Lighting", "Enables direct lighting", true);
Settings.AddSetting(&EnableDirectLighting);
EnableAmbientLighting.Initialize(tweakBar, "EnableAmbientLighting", "Scene Controls", "Enable Ambient Lighting", "Enables ambient lighting from the environment", true);
Settings.AddSetting(&EnableAmbientLighting);
RenderBackground.Initialize(tweakBar, "RenderBackground", "Scene Controls", "Render Background", "", true);
Settings.AddSetting(&RenderBackground);
//.........这里部分代码省略.........
示例4: BuildCBFPRLights
AEResult BuildCBFPRLights(GraphicDevice* graphicDevice, ConstantBuffer** cb)
{
AEAssert(graphicDevice != nullptr);
if (graphicDevice == nullptr)
{
return AEResult::GraphicDeviceNull;
}
AEAssert(cb != nullptr);
if (cb == nullptr)
{
return AEResult::NullParameter;
}
AEResult ret = AEResult::Ok;
uint32_t offset = 0;
/////////////////////////////////////////////////////
//Create Constant Buffer _AE_CB_FPR_LightCulling
//
// cbuffer _AE_CB_FPR_Lights : register(b0)
// {
// float3 _AE_CameraPos : packoffset(c0);
// uint _AE_WindowWidth : packoffset(c0.w);
// };
//
/****************************************************************************
*Constant Buffer: _AE_CB_HalfPixel
****************************************************************************/
ConstantBuffer* tempCB = new ConstantBuffer(graphicDevice, 0, AE_CB_FPR_LIGHTS_NAME);
/**************************************
*Add Var 1: _AE_CameraPos
***************************************/
ShaderCustomVariable* scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_CAMERA_POS_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 3;
scv->m_Rows = 1;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(glm::vec3);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(glm::vec3);
scv->m_ShaderVariableClass = ShaderVariableClass::Vector;
scv->m_ShaderVariableType = ShaderVariableType::Float;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Add Var 2: _AE_WindowWidth
***************************************/
scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_WINDOW_WIDTH_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 1;
scv->m_Rows = 1;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(uint32_t);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(uint32_t);
scv->m_ShaderVariableClass = ShaderVariableClass::Scalar;
scv->m_ShaderVariableType = ShaderVariableType::UInt;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Initialize
***************************************/
ret = tempCB->Initialize();
if (ret != AEResult::Ok)
{
//.........这里部分代码省略.........
示例5: BuildCBFPRLightCulling
//.........这里部分代码省略.........
scv->m_ElementSize = sizeof(uint32_t);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(uint32_t);
scv->m_ShaderVariableClass = ShaderVariableClass::Scalar;
scv->m_ShaderVariableType = ShaderVariableType::UInt;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Add Var 4: _AE_WindowWidth
***************************************/
scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_WINDOW_WIDTH_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 1;
scv->m_Rows = 1;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(uint32_t);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(uint32_t);
scv->m_ShaderVariableClass = ShaderVariableClass::Scalar;
scv->m_ShaderVariableType = ShaderVariableType::UInt;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Add Var 5: _AE_NumLights
***************************************/
scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_NUM_LIGHTS_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 1;
scv->m_Rows = 1;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(uint32_t);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(uint32_t);
scv->m_ShaderVariableClass = ShaderVariableClass::Scalar;
scv->m_ShaderVariableType = ShaderVariableType::UInt;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Initialize
***************************************/
ret = tempCB->Initialize();
if (ret != AEResult::Ok)
{
DeleteMem(cb);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Finish
***************************************/
*cb = tempCB;
return AEResult::Ok;
}
示例6: BuildCBHalfPixel
AEResult BuildCBHalfPixel(GraphicDevice* graphicDevice, ConstantBuffer** cb)
{
AEAssert(graphicDevice != nullptr);
if (graphicDevice == nullptr)
{
return AEResult::GraphicDeviceNull;
}
AEAssert(cb != nullptr);
if (cb == nullptr)
{
return AEResult::NullParameter;
}
AEResult ret = AEResult::Ok;
uint32_t offset = 0;
/////////////////////////////////////////////////////
//Create Constant Buffer _AE_CB_HalfPixel
//
// cbuffer _AE_CB_HalfPixel : register(b0)
// {
// float2 _AE_HalfPixel : packoffset(c0);
// };
//
/****************************************************************************
*Constant Buffer: _AE_CB_HalfPixel
****************************************************************************/
ConstantBuffer* tempCB = new ConstantBuffer(graphicDevice, 0, AE_CB_HALF_PIXEL_NAME);
/**************************************
*Add Var 1: _AE_HalfPixel
***************************************/
ShaderCustomVariable* scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_HALF_PIXEL_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 2;
scv->m_Rows = 1;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(glm::vec2);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(glm::vec2);
scv->m_ShaderVariableClass = ShaderVariableClass::Vector;
scv->m_ShaderVariableType = ShaderVariableType::Float;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Initialize
***************************************/
ret = tempCB->Initialize();
if (ret != AEResult::Ok)
{
DeleteMem(cb);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Finish
***************************************/
*cb = tempCB;
return AEResult::Ok;
}
示例7: BuildCBWVP
//.........这里部分代码省略.........
scv->m_ElementSize = sizeof(glm::mat4);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(glm::mat4);
scv->m_ShaderVariableClass = ShaderVariableClass::Matrix;
scv->m_ShaderVariableType = ShaderVariableType::Float;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Add Var 2: _AE_View
***************************************/
scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_VIEW_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 4;
scv->m_Rows = 4;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(glm::mat4);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(glm::mat4);
scv->m_ShaderVariableClass = ShaderVariableClass::Matrix;
scv->m_ShaderVariableType = ShaderVariableType::Float;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Add Var 3: _AE_PROJection
***************************************/
scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_PROJECTION_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 4;
scv->m_Rows = 4;
scv->m_Elements = 0;
scv->m_IsArray = false;
scv->m_ElementSize = sizeof(glm::mat4);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(glm::mat4);
scv->m_ShaderVariableClass = ShaderVariableClass::Matrix;
scv->m_ShaderVariableType = ShaderVariableType::Float;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Initialize
***************************************/
ret = tempCB->Initialize();
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Finish
***************************************/
*cb = tempCB;
return AEResult::Ok;
}
示例8: BuildCBBones
AEResult BuildCBBones(GraphicDevice* graphicDevice, ConstantBuffer** cb)
{
AEAssert(graphicDevice != nullptr);
if (graphicDevice == nullptr)
{
return AEResult::GraphicDeviceNull;
}
AEAssert(cb != nullptr);
if (cb == nullptr)
{
return AEResult::NullParameter;
}
AEResult ret = AEResult::Ok;
uint32_t offset = 0;
/////////////////////////////////////////////////////
//Create Constant Buffer _AE_CB_Bones
//
// cbuffer _AE_CB_Bones : register(b1)
// {
// matrix _AE_BoneTransforms[MAX_BONES] : packoffset(c0);
// };
//
/****************************************************************************
*Constant Buffer: _AE_CB_Bones
****************************************************************************/
ConstantBuffer* tempCB = new ConstantBuffer(graphicDevice, 1, AE_CB_BONES_NAME);
/**************************************
*Add Var 1: _AE_World
***************************************/
ShaderCustomVariable* scv = new ShaderCustomVariable();
scv->m_Name = AE_CB_BONE_TRANSFORMS_VAR_NAME;
scv->m_StartOffset = offset;
scv->m_Columns = 4;
scv->m_Rows = 4;
scv->m_Elements = AE_MAX_BONES;
scv->m_IsArray = true;
scv->m_ElementSize = sizeof(glm::mat4);
scv->m_Offset = 0;
scv->m_UserVariable = false;
scv->m_Size = sizeof(glm::mat4) * AE_MAX_BONES;
scv->m_ShaderVariableClass = ShaderVariableClass::Matrix;
scv->m_ShaderVariableType = ShaderVariableType::Float;
ret = tempCB->AddVariable(scv);
offset = (scv->m_StartOffset + scv->m_Offset + scv->m_Size);
if (ret != AEResult::Ok)
{
DeleteMem(tempCB);
DeleteMem(scv);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Initialize
***************************************/
ret = tempCB->Initialize();
if (ret != AEResult::Ok)
{
DeleteMem(cb);
return AEResult::ConstantBufferInitFailed;
}
/**************************************
*Constant Buffer Finish
***************************************/
*cb = tempCB;
return AEResult::Ok;
}
示例9: Initialize
void Initialize(ID3D11Device* device)
{
TwBar* tweakBar = Settings.TweakBar();
EnableSun.Initialize(tweakBar, "EnableSun", "Sun Light", "Enable Sun", "Enables the sun light", true);
Settings.AddSetting(&EnableSun);
SunAreaLightApproximation.Initialize(tweakBar, "SunAreaLightApproximation", "Sun Light", "Sun Area Light Approximation", "Controls whether the sun is treated as a disc area light in the real-time shader", true);
Settings.AddSetting(&SunAreaLightApproximation);
SunTintColor.Initialize(tweakBar, "SunTintColor", "Sun Light", "Sun Tint Color", "The color of the sun", Float3(1.0000f, 1.0000f, 1.0000f), false, -340282300000000000000000000000000000000.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ColorUnit::None);
Settings.AddSetting(&SunTintColor);
SunIntensityScale.Initialize(tweakBar, "SunIntensityScale", "Sun Light", "Sun Intensity Scale", "Scale the intensity of the sun", 1.0000f, 0.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&SunIntensityScale);
SunSize.Initialize(tweakBar, "SunSize", "Sun Light", "Sun Size", "Angular radius of the sun in degrees", 0.2700f, 0.0100f, 340282300000000000000000000000000000000.0000f, 0.0010f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&SunSize);
NormalizeSunIntensity.Initialize(tweakBar, "NormalizeSunIntensity", "Sun Light", "Normalize Sun Intensity", "", false);
Settings.AddSetting(&NormalizeSunIntensity);
SunDirType.Initialize(tweakBar, "SunDirType", "Sun Light", "Sun Dir Type", "Input direction type for the sun", SunDirectionTypes::UnitVector, 2, SunDirectionTypesLabels);
Settings.AddSetting(&SunDirType);
SunDirection.Initialize(tweakBar, "SunDirection", "Sun Light", "Sun Direction", "Director of the sun", Float3(-0.7500f, 0.9770f, -0.4000f));
Settings.AddSetting(&SunDirection);
SunAzimuth.Initialize(tweakBar, "SunAzimuth", "Sun Light", "Sun Azimuth", "Angle around the horizon", 0.0000f, 0.0000f, 360.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&SunAzimuth);
SunElevation.Initialize(tweakBar, "SunElevation", "Sun Light", "Sun Elevation", "Elevation of sun from ground. 0 degrees is aligned on the horizon while 90 degrees is directly overhead", 0.0000f, 0.0000f, 90.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&SunElevation);
Turbidity.Initialize(tweakBar, "Turbidity", "Sky", "Turbidity", "Atmospheric turbidity (thickness) uses for procedural sun and sky model", 2.0000f, 1.0000f, 10.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&Turbidity);
GroundAlbedo.Initialize(tweakBar, "GroundAlbedo", "Sky", "Ground Albedo", "Ground albedo color used for procedural sun and sky model", Float3(0.5000f, 0.5000f, 0.5000f), false, -340282300000000000000000000000000000000.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ColorUnit::None);
Settings.AddSetting(&GroundAlbedo);
MSAAMode.Initialize(tweakBar, "MSAAMode", "Anti Aliasing", "MSAAMode", "MSAA mode to use for full-resolution rendering", MSAAModes::MSAANone, 2, MSAAModesLabels);
Settings.AddSetting(&MSAAMode);
FilterSize.Initialize(tweakBar, "FilterSize", "Anti Aliasing", "Filter Size", "Filter radius for MSAA resolve", 2.0000f, 0.0000f, 6.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&FilterSize);
EnableAlbedoMaps.Initialize(tweakBar, "EnableAlbedoMaps", "Scene", "Enable Albedo Maps", "Enables albedo maps", true);
Settings.AddSetting(&EnableAlbedoMaps);
EnableNormalMaps.Initialize(tweakBar, "EnableNormalMaps", "Scene", "Enable Normal Maps", "Enables normal maps", true);
Settings.AddSetting(&EnableNormalMaps);
NormalMapIntensity.Initialize(tweakBar, "NormalMapIntensity", "Scene", "Normal Map Intensity", "Intensity of the normal map", 0.5000f, 0.0000f, 1.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&NormalMapIntensity);
DiffuseIntensity.Initialize(tweakBar, "DiffuseIntensity", "Scene", "Diffuse Intensity", "Diffuse albedo intensity parameter for the material", 0.7500f, 0.0000f, 1.0000f, 0.0010f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&DiffuseIntensity);
Roughness.Initialize(tweakBar, "Roughness", "Scene", "Specular Roughness", "Specular roughness parameter for the material", 0.2500f, 0.0010f, 1.0000f, 0.0010f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&Roughness);
SpecularIntensity.Initialize(tweakBar, "SpecularIntensity", "Scene", "Specular Intensity", "Specular intensity parameter for the material", 0.0400f, 0.0000f, 1.0000f, 0.0010f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&SpecularIntensity);
NumParticles.Initialize(tweakBar, "NumParticles", "Particles", "Num Particles (x1024)", "The number of particles to render, in increments of 1024", 8, 0, 32);
Settings.AddSetting(&NumParticles);
EmitRadius.Initialize(tweakBar, "EmitRadius", "Particles", "Emit Radius", "The radius in which to emit particles", 2.0000f, 0.0100f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&EmitRadius);
EmitCenterX.Initialize(tweakBar, "EmitCenterX", "Particles", "Emit Center X", "The X coordinate of the point from which to emit particles", 0.0000f, -340282300000000000000000000000000000000.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&EmitCenterX);
EmitCenterY.Initialize(tweakBar, "EmitCenterY", "Particles", "Emit Center Y", "The Y coordinate of the point from which to emit particles", 2.5000f, -340282300000000000000000000000000000000.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&EmitCenterY);
EmitCenterZ.Initialize(tweakBar, "EmitCenterZ", "Particles", "Emit Center Z", "The Z coordinate of the point from which to emit particles", 0.0000f, -340282300000000000000000000000000000000.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&EmitCenterZ);
RotationSpeed.Initialize(tweakBar, "RotationSpeed", "Particles", "Rotation Speed", "Controls how fast to rotate the particles around the emitter center", 0.5000f, 0.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&RotationSpeed);
AbsorptionScale.Initialize(tweakBar, "AbsorptionScale", "Particles", "Absorption Scale", "Scaled the absorption coefficient used for particle self-shadowing", 1.0000f, 0.0000f, 340282300000000000000000000000000000000.0000f, 0.0100f, ConversionMode::None, 1.0000f);
Settings.AddSetting(&AbsorptionScale);
SortParticles.Initialize(tweakBar, "SortParticles", "Particles", "Sort Particles", "Enables sorting each particle by their depth", true);
Settings.AddSetting(&SortParticles);
EnableParticleAlbedoMap.Initialize(tweakBar, "EnableParticleAlbedoMap", "Particles", "Enable Particle Albedo Map", "Enables or disables sampling an albedo map in the particle pixel shader", true);
Settings.AddSetting(&EnableParticleAlbedoMap);
BillboardParticles.Initialize(tweakBar, "BillboardParticles", "Particles", "Billboard Particles", "Enables or disabled billboarding of particles towards the camera", true);
Settings.AddSetting(&BillboardParticles);
RenderLowRes.Initialize(tweakBar, "RenderLowRes", "Particles", "Render Low-Res", "Renders the particles at half resolution", true);
Settings.AddSetting(&RenderLowRes);
LowResRenderMode.Initialize(tweakBar, "LowResRenderMode", "Particles", "Low-Res Render Mode", "Specifies the technique to use for upscaling particles from half resolution", LowResRenderModes::MSAA, 2, LowResRenderModesLabels);
Settings.AddSetting(&LowResRenderMode);
//.........这里部分代码省略.........