05/12/2017

--Bug fixes
 -Fractorium would occasionally freeze after dismissing the final render dialog because some values were not properly re-initialized.

--Code changes
 -Remove VS 2013 build files.
 -Qualify sqrt with std:: in ColorTriangle.cpp
This commit is contained in:
Person
2017-05-12 15:31:48 -07:00
parent 272ebcf0c0
commit f4bdc1c50a
41 changed files with 45 additions and 2929 deletions

View File

@ -37,7 +37,7 @@ static void sincos(float x, float* s, float* c)
namespace EmberNs
{
#define EMBER_VERSION "1.0.0.3"
#define EMBER_VERSION "1.0.0.4"
#define EPS6 T(1e-6)
#define EPS std::numeric_limits<T>::epsilon()//Apoplugin.h uses -20, but it's more mathematically correct to do it this way.
#define ISAAC_SIZE 4

View File

@ -119,9 +119,11 @@ void Renderer<T, bucketT>::ComputeCamera()
/// <param name="action">The requested process action. Note that it's critical the user supply the proper value here.
/// For example: Changing dimensions without setting action to eProcessAction::FULL_RENDER will crash the program.
/// However, changing only the brightness and setting action to ACCUM_ONLY is perfectly fine.
/// <param name="prep">Whether to also compute bounds, camera, filters etc. This is useful when other code outside of this needs these values
/// before the render actually starts. Default: false.</param>
/// </param>
template <typename T, typename bucketT>
void Renderer<T, bucketT>::SetEmber(const Ember<T>& ember, eProcessAction action)
void Renderer<T, bucketT>::SetEmber(const Ember<T>& ember, eProcessAction action, bool prep)
{
ChangeVal([&]
{
@ -131,6 +133,16 @@ void Renderer<T, bucketT>::SetEmber(const Ember<T>& ember, eProcessAction action
m_Ember = m_Embers[0];
m_EmbersP = &m_Embers;
}, action);
if (prep)
{
bool b = false;
CreateSpatialFilter(b);
CreateTemporalFilter(b);
ComputeBounds();
ComputeQuality();
ComputeCamera();
}
}
/// <summary>

View File

@ -58,7 +58,7 @@ public:
virtual void ComputeBounds() override;
virtual void ComputeQuality() override;
virtual void ComputeCamera() override;
virtual void SetEmber(const Ember<T>& ember, eProcessAction action = eProcessAction::FULL_RENDER) override;
virtual void SetEmber(const Ember<T>& ember, eProcessAction action = eProcessAction::FULL_RENDER, bool prep = false) override;
template <typename C>
void SetEmber(const C& embers);
void MoveEmbers(vector<Ember<T>>& embers);

View File

@ -110,8 +110,8 @@ public:
//Virtual processing functions.
virtual bool Ok() const;
virtual size_t MemoryAvailable();
virtual void SetEmber(const Ember<float>& ember, eProcessAction action = eProcessAction::FULL_RENDER) { }
virtual void SetEmber(const Ember<double>& ember, eProcessAction action = eProcessAction::FULL_RENDER) { }
virtual void SetEmber(const Ember<float>& ember, eProcessAction action = eProcessAction::FULL_RENDER, bool prep = false) { }
virtual void SetEmber(const Ember<double>& ember, eProcessAction action = eProcessAction::FULL_RENDER, bool prep = false) { }
virtual bool RandVec(vector<QTIsaac<ISAAC_SIZE, ISAAC_INT>>& randVec);
//Abstract processing functions.

View File

@ -1236,16 +1236,10 @@ public:
/// <returns>The number of iterations ran</returns>
size_t EstimateBoundingBox(Ember<T>& ember, T eps, size_t samples, T* bmin, T* bmax)
{
bool newAlloc = false;
size_t i, lowTarget, highTarget;
T min[2], max[2];
IterParams<T> params;
m_Renderer->SetEmber(ember);
m_Renderer->CreateSpatialFilter(newAlloc);
m_Renderer->CreateDEFilter(newAlloc);
m_Renderer->ComputeBounds();
m_Renderer->ComputeQuality();
m_Renderer->ComputeCamera();
m_Renderer->SetEmber(ember, eProcessAction::FULL_RENDER, true);
if (ember.XaosPresent())
m_Iterator = m_XaosIterator.get();