--User changes

Allow for setting rendering thread priorities from the command line and final render dialog. Currently only implemented on Windows.
 Show estimated time left on the final render dialog.
 Sort palette list by name, instead of by index in the palette file.
 Sorting can be flipped by clicking the column headers of the palette table.

--Code changes
 Remove unnecessary connect() statement in Variations tab.
This commit is contained in:
mfeemster
2015-05-30 22:14:34 -07:00
parent c97946c660
commit 5bd593b42f
25 changed files with 352 additions and 74 deletions

View File

@ -976,8 +976,8 @@ public:
//were directly written to, must manually call them here.
CacheXforms();
//Need to merge chaos. Original does chaos all the time, but really only need to do it if at least one xform in at least one ember uses it, else skip.
//Omit final xform from chaos processing.
//Need to merge xaos. Original does xaos all the time, but really only need to do it if at least one xform in at least one ember uses it, else skip.
//Omit final xform from xaos processing.
if (Interpolater<T>::AnyXaosPresent(embers, size))
{
for (size_t i = 0; i < XformCount(); i++)

View File

@ -1216,7 +1216,7 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
{
#endif
#ifdef WIN32
//SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
SetThreadPriority(GetCurrentThread(), m_Priority);
#endif
//Timing t;
IterParams<T> params;

View File

@ -28,6 +28,7 @@ RendererBase::RendererBase()
m_LastIter = 0;
m_LastIterPercent = 0;
m_InteractiveFilter = FILTER_LOG;
m_Priority = eThreadPriority::NORMAL;
m_ProcessState = NONE;
m_ProcessAction = FULL_RENDER;
m_InRender = false;
@ -546,6 +547,15 @@ void RendererBase::BytesPerChannel(size_t bytesPerChannel)
/// <returns>The number of channels per pixel in the output image</returns>
size_t RendererBase::NumChannels() const { return m_NumChannels; }
/// <summary>
/// Get/set the priority used for the CPU rendering threads.
/// This does not affect OpenCL rendering.
/// </summary>
/// <param name="priority">The priority to use for the CPU rendering threads</param>
eThreadPriority RendererBase::Priority() const { return m_Priority; }
void RendererBase::Priority(eThreadPriority priority) { m_Priority = priority; }
/// <summary>
/// Get the type of filter to use for preview renders during interactive rendering.
/// Using basic log scaling is quicker, but doesn't provide any bluring.

View File

@ -157,6 +157,8 @@ public:
size_t BytesPerChannel() const;
void BytesPerChannel(size_t bytesPerChannel);
size_t NumChannels() const;
eThreadPriority Priority() const;
void Priority(eThreadPriority priority);
eInteractiveFilter InteractiveFilter() const;
void InteractiveFilter(eInteractiveFilter filter);
@ -216,6 +218,7 @@ protected:
size_t m_LastTemporalSample;
size_t m_LastIter;
double m_LastIterPercent;
eThreadPriority m_Priority;
eProcessAction m_ProcessAction;
eProcessState m_ProcessState;
eInteractiveFilter m_InteractiveFilter;

View File

@ -8,6 +8,26 @@
/// </summary>
namespace EmberNs
{
#ifndef _WIN32
#define THREAD_PRIORITY_LOWEST 1
#define THREAD_PRIORITY_BELOW_NORMAL 25
#define THREAD_PRIORITY_NORMAL 50
#define THREAD_PRIORITY_ABOVE_NORMAL 75
#define THREAD_PRIORITY_HIGHEST 99
#endif
/// <summary>
/// Enum to encapsulate and add type safety to the thread priority defines.
/// </summary>
enum eThreadPriority
{
LOWEST = THREAD_PRIORITY_LOWEST,//-2
BELOW_NORMAL = THREAD_PRIORITY_BELOW_NORMAL,//-1
NORMAL = THREAD_PRIORITY_NORMAL,//0
ABOVE_NORMAL = THREAD_PRIORITY_ABOVE_NORMAL,//1
HIGHEST = THREAD_PRIORITY_HIGHEST//2
};
/// <summary>
/// Thin wrapper around std::find_if() to relieve the caller of having to
/// pass the implicitly obvious .begin() and .end(), and then compare the results to .end().