本文整理汇总了C++中Water::ReflectionIntensity方法的典型用法代码示例。如果您正苦于以下问题:C++ Water::ReflectionIntensity方法的具体用法?C++ Water::ReflectionIntensity怎么用?C++ Water::ReflectionIntensity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Water
的用法示例。
在下文中一共展示了Water::ReflectionIntensity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateShader
bool DirectxEngine::UpdateShader(const Water& water,
const IScene& scene,
float timer)
{
if (UpdateShader(water, scene, true, timer))
{
auto& shader = m_data->shaders[water.ShaderID()];
shader->UpdateConstantFloat("speed", &water.Speed(), 1);
shader->UpdateConstantFloat("bumpIntensity", &water.Bump(), 1);
shader->UpdateConstantFloat("bumpScale", &water.BumpScale().x, 2);
shader->UpdateConstantFloat("uvScale", &water.UVScale().x, 2);
shader->UpdateConstantFloat("deepColor", &water.Deep().r, 4);
shader->UpdateConstantFloat("shallowColor", &water.Shallow().r, 4);
shader->UpdateConstantFloat("reflectionTint", &water.ReflectionTint().r, 3);
shader->UpdateConstantFloat("reflectionIntensity", &water.ReflectionIntensity(), 1);
shader->UpdateConstantFloat("fresnal", &water.Fresnal().x, 3);
const auto& waves = water.Waves();
for (unsigned int i = 0; i < waves.size(); ++i)
{
const int offset = i*4; // Arrays pack in buffer of float4
shader->UpdateConstantFloat("waveFrequency", &waves[i].amplitude, 1, offset);
shader->UpdateConstantFloat("waveAmplitude", &waves[i].frequency, 1, offset);
shader->UpdateConstantFloat("wavePhase", &waves[i].phase, 1, offset);
shader->UpdateConstantFloat("waveDirectionX", &waves[i].directionX, 1, offset);
shader->UpdateConstantFloat("waveDirectionZ", &waves[i].directionZ, 1, offset);
}
return true;
}
return false;
}