--User changes

Implement copying and pasting xforms between flames.

--Code changes
 Make palette filename be a shared_ptr<string> to avoid duplication.
 Ensure random seeds in RendererCL have no duplicates and are not zero.
This commit is contained in:
mfeemster
2015-05-19 19:31:33 -07:00
parent 48ccce69f6
commit cb54605878
9 changed files with 106 additions and 8 deletions

View File

@ -1475,18 +1475,23 @@ CarToRasCL<T> RendererCL<T>::ConvertCarToRas(const CarToRas<T>& carToRas)
/// <summary>
/// Fill seeds buffer which gets passed to the iteration kernel.
/// The range of each seed will be spaced to ensure no duplicates are added.
/// Note, WriteBuffer() must be called after this to actually copy the
/// data from the host to the device.
/// </summary>
template <typename T>
void RendererCL<T>::FillSeeds()
{
double start, delta = std::floor((double)std::numeric_limits<uint>::max() / (IterGridKernelCount() * 2));
m_Seeds.resize(IterGridKernelCount());
start = delta;
for (auto& seed : m_Seeds)
{
seed.x = m_Rand[0].Rand();
seed.y = m_Rand[0].Rand();
seed.x = (uint)m_Rand[0].Frand<double>(start, start + delta);
start += delta;
seed.y = (uint)m_Rand[0].Frand<double>(start, start + delta);
start += delta;
}
}