mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 13:10:04 -05:00
asdfsadf
This commit is contained in:
commit
2e054820f7
@ -120,6 +120,8 @@
|
|||||||
<Unit filename="../../Source/Ember/Point.h" />
|
<Unit filename="../../Source/Ember/Point.h" />
|
||||||
<Unit filename="../../Source/Ember/Renderer.cpp" />
|
<Unit filename="../../Source/Ember/Renderer.cpp" />
|
||||||
<Unit filename="../../Source/Ember/Renderer.h" />
|
<Unit filename="../../Source/Ember/Renderer.h" />
|
||||||
|
<Unit filename="../../Source/Ember/RendererBase.cpp" />
|
||||||
|
<Unit filename="../../Source/Ember/RendererBase.h" />
|
||||||
<Unit filename="../../Source/Ember/SheepTools.h" />
|
<Unit filename="../../Source/Ember/SheepTools.h" />
|
||||||
<Unit filename="../../Source/Ember/SpatialFilter.h" />
|
<Unit filename="../../Source/Ember/SpatialFilter.h" />
|
||||||
<Unit filename="../../Source/Ember/TemporalFilter.h" />
|
<Unit filename="../../Source/Ember/TemporalFilter.h" />
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# depslib dependency file v1.0
|
# depslib dependency file v1.0
|
||||||
1409545904 source:/home/heretic/Dev/fractorium/Source/Ember/Affine2D.cpp
|
1413384022 source:/home/heretic/Dev/fractorium/Source/Ember/Affine2D.cpp
|
||||||
"EmberPch.h"
|
"EmberPch.h"
|
||||||
"Affine2D.h"
|
"Affine2D.h"
|
||||||
|
|
||||||
1409545904 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/EmberPch.h
|
||||||
<SDKDDKVer.h>
|
<SDKDDKVer.h>
|
||||||
<windows.h>
|
<windows.h>
|
||||||
<libgen.h>
|
<libgen.h>
|
||||||
@ -160,22 +160,22 @@
|
|||||||
<libxml/parser.h>
|
<libxml/parser.h>
|
||||||
<libxml/encoding.h>
|
<libxml/encoding.h>
|
||||||
|
|
||||||
1409545904 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Affine2D.h
|
||||||
"Utils.h"
|
"Utils.h"
|
||||||
|
|
||||||
1410323169 /home/heretic/Dev/fractorium/Source/Ember/Utils.h
|
1413385950 /home/heretic/Dev/fractorium/Source/Ember/Utils.h
|
||||||
"Isaac.h"
|
"Isaac.h"
|
||||||
|
|
||||||
1410239722 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Isaac.h
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
|
|
||||||
1410323436 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h
|
1413385406 /home/heretic/Dev/fractorium/Source/Ember/EmberDefines.h
|
||||||
"EmberPch.h"
|
"EmberPch.h"
|
||||||
|
|
||||||
1409545904 source:/home/heretic/Dev/fractorium/Source/Ember/DllMain.cpp
|
1413384022 source:/home/heretic/Dev/fractorium/Source/Ember/DllMain.cpp
|
||||||
"EmberPch.h"
|
"EmberPch.h"
|
||||||
|
|
||||||
1409545904 source:/home/heretic/Dev/fractorium/Source/Ember/Ember.cpp
|
1413384022 source:/home/heretic/Dev/fractorium/Source/Ember/Ember.cpp
|
||||||
"EmberPch.h"
|
"EmberPch.h"
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
"Isaac.h"
|
"Isaac.h"
|
||||||
@ -205,17 +205,17 @@
|
|||||||
"Timing.h"
|
"Timing.h"
|
||||||
"SheepTools.h"
|
"SheepTools.h"
|
||||||
|
|
||||||
1410321103 /home/heretic/Dev/fractorium/Source/Ember/Ember.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Ember.h
|
||||||
"Xform.h"
|
"Xform.h"
|
||||||
"PaletteList.h"
|
"PaletteList.h"
|
||||||
"SpatialFilter.h"
|
"SpatialFilter.h"
|
||||||
"TemporalFilter.h"
|
"TemporalFilter.h"
|
||||||
|
|
||||||
1410238756 /home/heretic/Dev/fractorium/Source/Ember/Xform.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/Xform.h
|
||||||
"VariationList.h"
|
"VariationList.h"
|
||||||
"Interpolate.h"
|
"Interpolate.h"
|
||||||
|
|
||||||
1410241694 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/VariationList.h
|
||||||
"Variations01.h"
|
"Variations01.h"
|
||||||
"Variations02.h"
|
"Variations02.h"
|
||||||
"Variations03.h"
|
"Variations03.h"
|
||||||
@ -223,93 +223,92 @@
|
|||||||
"Variations05.h"
|
"Variations05.h"
|
||||||
"VariationsDC.h"
|
"VariationsDC.h"
|
||||||
|
|
||||||
1410240575 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/Variations01.h
|
||||||
"Variation.h"
|
"Variation.h"
|
||||||
|
|
||||||
1410320886 /home/heretic/Dev/fractorium/Source/Ember/Variation.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Variation.h
|
||||||
"Point.h"
|
"Point.h"
|
||||||
"Isaac.h"
|
"Isaac.h"
|
||||||
|
|
||||||
1410232185 /home/heretic/Dev/fractorium/Source/Ember/Point.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Point.h
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
"Affine2D.h"
|
"Affine2D.h"
|
||||||
"Timing.h"
|
"Timing.h"
|
||||||
|
|
||||||
1410234252 /home/heretic/Dev/fractorium/Source/Ember/Timing.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Timing.h
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
|
|
||||||
1410241921 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/Variations02.h
|
||||||
"Variation.h"
|
"Variation.h"
|
||||||
|
|
||||||
1410241921 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/Variations03.h
|
||||||
"Variation.h"
|
"Variation.h"
|
||||||
|
|
||||||
1410241921 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/Variations04.h
|
||||||
"Variation.h"
|
"Variation.h"
|
||||||
|
|
||||||
1410242146 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/Variations05.h
|
||||||
"Variation.h"
|
"Variation.h"
|
||||||
|
|
||||||
1410238756 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h
|
1413384023 /home/heretic/Dev/fractorium/Source/Ember/VariationsDC.h
|
||||||
"Variation.h"
|
"Variation.h"
|
||||||
|
|
||||||
1410234251 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Interpolate.h
|
||||||
"Ember.h"
|
"Ember.h"
|
||||||
|
|
||||||
1410319649 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/PaletteList.h
|
||||||
"Palette.h"
|
"Palette.h"
|
||||||
|
|
||||||
1410321665 /home/heretic/Dev/fractorium/Source/Ember/Palette.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Palette.h
|
||||||
"Utils.h"
|
"Utils.h"
|
||||||
"Isaac.h"
|
"Isaac.h"
|
||||||
|
|
||||||
1410234252 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/SpatialFilter.h
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
|
|
||||||
1410234252 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/TemporalFilter.h
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
|
|
||||||
1410234189 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Iterator.h
|
||||||
"Ember.h"
|
"Ember.h"
|
||||||
|
|
||||||
1410242215 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/EmberToXml.h
|
||||||
"Utils.h"
|
"Utils.h"
|
||||||
"PaletteList.h"
|
"PaletteList.h"
|
||||||
"VariationList.h"
|
"VariationList.h"
|
||||||
"Ember.h"
|
"Ember.h"
|
||||||
|
|
||||||
1410320145 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h
|
1413385813 /home/heretic/Dev/fractorium/Source/Ember/XmlToEmber.h
|
||||||
"Utils.h"
|
"Utils.h"
|
||||||
"PaletteList.h"
|
"PaletteList.h"
|
||||||
"VariationList.h"
|
"VariationList.h"
|
||||||
|
|
||||||
1409545904 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/DensityFilter.h
|
||||||
"SpatialFilter.h"
|
"SpatialFilter.h"
|
||||||
|
|
||||||
1410321665 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/Renderer.h
|
||||||
"Ember.h"
|
"RendererBase.h"
|
||||||
"Iterator.h"
|
"Iterator.h"
|
||||||
"Utils.h"
|
|
||||||
"SpatialFilter.h"
|
"SpatialFilter.h"
|
||||||
"DensityFilter.h"
|
|
||||||
"TemporalFilter.h"
|
"TemporalFilter.h"
|
||||||
"Interpolate.h"
|
"Interpolate.h"
|
||||||
"CarToRas.h"
|
"CarToRas.h"
|
||||||
"EmberToXml.h"
|
"EmberToXml.h"
|
||||||
|
|
||||||
1410232476 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/RendererBase.h
|
||||||
|
"Utils.h"
|
||||||
|
"Ember.h"
|
||||||
|
"DensityFilter.h"
|
||||||
|
|
||||||
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/CarToRas.h
|
||||||
"Point.h"
|
"Point.h"
|
||||||
|
|
||||||
1410321103 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h
|
1413384022 /home/heretic/Dev/fractorium/Source/Ember/SheepTools.h
|
||||||
"EmberDefines.h"
|
"EmberDefines.h"
|
||||||
"Isaac.h"
|
"Isaac.h"
|
||||||
"VariationList.h"
|
"VariationList.h"
|
||||||
"Renderer.h"
|
"Renderer.h"
|
||||||
|
|
||||||
1409545904 source:/home/heretic/Dev/fractorium/Source/Ember/EmberPch.cpp
|
1413384022 source:/home/heretic/Dev/fractorium/Source/Ember/EmberPch.cpp
|
||||||
"EmberPch.h"
|
"EmberPch.h"
|
||||||
|
|
||||||
1410321782 source:/home/heretic/Dev/fractorium/Source/Ember/Renderer.cpp
|
|
||||||
"EmberPch.h"
|
|
||||||
"Renderer.h"
|
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
<CodeBlocks_workspace_layout_file>
|
<CodeBlocks_workspace_layout_file>
|
||||||
<ActiveProject path="Ember.cbp" />
|
<ActiveProject path="EmberCL.cbp" />
|
||||||
<PreferredTarget name="Debug x64" />
|
|
||||||
</CodeBlocks_workspace_layout_file>
|
</CodeBlocks_workspace_layout_file>
|
||||||
|
@ -118,7 +118,7 @@ void Renderer<T, bucketT>::ComputeBounds()
|
|||||||
{
|
{
|
||||||
size_t maxDEFilterWidth = 0;
|
size_t maxDEFilterWidth = 0;
|
||||||
|
|
||||||
m_GutterWidth = ClampGte((m_SpatialFilter->FinalFilterWidth() - Supersample()) / 2, 0ULL);
|
m_GutterWidth = ClampGte((m_SpatialFilter->FinalFilterWidth() - Supersample()) / 2, size_t(0));
|
||||||
|
|
||||||
//Check the size of the density estimation filter.
|
//Check the size of the density estimation filter.
|
||||||
//If the radius of the density estimation filter is greater than the
|
//If the radius of the density estimation filter is greater than the
|
||||||
@ -373,8 +373,8 @@ eRenderStatus Renderer<T, bucketT>::Run(vector<unsigned char>& finalImage, doubl
|
|||||||
pass = (resume ? m_LastPass : 0);
|
pass = (resume ? m_LastPass : 0);
|
||||||
|
|
||||||
//Make sure values are within valid range.
|
//Make sure values are within valid range.
|
||||||
ClampGteRef(m_Ember.m_Passes, 1ULL);
|
ClampGteRef(m_Ember.m_Passes, size_t(1));
|
||||||
ClampGteRef(m_Ember.m_Supersample, 1ULL);
|
ClampGteRef(m_Ember.m_Supersample, size_t(1));
|
||||||
|
|
||||||
//Make sure to get most recent update since loop won't be entered to call Interp().
|
//Make sure to get most recent update since loop won't be entered to call Interp().
|
||||||
//Vib, gam and background are normally summed for each temporal sample. However if iteration is skipped, make sure to get the latest.
|
//Vib, gam and background are normally summed for each temporal sample. However if iteration is skipped, make sure to get the latest.
|
||||||
@ -883,16 +883,16 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
|||||||
bool scf = !(Supersample() & 1);
|
bool scf = !(Supersample() & 1);
|
||||||
intmax_t ss = Floor<T>(Supersample() / T(2));
|
intmax_t ss = Floor<T>(Supersample() / T(2));
|
||||||
T scfact = pow(Supersample() / (Supersample() + T(1.0)), T(2.0));
|
T scfact = pow(Supersample() / (Supersample() + T(1.0)), T(2.0));
|
||||||
|
|
||||||
size_t threads = m_ThreadsToUse;
|
size_t threads = m_ThreadsToUse;
|
||||||
size_t startRow = Supersample() - 1;
|
size_t startRow = Supersample() - 1;
|
||||||
size_t endRow = m_SuperRasH - (Supersample() - 1);//Original did + which is most likely wrong.
|
size_t endRow = m_SuperRasH - (Supersample() - 1);//Original did + which is most likely wrong.
|
||||||
intmax_t startCol = Supersample() - 1;
|
intmax_t startCol = Supersample() - 1;
|
||||||
intmax_t endCol = m_SuperRasW - (Supersample() - 1);
|
intmax_t endCol = m_SuperRasW - (Supersample() - 1);
|
||||||
size_t chunkSize = (size_t)ceil(double(endRow - startRow) / double(threads));
|
size_t chunkSize = (size_t)ceil(double(endRow - startRow) / double(threads));
|
||||||
|
|
||||||
//parallel_for scales very well, dividing the work almost perfectly among all processors.
|
//parallel_for scales very well, dividing the work almost perfectly among all processors.
|
||||||
parallel_for(0ULL, threads, [&] (size_t threadIndex)
|
parallel_for(size_t(0), threads, [&] (size_t threadIndex)
|
||||||
{
|
{
|
||||||
size_t pixelNumber = 0;
|
size_t pixelNumber = 0;
|
||||||
int localStartRow = (int)min(startRow + (threadIndex * chunkSize), endRow - 1);
|
int localStartRow = (int)min(startRow + (threadIndex * chunkSize), endRow - 1);
|
||||||
@ -900,7 +900,7 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
|||||||
size_t pixelsThisThread = size_t(localEndRow - localStartRow) * m_SuperRasW;
|
size_t pixelsThisThread = size_t(localEndRow - localStartRow) * m_SuperRasW;
|
||||||
double lastPercent = 0;
|
double lastPercent = 0;
|
||||||
glm::detail::tvec4<bucketT, glm::defaultp> logScaleBucket;
|
glm::detail::tvec4<bucketT, glm::defaultp> logScaleBucket;
|
||||||
|
|
||||||
for (intmax_t j = localStartRow; (j < localEndRow) && !m_Abort; j++)
|
for (intmax_t j = localStartRow; (j < localEndRow) && !m_Abort; j++)
|
||||||
{
|
{
|
||||||
size_t bucketRowStart = j * m_SuperRasW;//Pull out of inner loop for optimization.
|
size_t bucketRowStart = j * m_SuperRasW;//Pull out of inner loop for optimization.
|
||||||
@ -908,20 +908,20 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
|||||||
const glm::detail::tvec4<bucketT, glm::defaultp>* buckets = m_HistBuckets.data();
|
const glm::detail::tvec4<bucketT, glm::defaultp>* buckets = m_HistBuckets.data();
|
||||||
const T* filterCoefs = m_DensityFilter->Coefs();
|
const T* filterCoefs = m_DensityFilter->Coefs();
|
||||||
const T* filterWidths = m_DensityFilter->Widths();
|
const T* filterWidths = m_DensityFilter->Widths();
|
||||||
|
|
||||||
for (intmax_t i = startCol; i < endCol; i++)
|
for (intmax_t i = startCol; i < endCol; i++)
|
||||||
{
|
{
|
||||||
intmax_t ii, jj, arrFilterWidth;
|
intmax_t ii, jj, arrFilterWidth;
|
||||||
size_t filterSelectInt, filterCoefIndex;
|
size_t filterSelectInt, filterCoefIndex;
|
||||||
T filterSelect = 0;
|
T filterSelect = 0;
|
||||||
bucket = buckets + bucketRowStart + i;
|
bucket = buckets + bucketRowStart + i;
|
||||||
|
|
||||||
//Don't do anything if there's no hits here. Must also put this first to avoid dividing by zero below.
|
//Don't do anything if there's no hits here. Must also put this first to avoid dividing by zero below.
|
||||||
if (bucket->a == 0)
|
if (bucket->a == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
T cacheLog = (m_K1 * log(T(1.0) + bucket->a * m_K2)) / bucket->a;//Caching this calculation gives a 30% speedup.
|
T cacheLog = (m_K1 * log(T(1.0) + bucket->a * m_K2)) / bucket->a;//Caching this calculation gives a 30% speedup.
|
||||||
|
|
||||||
if (ss == 0)
|
if (ss == 0)
|
||||||
{
|
{
|
||||||
filterSelect = bucket->a;
|
filterSelect = bucket->a;
|
||||||
@ -935,33 +935,33 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
|||||||
intmax_t densityBoxRightX = (i + min(ss, (intmax_t)m_SuperRasW - i - 1));
|
intmax_t densityBoxRightX = (i + min(ss, (intmax_t)m_SuperRasW - i - 1));
|
||||||
intmax_t densityBoxTopY = (j - min(j, ss));
|
intmax_t densityBoxTopY = (j - min(j, ss));
|
||||||
intmax_t densityBoxBottomY = (j + min(ss, (intmax_t)m_SuperRasH - j - 1));
|
intmax_t densityBoxBottomY = (j + min(ss, (intmax_t)m_SuperRasH - j - 1));
|
||||||
|
|
||||||
//Count density in ssxss area.
|
//Count density in ssxss area.
|
||||||
//Original went one col at a time, which is cache inefficient. Go one row at at time here for a slight speedup.
|
//Original went one col at a time, which is cache inefficient. Go one row at at time here for a slight speedup.
|
||||||
for (jj = densityBoxTopY; jj <= densityBoxBottomY; jj++)
|
for (jj = densityBoxTopY; jj <= densityBoxBottomY; jj++)
|
||||||
for (ii = densityBoxLeftX; ii <= densityBoxRightX; ii++)
|
for (ii = densityBoxLeftX; ii <= densityBoxRightX; ii++)
|
||||||
filterSelect += buckets[ii + (jj * m_SuperRasW)].a;//Original divided by 255 in every iteration. Omit here because colors are already in the range of [0..1].
|
filterSelect += buckets[ii + (jj * m_SuperRasW)].a;//Original divided by 255 in every iteration. Omit here because colors are already in the range of [0..1].
|
||||||
}
|
}
|
||||||
|
|
||||||
//Scale if supersample > 1 for equal iters.
|
//Scale if supersample > 1 for equal iters.
|
||||||
if (scf)
|
if (scf)
|
||||||
filterSelect *= scfact;
|
filterSelect *= scfact;
|
||||||
|
|
||||||
if (filterSelect > m_DensityFilter->MaxFilteredCounts())
|
if (filterSelect > m_DensityFilter->MaxFilteredCounts())
|
||||||
filterSelectInt = m_DensityFilter->MaxFilterIndex();
|
filterSelectInt = m_DensityFilter->MaxFilterIndex();
|
||||||
else if (filterSelect <= DE_THRESH)
|
else if (filterSelect <= DE_THRESH)
|
||||||
filterSelectInt = (size_t)ceil(filterSelect) - 1;
|
filterSelectInt = (size_t)ceil(filterSelect) - 1;
|
||||||
else
|
else
|
||||||
filterSelectInt = DE_THRESH + (size_t)Floor<T>(pow(filterSelect - DE_THRESH, m_DensityFilter->Curve()));
|
filterSelectInt = DE_THRESH + (size_t)Floor<T>(pow(filterSelect - DE_THRESH, m_DensityFilter->Curve()));
|
||||||
|
|
||||||
//If the filter selected below the min specified clamp it to the min.
|
//If the filter selected below the min specified clamp it to the min.
|
||||||
if (filterSelectInt > m_DensityFilter->MaxFilterIndex())
|
if (filterSelectInt > m_DensityFilter->MaxFilterIndex())
|
||||||
filterSelectInt = m_DensityFilter->MaxFilterIndex();
|
filterSelectInt = m_DensityFilter->MaxFilterIndex();
|
||||||
|
|
||||||
//Only have to calculate the values for ~1/8 of the square.
|
//Only have to calculate the values for ~1/8 of the square.
|
||||||
filterCoefIndex = filterSelectInt * m_DensityFilter->KernelSize();
|
filterCoefIndex = filterSelectInt * m_DensityFilter->KernelSize();
|
||||||
arrFilterWidth = (intmax_t)ceil(filterWidths[filterSelectInt]) - 1;
|
arrFilterWidth = (intmax_t)ceil(filterWidths[filterSelectInt]) - 1;
|
||||||
|
|
||||||
for (jj = 0; jj <= arrFilterWidth; jj++)
|
for (jj = 0; jj <= arrFilterWidth; jj++)
|
||||||
{
|
{
|
||||||
for (ii = 0; ii <= jj; ii++, filterCoefIndex++)
|
for (ii = 0; ii <= jj; ii++, filterCoefIndex++)
|
||||||
@ -969,12 +969,12 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
|||||||
//Skip if coef is 0.
|
//Skip if coef is 0.
|
||||||
if (filterCoefs[filterCoefIndex] == 0)
|
if (filterCoefs[filterCoefIndex] == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
T logScale = filterCoefs[filterCoefIndex] * cacheLog;
|
T logScale = filterCoefs[filterCoefIndex] * cacheLog;
|
||||||
|
|
||||||
//Original first assigned the fields, then scaled them. Combine into a single step for a 1% optimization.
|
//Original first assigned the fields, then scaled them. Combine into a single step for a 1% optimization.
|
||||||
logScaleBucket = (*bucket * bucketT(logScale));
|
logScaleBucket = (*bucket * bucketT(logScale));
|
||||||
|
|
||||||
if (jj == 0 && ii == 0)
|
if (jj == 0 && ii == 0)
|
||||||
{
|
{
|
||||||
AddToAccum(logScaleBucket, i, ii, j, jj);
|
AddToAccum(logScaleBucket, i, ii, j, jj);
|
||||||
@ -1008,28 +1008,28 @@ eRenderStatus Renderer<T, bucketT>::GaussianDensityFilter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Callback && threadIndex == 0)
|
if (m_Callback && threadIndex == 0)
|
||||||
{
|
{
|
||||||
pixelNumber += m_SuperRasW;
|
pixelNumber += m_SuperRasW;
|
||||||
double percent = (double(pixelNumber) / double(pixelsThisThread)) * 100.0;
|
double percent = (double(pixelNumber) / double(pixelsThisThread)) * 100.0;
|
||||||
double percentDiff = percent - lastPercent;
|
double percentDiff = percent - lastPercent;
|
||||||
double toc = localTime.Toc();
|
double toc = localTime.Toc();
|
||||||
|
|
||||||
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))
|
if (percentDiff >= 10 || (toc > 1000 && percentDiff >= 1))
|
||||||
{
|
{
|
||||||
double etaMs = ((100.0 - percent) / percent) * totalTime.Toc();
|
double etaMs = ((100.0 - percent) / percent) * totalTime.Toc();
|
||||||
|
|
||||||
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 1, etaMs))
|
if (!m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, percent, 1, etaMs))
|
||||||
Abort();
|
Abort();
|
||||||
|
|
||||||
lastPercent = percent;
|
lastPercent = percent;
|
||||||
localTime.Tic();
|
localTime.Tic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (m_Callback && !m_Abort)
|
if (m_Callback && !m_Abort)
|
||||||
m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, 100.0, 1, 0);
|
m_Callback->ProgressFunc(m_Ember, m_ProgressParameter, 100.0, 1, 0);
|
||||||
|
|
||||||
@ -1078,7 +1078,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixel
|
|||||||
//The original does it this way as well and it's roughly 11 times faster to do it this way than inline below with each pixel.
|
//The original does it this way as well and it's roughly 11 times faster to do it this way than inline below with each pixel.
|
||||||
if (EarlyClip())
|
if (EarlyClip())
|
||||||
{
|
{
|
||||||
parallel_for(0ULL, m_SuperRasH, [&] (size_t j)
|
parallel_for(size_t(0), m_SuperRasH, [&] (size_t j)
|
||||||
{
|
{
|
||||||
size_t rowStart = j * m_SuperRasW;//Pull out of inner loop for optimization.
|
size_t rowStart = j * m_SuperRasW;//Pull out of inner loop for optimization.
|
||||||
|
|
||||||
@ -1099,7 +1099,7 @@ eRenderStatus Renderer<T, bucketT>::AccumulatorToFinalImage(unsigned char* pixel
|
|||||||
//otherwise artifacts that resemble page tearing will occur in an interactive run. It's
|
//otherwise artifacts that resemble page tearing will occur in an interactive run. It's
|
||||||
//critical to never exit this loop prematurely.
|
//critical to never exit this loop prematurely.
|
||||||
//for (size_t j = 0; j < FinalRasH(); j++)//Keep around for debugging.
|
//for (size_t j = 0; j < FinalRasH(); j++)//Keep around for debugging.
|
||||||
parallel_for(0ULL, FinalRasH(), [&](size_t j)
|
parallel_for(size_t(0), FinalRasH(), [&](size_t j)
|
||||||
{
|
{
|
||||||
Color<bucketT> newBucket;
|
Color<bucketT> newBucket;
|
||||||
size_t pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRowSize();//Pull out of inner loop for optimization.
|
size_t pixelsRowStart = (m_YAxisUp ? ((FinalRasH() - j) - 1) : j) * FinalRowSize();//Pull out of inner loop for optimization.
|
||||||
@ -1234,7 +1234,7 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t pass, size_t t
|
|||||||
threadIndex = i;
|
threadIndex = i;
|
||||||
m_TaskGroup.run([&, threadIndex] () {
|
m_TaskGroup.run([&, threadIndex] () {
|
||||||
#else
|
#else
|
||||||
parallel_for(0ULL, m_ThreadsToUse, [&] (size_t threadIndex)
|
parallel_for(size_t(0), m_ThreadsToUse, [&] (size_t threadIndex)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
Timing t;
|
Timing t;
|
||||||
|
@ -335,7 +335,7 @@ public:
|
|||||||
{
|
{
|
||||||
const char* loc = __FUNCTION__;
|
const char* loc = __FUNCTION__;
|
||||||
string buf;
|
string buf;
|
||||||
|
|
||||||
//Ensure palette list is setup first.
|
//Ensure palette list is setup first.
|
||||||
if (!m_PaletteList.Init())
|
if (!m_PaletteList.Init())
|
||||||
{
|
{
|
||||||
@ -632,7 +632,7 @@ private:
|
|||||||
}
|
}
|
||||||
else if (!Compare(curAtt->name, "size"))
|
else if (!Compare(curAtt->name, "size"))
|
||||||
{
|
{
|
||||||
if (sscanf_s(attStr, "%u %u", ¤tEmber.m_FinalRasW, ¤tEmber.m_FinalRasH) != 2)
|
if (sscanf_s(attStr, "%lu %lu", ¤tEmber.m_FinalRasW, ¤tEmber.m_FinalRasH) != 2)
|
||||||
{
|
{
|
||||||
m_ErrorReport.push_back(string(loc) + " : Invalid size attribute " + string(attStr));
|
m_ErrorReport.push_back(string(loc) + " : Invalid size attribute " + string(attStr));
|
||||||
xmlFree(attStr);
|
xmlFree(attStr);
|
||||||
|
Loading…
Reference in New Issue
Block a user