mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 05:46:06 -04:00
--User changes
-Add two new variations, hyperbolic and hypershift2. -Allow for animating final xforms. -More detailed diagnostics when any action in the OpenCL renderer fails. -Allow for creating an OpenCL renderer which does not share a texture with the main window, and instead manually copies its final output image from GPU to CPU then back to GPU. --Bug fixes -Text was not properly being copied out of the Info | Bounds text box. --Code changes -Remove Renderer::AccumulatorToFinalImage(v4F* pixels, size_t finalOffset), it's no longer needed or makes sense. -Controllers no longer keep track of shared status, it's kept inside the renderers. -Make getter functions in FractoriumOptionsDialog be public.
This commit is contained in:
@ -58,7 +58,7 @@
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center">Fractorium 1.0.0.7</p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" text-decoration: underline; color:#0000ff;">fractorium.com</span></a><span style=" font-size:10pt;"><br/>Lead: Matt Feemster<br/>Contributors: Simon Detheridge, Michel Mastriani</span></p></body></html></string>
|
||||
<string><html><head/><body><p align="center">Fractorium 1.0.0.8</p><p align="center"><span style=" font-size:10pt;">A Qt-based fractal flame editor which uses a C++ re-write of the flam3 algorithm named Ember and a GPU capable version named EmberCL which implements a portion of the cuburn algorithm in OpenCL.</span></p><p align="center"><a href="http://fractorium.com"><span style=" text-decoration: underline; color:#0000ff;">fractorium.com</span></a><span style=" font-size:10pt;"><br/>Lead: Matt Feemster<br/>Contributors: Simon Detheridge, Michel Mastriani</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
|
@ -439,7 +439,6 @@ bool FinalRenderEmberController<T>::CreateRenderer(eRendererType renderType, con
|
||||
vector<string> errorReport;
|
||||
m_Devices = devices;//Store values for re-creation later on.
|
||||
m_OutputTexID = 0;//Don't care about tex ID when doing final render.
|
||||
m_Shared = shared;//So shared is of course false.
|
||||
|
||||
if (m_FinalRenderDialog->DoSequence())
|
||||
{
|
||||
|
@ -213,6 +213,11 @@ Fractorium::Fractorium(QWidget* p)
|
||||
//this constructor exits, GLWidget::InitGL() will create the initial flock and start the rendering timer
|
||||
//which executes whenever the program is idle. Upon starting the timer, the renderer
|
||||
//will be initialized.
|
||||
//auto cdc = wglGetCurrentDC();
|
||||
//auto cc = wglGetCurrentContext();
|
||||
//qDebug() << "Fractorium::Fractorium():";
|
||||
//qDebug() << "Current DC: " << cdc;
|
||||
//qDebug() << "Current Context: " << cc;
|
||||
QTimer::singleShot(1000, [&]() { ui.GLDisplay->InitGL(); });
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,6 @@ protected:
|
||||
|
||||
//Non-templated members.
|
||||
bool m_Rendering = false;
|
||||
bool m_Shared = true;
|
||||
bool m_LastEditWasUndoRedo;
|
||||
vector<pair<size_t, size_t>> m_Devices;
|
||||
size_t m_SubBatchCount = 1;//Will be ovewritten by the options on first render.
|
||||
|
@ -476,8 +476,7 @@ bool FractoriumEmberController<T>::Render()
|
||||
//Update it on finish because the rendering process is completely done.
|
||||
if (update || ProcessState() == eProcessState::ACCUM_DONE)
|
||||
{
|
||||
if (m_FinalImage.size() == m_Renderer->FinalDimensions())//Make absolutely sure the correct amount of data is passed.
|
||||
gl->update();
|
||||
gl->update();//Queue update.
|
||||
|
||||
if (ProcessState() == eProcessState::ACCUM_DONE)
|
||||
SaveCurrentToOpenedFile();//Will not save if the previews are still rendering.
|
||||
@ -543,26 +542,34 @@ bool FractoriumEmberController<T>::CreateRenderer(eRendererType renderType, cons
|
||||
auto s = m_Fractorium->m_Settings;
|
||||
auto gl = m_Fractorium->ui.GLDisplay;
|
||||
|
||||
if (!m_Renderer.get() || (m_Renderer->RendererType() != renderType) || !Equal(m_Devices, devices))
|
||||
if (!m_Renderer.get() || (m_Renderer->RendererType() != renderType) || !Equal(m_Devices, devices) || m_Renderer->Shared() != shared)
|
||||
{
|
||||
EmberReport emberReport;
|
||||
vector<string> errorReport;
|
||||
DeleteRenderer();//Delete the renderer and refresh the textures.
|
||||
//Before starting, must take care of allocations.
|
||||
gl->Allocate(true);//Forcing a realloc of the texture is necessary on AMD, but not on nVidia.
|
||||
m_Renderer = unique_ptr<EmberNs::RendererBase>(::CreateRenderer<T>(renderType, devices, shared, gl->OutputTexID(), emberReport));//Always make bucket type float.
|
||||
errorReport = emberReport.ErrorReport();
|
||||
|
||||
if (errorReport.empty())
|
||||
//Before starting, must take care of allocations.
|
||||
if (gl->Allocate(true))//Forcing a realloc of the texture is necessary on AMD, but not on nVidia.
|
||||
{
|
||||
m_Devices = devices;
|
||||
m_OutputTexID = gl->OutputTexID();
|
||||
m_Shared = shared;
|
||||
m_Renderer = unique_ptr<EmberNs::RendererBase>(::CreateRenderer<T>(renderType, devices, shared, gl->OutputTexID(), emberReport));//Always make bucket type float.
|
||||
errorReport = emberReport.ErrorReport();
|
||||
|
||||
if (errorReport.empty())
|
||||
{
|
||||
m_Devices = devices;
|
||||
m_OutputTexID = gl->OutputTexID();
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = false;
|
||||
m_Fractorium->ShowCritical("Renderer Creation Error", "Could not create requested renderer, fallback CPU renderer created. See info tab for details.");
|
||||
m_Fractorium->ErrorReportToQTextEdit(errorReport, m_Fractorium->ui.InfoRenderingTextEdit);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ok = false;
|
||||
m_Fractorium->ShowCritical("Renderer Creation Error", "Could not create requested renderer, fallback CPU renderer created. See info tab for details.");
|
||||
m_Fractorium->ShowCritical("Renderer Creation Error", "Could not create OpenGL texture, interactive rendering will be disabled.");
|
||||
m_Fractorium->ErrorReportToQTextEdit(errorReport, m_Fractorium->ui.InfoRenderingTextEdit);
|
||||
}
|
||||
}
|
||||
@ -662,14 +669,16 @@ bool Fractorium::CreateRendererFromOptions(bool updatePreviews)
|
||||
auto v = Devices(m_Settings->Devices());
|
||||
|
||||
//The most important option to process is what kind of renderer is desired, so do it first.
|
||||
if (!m_Controller->CreateRenderer((useOpenCL && !v.empty()) ? eRendererType::OPENCL_RENDERER : eRendererType::CPU_RENDERER, v, updatePreviews))
|
||||
if (!m_Controller->CreateRenderer((useOpenCL && !v.empty()) ? eRendererType::OPENCL_RENDERER : eRendererType::CPU_RENDERER, v, updatePreviews, useOpenCL && m_Settings->SharedTexture()))
|
||||
{
|
||||
//If using OpenCL, will only get here if creating RendererCL failed, but creating a backup CPU Renderer succeeded.
|
||||
ShowCritical("Renderer Creation Error", "Error creating renderer, most likely a GPU problem. Using CPU instead.");
|
||||
m_Settings->OpenCL(false);
|
||||
m_Settings->SharedTexture(false);
|
||||
ui.ActionCpu->setChecked(true);
|
||||
ui.ActionCL->setChecked(false);
|
||||
m_OptionsDialog->ui.OpenCLCheckBox->setChecked(false);
|
||||
m_OptionsDialog->ui.SharedTextureCheckBox->setChecked(false);
|
||||
m_FinalRenderDialog->ui.FinalRenderOpenCLCheckBox->setChecked(false);
|
||||
ok = false;
|
||||
}
|
||||
|
@ -98,6 +98,9 @@ void FractoriumSettings::EnsureDefaults()
|
||||
|
||||
if (OpenPaletteImageFolder() == "")
|
||||
OpenPaletteImageFolder(QCoreApplication::applicationDirPath());
|
||||
|
||||
if (value(SHAREDTEXTURE).toString() == "")//Set this to true if the setting is missing because it only needs to be false for the rare system that has problems with shared textures.
|
||||
SharedTexture(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -116,6 +119,9 @@ void FractoriumSettings::Transparency(bool b) { setValue(TRANSPARENCY, b);
|
||||
bool FractoriumSettings::OpenCL() { return value(OPENCL).toBool(); }
|
||||
void FractoriumSettings::OpenCL(bool b) { setValue(OPENCL, b); }
|
||||
|
||||
bool FractoriumSettings::SharedTexture() { return value(SHAREDTEXTURE).toBool(); }
|
||||
void FractoriumSettings::SharedTexture(bool b) { setValue(SHAREDTEXTURE, b); }
|
||||
|
||||
bool FractoriumSettings::Double() { return value(DOUBLEPRECISION).toBool(); }
|
||||
void FractoriumSettings::Double(bool b) { setValue(DOUBLEPRECISION, b); }
|
||||
|
||||
@ -158,14 +164,14 @@ void FractoriumSettings::OpenCLSubBatch(uint i) { setValue(OPENCLSUBBATCH,
|
||||
uint FractoriumSettings::RandomCount() { return value(RANDOMCOUNT).toUInt(); }
|
||||
void FractoriumSettings::RandomCount(uint i) { setValue(RANDOMCOUNT, i); }
|
||||
|
||||
uint FractoriumSettings::CpuQuality() { return value(CPU_QUALITY).toUInt(); }
|
||||
void FractoriumSettings::CpuQuality(uint i) { setValue(CPU_QUALITY, i); }
|
||||
uint FractoriumSettings::CpuQuality() { return value(CPUQUALITY).toUInt(); }
|
||||
void FractoriumSettings::CpuQuality(uint i) { setValue(CPUQUALITY, i); }
|
||||
|
||||
uint FractoriumSettings::OpenClQuality() { return value(OPENCL_QUALITY).toUInt(); }
|
||||
void FractoriumSettings::OpenClQuality(uint i) { setValue(OPENCL_QUALITY, i); }
|
||||
uint FractoriumSettings::OpenClQuality() { return value(OPENCLQUALITY).toUInt(); }
|
||||
void FractoriumSettings::OpenClQuality(uint i) { setValue(OPENCLQUALITY, i); }
|
||||
|
||||
bool FractoriumSettings::LoadLast() { return value(LOAD_LAST).toBool(); }
|
||||
void FractoriumSettings::LoadLast(bool b) { setValue(LOAD_LAST, b); }
|
||||
bool FractoriumSettings::LoadLast() { return value(LOADLAST).toBool(); }
|
||||
void FractoriumSettings::LoadLast(bool b) { setValue(LOADLAST, b); }
|
||||
|
||||
/// <summary>
|
||||
/// Sequence generation settings.
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define YAXISUP "render/yaxisup"
|
||||
#define TRANSPARENCY "render/transparency"
|
||||
#define OPENCL "render/opencl"
|
||||
#define SHAREDTEXTURE "render/sharedtexture"
|
||||
#define DOUBLEPRECISION "render/dp64"
|
||||
#define CONTUPDATE "render/continuousupdate"
|
||||
#define SHOWALLXFORMS "render/dragshowallxforms"
|
||||
@ -24,9 +25,9 @@
|
||||
#define CPUSUBBATCH "render/cpusubbatch"
|
||||
#define OPENCLSUBBATCH "render/openclsubbatch"
|
||||
#define RANDOMCOUNT "render/randomcount"
|
||||
#define CPU_QUALITY "render/cpuquality"
|
||||
#define OPENCL_QUALITY "render/openclquality"
|
||||
#define LOAD_LAST "render/loadlastonstart"
|
||||
#define CPUQUALITY "render/cpuquality"
|
||||
#define OPENCLQUALITY "render/openclquality"
|
||||
#define LOADLAST "render/loadlastonstart"
|
||||
|
||||
#define STAGGER "sequence/stagger"
|
||||
#define STAGGERMAX "sequence/staggermax"
|
||||
@ -114,6 +115,9 @@ public:
|
||||
bool OpenCL();
|
||||
void OpenCL(bool b);
|
||||
|
||||
bool SharedTexture();
|
||||
void SharedTexture(bool b);
|
||||
|
||||
bool Double();
|
||||
void Double(bool b);
|
||||
|
||||
|
@ -332,6 +332,7 @@ void FractoriumEmberController<T>::AddFinalXform()
|
||||
Update([&]()
|
||||
{
|
||||
Xform<T> final;
|
||||
final.m_Animate = 0;
|
||||
final.AddVariation(m_VariationList->GetVariationCopy(eVariationId::VAR_LINEAR));//Just a placeholder so other parts of the code don't see it as being empty.
|
||||
m_Ember.SetFinalXform(final);
|
||||
int index = int(m_Ember.TotalXformCount() - 1);//Set index to the last item.
|
||||
|
@ -121,12 +121,12 @@ GLWidget::GLWidget(QWidget* p)
|
||||
|
||||
setFormat(fmt);
|
||||
*/
|
||||
auto qsf = this->format();
|
||||
qDebug() << "Constructor*****************\nVersion: " << qsf.majorVersion() << ',' << qsf.minorVersion();
|
||||
qDebug() << "Profile: " << qsf.profile();
|
||||
qDebug() << "Depth buffer size: " << qsf.depthBufferSize();
|
||||
qDebug() << "Swap behavior: " << qsf.swapBehavior();
|
||||
qDebug() << "Swap interval: " << qsf.swapInterval();
|
||||
//auto qsf = this->format();
|
||||
//qDebug() << "Constructor*****************\nVersion: " << qsf.majorVersion() << ',' << qsf.minorVersion();
|
||||
//qDebug() << "Profile: " << qsf.profile();
|
||||
//qDebug() << "Depth buffer size: " << qsf.depthBufferSize();
|
||||
//qDebug() << "Swap behavior: " << qsf.swapBehavior();
|
||||
//qDebug() << "Swap interval: " << qsf.swapInterval();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -144,12 +144,12 @@ void GLWidget::InitGL()
|
||||
{
|
||||
if (!m_Init)
|
||||
{
|
||||
auto qsf = this->format();
|
||||
qDebug() << "InitGL*****************\nVersion: " << qsf.majorVersion() << ',' << qsf.minorVersion();
|
||||
qDebug() << "Profile: " << qsf.profile();
|
||||
qDebug() << "Depth buffer size: " << qsf.depthBufferSize();
|
||||
qDebug() << "Swap behavior: " << qsf.swapBehavior();
|
||||
qDebug() << "Swap interval: " << qsf.swapInterval();
|
||||
//auto qsf = this->format();
|
||||
//qDebug() << "InitGL*****************\nVersion: " << qsf.majorVersion() << ',' << qsf.minorVersion();
|
||||
//qDebug() << "Profile: " << qsf.profile();
|
||||
//qDebug() << "Depth buffer size: " << qsf.depthBufferSize();
|
||||
//qDebug() << "Swap behavior: " << qsf.swapBehavior();
|
||||
//qDebug() << "Swap interval: " << qsf.swapInterval();
|
||||
int w = std::ceil(m_Fractorium->ui.GLParentScrollArea->width() * devicePixelRatioF());
|
||||
int h = std::ceil(m_Fractorium->ui.GLParentScrollArea->height() * devicePixelRatioF());
|
||||
SetDimensions(w, h);
|
||||
@ -182,6 +182,65 @@ void GLWidget::InitGL()
|
||||
|
||||
m_Fractorium->m_Controller->DelayedStartRenderTimer();
|
||||
m_Init = true;
|
||||
/*
|
||||
auto clinfo = OpenCLInfo::DefInstance();
|
||||
auto& platforms = clinfo->Platforms();
|
||||
auto& alldevices = clinfo->Devices();
|
||||
std::vector<std::string> strs;
|
||||
auto cdc = wglGetCurrentDC();
|
||||
auto cc = wglGetCurrentContext();
|
||||
ostringstream os;
|
||||
strs.push_back(os.str()); os.str(""); os << "GLWidget::InitGL():";
|
||||
strs.push_back(os.str()); os.str(""); os << "\nCurrent DC: " << cdc;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nCurrent Context: " << cc;
|
||||
|
||||
for (int platform = 0; platform < platforms.size(); platform++)
|
||||
{
|
||||
cl_context_properties props[] =
|
||||
{
|
||||
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
|
||||
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
|
||||
CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>((platforms[platform])()),
|
||||
0
|
||||
};
|
||||
// Find CL capable devices in the current GL context
|
||||
//wglMakeCurrent(wglGetCurrentDC(), wglGetCurrentContext());
|
||||
::wglMakeCurrent(wglGetCurrentDC(), wglGetCurrentContext());
|
||||
size_t sizedev;
|
||||
cl_device_id devices[32];
|
||||
clGetGLContextInfoKHR_fn clGetGLContextInfo = (clGetGLContextInfoKHR_fn)clGetExtensionFunctionAddressForPlatform(platforms[platform](), "clGetGLContextInfoKHR");
|
||||
clGetGLContextInfo(props, CL_DEVICES_FOR_GL_CONTEXT_KHR, 32 * sizeof(cl_device_id), devices, &sizedev);
|
||||
sizedev = (cl_uint)(sizedev / sizeof(cl_device_id));
|
||||
|
||||
for (int i = 0; i < sizedev; i++)
|
||||
{
|
||||
std::string s;
|
||||
size_t pi, di;
|
||||
auto dd = clinfo->DeviceFromId(devices[i], pi, di);
|
||||
|
||||
if (dd)
|
||||
{
|
||||
auto& dev = *dd;
|
||||
auto& plat = platforms[pi];
|
||||
strs.push_back(os.str()); os.str(""); os << "\nPlatform[" << pi << "], device[" << di << "] is GL capable.";
|
||||
strs.push_back(os.str()); os.str(""); os << "\nPlatform profile: " << plat.getInfo<CL_PLATFORM_PROFILE>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nPlatform version: " << plat.getInfo<CL_PLATFORM_VERSION>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nPlatform name: " << plat.getInfo<CL_PLATFORM_NAME>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nPlatform vendor: " << plat.getInfo<CL_PLATFORM_VENDOR>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nPlatform extensions: " << plat.getInfo<CL_PLATFORM_EXTENSIONS>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nVendor: " << dev.getInfo<CL_DEVICE_VENDOR>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nDevice: " << dev.getInfo<CL_DEVICE_NAME>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nDriver version: " << dev.getInfo<CL_DRIVER_VERSION>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nDevice profile: " << dev.getInfo<CL_DEVICE_PROFILE>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nDevice version: " << dev.getInfo<CL_DEVICE_VERSION>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nDevice extensions: " << dev.getInfo<CL_DEVICE_EXTENSIONS>(nullptr).c_str() << endl;
|
||||
strs.push_back(os.str()); os.str(""); os << "\nDevice OpenCL C version: " << dev.getInfo<CL_DEVICE_OPENCL_C_VERSION>(nullptr).c_str() << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_Fractorium->ErrorReportToQTextEdit(strs, m_Fractorium->ui.InfoRenderingTextEdit);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,23 +302,28 @@ void GLWidget::DrawQuad()
|
||||
this->glEnable(GL_TEXTURE_2D);
|
||||
this->glActiveTexture(GL_TEXTURE0);
|
||||
auto renderer = m_Fractorium->m_Controller->Renderer();
|
||||
auto finalImage = m_Fractorium->m_Controller->FinalImage();
|
||||
|
||||
//Ensure all allocation has taken place first.
|
||||
if (m_OutputTexID != 0 && finalImage && !finalImage->empty())
|
||||
if (m_OutputTexID != 0)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, m_OutputTexID);//The texture to draw to.
|
||||
auto scaledW = std::ceil(width() * devicePixelRatioF());
|
||||
auto scaledH = std::ceil(height() * devicePixelRatioF());
|
||||
|
||||
//Only draw if the dimensions match exactly.
|
||||
if (m_TexWidth == m_Fractorium->m_Controller->FinalRasW() &&
|
||||
m_TexHeight == m_Fractorium->m_Controller->FinalRasH() &&
|
||||
((m_TexWidth * m_TexHeight) == GLint(finalImage->size())))
|
||||
if (m_TexWidth == m_Fractorium->m_Controller->FinalRasW() && m_TexHeight == m_Fractorium->m_Controller->FinalRasH())
|
||||
{
|
||||
//Copy data from CPU to OpenGL if using a CPU renderer. This is not needed when using OpenCL.
|
||||
if (renderer->RendererType() == eRendererType::CPU_RENDERER)
|
||||
this->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_TexWidth, m_TexHeight, GL_RGBA, GL_FLOAT, finalImage->data());
|
||||
if (renderer->RendererType() == eRendererType::CPU_RENDERER || !renderer->Shared())
|
||||
{
|
||||
auto finalImage = m_Fractorium->m_Controller->FinalImage();
|
||||
|
||||
if (finalImage &&//Make absolutely sure all image dimensions match when copying host side buffer to GL texture.
|
||||
!finalImage->empty() &&
|
||||
((m_TexWidth * m_TexHeight) == GLint(finalImage->size())) &&
|
||||
(finalImage->size() == renderer->FinalDimensions()))
|
||||
this->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_TexWidth, m_TexHeight, GL_RGBA, GL_FLOAT, finalImage->data());
|
||||
}
|
||||
|
||||
m_QuadProgram->bind();
|
||||
this->glVertexAttribPointer(m_TexturePosAttr, 2, GL_FLOAT, GL_FALSE, 0, m_TexVerts.data());
|
||||
@ -363,12 +427,12 @@ GLuint GLWidget::OutputTexID() { return m_OutputTexID; }
|
||||
void GLWidget::initializeGL()
|
||||
{
|
||||
#ifdef USE_GLSL
|
||||
auto qsf = this->format();
|
||||
qDebug() << "initializeGL*****************\nVersion: " << qsf.majorVersion() << ',' << qsf.minorVersion();
|
||||
qDebug() << "Profile: " << qsf.profile();
|
||||
qDebug() << "Depth buffer size: " << qsf.depthBufferSize();
|
||||
qDebug() << "Swap behavior: " << qsf.swapBehavior();
|
||||
qDebug() << "Swap interval: " << qsf.swapInterval();
|
||||
//auto qsf = this->format();
|
||||
//qDebug() << "initializeGL*****************\nVersion: " << qsf.majorVersion() << ',' << qsf.minorVersion();
|
||||
//qDebug() << "Profile: " << qsf.profile();
|
||||
//qDebug() << "Depth buffer size: " << qsf.depthBufferSize();
|
||||
//qDebug() << "Swap behavior: " << qsf.swapBehavior();
|
||||
//qDebug() << "Swap interval: " << qsf.swapInterval();
|
||||
|
||||
if (!m_Init && m_Fractorium)
|
||||
{
|
||||
@ -541,11 +605,7 @@ void GLEmberController<T>::DrawImage()
|
||||
|
||||
if (SizesMatch())//Ensure all sizes are correct. If not, do nothing.
|
||||
{
|
||||
auto finalImage = m_FractoriumEmberController->FinalImage();
|
||||
|
||||
if ((renderer->RendererType() == eRendererType::OPENCL_RENDERER) || finalImage)//Final image only matters for CPU renderer.
|
||||
if ((renderer->RendererType() == eRendererType::OPENCL_RENDERER) || finalImage->size() == renderer->FinalDimensions())
|
||||
m_GL->DrawQuad();//Output image is drawn here.
|
||||
m_GL->DrawQuad();//Output image is drawn here.
|
||||
}
|
||||
|
||||
renderer->LeaveResize();//Unlock, may not be necessary.
|
||||
@ -1149,6 +1209,7 @@ bool GLWidget::Allocate(bool force)
|
||||
}
|
||||
|
||||
#endif
|
||||
this->glFinish();
|
||||
return m_OutputTexID != 0;
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,8 @@ FractoriumOptionsDialog::FractoriumOptionsDialog(QWidget* p, Qt::WindowFlags f)
|
||||
ui.DeviceTable->setEnabled(false);
|
||||
ui.OpenCLCheckBox->setChecked(false);
|
||||
ui.OpenCLCheckBox->setEnabled(false);
|
||||
ui.SharedTextureCheckBox->setChecked(false);
|
||||
ui.SharedTextureCheckBox->setEnabled(false);
|
||||
ui.OpenCLSubBatchSpin->setEnabled(false);
|
||||
ui.OpenCLQualitySpin->setEnabled(false);
|
||||
ui.OpenCLFilteringDERadioButton->setEnabled(false);
|
||||
@ -67,6 +69,7 @@ bool FractoriumOptionsDialog::YAxisUp() { return ui.YAxisUpCheckBox->isChecked()
|
||||
bool FractoriumOptionsDialog::Transparency() { return ui.TransparencyCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::ContinuousUpdate() { return ui.ContinuousUpdateCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::OpenCL() { return ui.OpenCLCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::SharedTexture() { return ui.SharedTextureCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::Double() { return ui.DoublePrecisionCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::ShowAllXforms() { return ui.ShowAllXformsCheckBox->isChecked(); }
|
||||
bool FractoriumOptionsDialog::ToggleType() { return ui.ToggleTypeCheckBox->isChecked(); }
|
||||
@ -127,6 +130,7 @@ void FractoriumOptionsDialog::OnOpenCLCheckBoxStateChanged(int state)
|
||||
ui.DeviceTable->setEnabled(checked);
|
||||
ui.ThreadCountSpin->setEnabled(!checked);
|
||||
ui.CpuSubBatchSpin->setEnabled(!checked);
|
||||
ui.SharedTextureCheckBox->setEnabled(checked);
|
||||
ui.OpenCLSubBatchSpin->setEnabled(checked);
|
||||
ui.OpenCLQualitySpin->setEnabled(checked);
|
||||
ui.CpuQualitySpin->setEnabled(!checked);
|
||||
@ -180,6 +184,7 @@ void FractoriumOptionsDialog::GuiToData()
|
||||
m_Settings->Transparency(Transparency());
|
||||
m_Settings->ContinuousUpdate(ContinuousUpdate());
|
||||
m_Settings->OpenCL(OpenCL());
|
||||
m_Settings->SharedTexture(SharedTexture());
|
||||
m_Settings->Double(Double());
|
||||
m_Settings->ShowAllXforms(ShowAllXforms());
|
||||
m_Settings->ToggleType(ToggleType());
|
||||
@ -217,6 +222,7 @@ void FractoriumOptionsDialog::DataToGui()
|
||||
ui.TransparencyCheckBox->setChecked(m_Settings->Transparency());
|
||||
ui.ContinuousUpdateCheckBox->setChecked(m_Settings->ContinuousUpdate());
|
||||
ui.OpenCLCheckBox->setChecked(m_Settings->OpenCL());
|
||||
ui.SharedTextureCheckBox->setChecked(m_Settings->SharedTexture());
|
||||
ui.DoublePrecisionCheckBox->setChecked(m_Settings->Double());
|
||||
ui.ShowAllXformsCheckBox->setChecked(m_Settings->ShowAllXforms());
|
||||
ui.ToggleTypeCheckBox->setChecked(m_Settings->ToggleType());
|
||||
|
@ -25,23 +25,12 @@ class FractoriumOptionsDialog : public QDialog
|
||||
|
||||
public:
|
||||
FractoriumOptionsDialog(QWidget* p = nullptr, Qt::WindowFlags f = 0);
|
||||
|
||||
public slots:
|
||||
void OnOpenCLCheckBoxStateChanged(int state);
|
||||
void OnDeviceTableCellChanged(int row, int col);
|
||||
void OnDeviceTableRadioToggled(bool checked);
|
||||
virtual void accept() override;
|
||||
virtual void reject() override;
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent* e) override;
|
||||
|
||||
private:
|
||||
bool EarlyClip();
|
||||
bool YAxisUp();
|
||||
bool Transparency();
|
||||
bool ContinuousUpdate();
|
||||
bool OpenCL();
|
||||
bool SharedTexture();
|
||||
bool Double();
|
||||
bool ShowAllXforms();
|
||||
bool ToggleType();
|
||||
@ -55,6 +44,17 @@ private:
|
||||
void DataToGui();
|
||||
void GuiToData();
|
||||
|
||||
public slots:
|
||||
void OnOpenCLCheckBoxStateChanged(int state);
|
||||
void OnDeviceTableCellChanged(int row, int col);
|
||||
void OnDeviceTableRadioToggled(bool checked);
|
||||
virtual void accept() override;
|
||||
virtual void reject() override;
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent* e) override;
|
||||
|
||||
private:
|
||||
Ui::OptionsDialog ui;
|
||||
shared_ptr<OpenCLInfo> m_Info;
|
||||
SpinBox* m_XmlTemporalSamplesSpin;
|
||||
|
@ -119,17 +119,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="YAxisUpCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Checked: Positive Y direction is up.</p><p>Unchecked: Positive Y direction is down.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Positive Y Up</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="DoublePrecisionCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Checked: use 64-bit double precision numbers (slower, but better image quality).</p><p>Unchecked: use 32-bit single precision numbers (faster, but worse image quality).</p></body></html></string>
|
||||
@ -139,17 +129,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="TransparencyCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Use transparency in the final image.</p><p>This will not make a difference in the editor, but will when saving as .png and opening in other programs.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Transparency</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="ShowAllXformsCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Checked: show all xforms while dragging.</p><p>Unchecked: only show current xform while dragging.</p></body></html></string>
|
||||
@ -159,17 +139,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="ContinuousUpdateCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Continually update output image during interactive rendering.</p><p>This will slow down performance, but will give continuous updates on how the final render will look. Note that only log scale filtering is applied on each update. Full DE is not applied until iteration is complete.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Continuous Update</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="ToggleTypeCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Checked: right clicking toggles spin boxes, right button dragging disabled.</p><p>Unchecked: double clicking toggles spin boxes, right button dragging enabled.</p></body></html></string>
|
||||
@ -179,17 +149,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="Png16BitCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Save each RGBA component as 16-bits when saving Png files.</p><p>This leads to greater color precision for use in high end rendering and display on HDR monitors, however it makes the file size larger.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save 16-bit Png</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QTableWidget" name="DeviceTable">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
@ -277,7 +237,7 @@
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0" colspan="2">
|
||||
<item row="16" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="InteractiveRenderingTabGridLayout">
|
||||
<item row="3" column="1">
|
||||
<widget class="QGroupBox" name="InteraciveGpuFilteringGroupBox">
|
||||
@ -476,7 +436,7 @@ in interactive mode for each mouse movement</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="LoadLastOnStartCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Checked: load the flame from the previous run on startup.</p><p>Unchecked: create randoms on startup.</p></body></html></string>
|
||||
@ -486,6 +446,56 @@ in interactive mode for each mouse movement</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="SharedTextureCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Share the memory between the final image output and the OpenGL texture used to display the image result on the interactive renderer.</p><p>This is a highly recommended performance optimization for interactive editing when using OpenCL if your card supports it.</p><p>If creating the OpenCL renderer fails, uncheck this option. You will see a slight performance decrease in interactive rendering.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Shared Texture</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="YAxisUpCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Checked: Positive Y direction is up.</p><p>Unchecked: Positive Y direction is down.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Positive Y Up</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="TransparencyCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Use transparency in the final image.</p><p>This will not make a difference in the editor, but will when saving as .png and opening in other programs.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Transparency</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="ContinuousUpdateCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Continually update output image during interactive rendering.</p><p>This will slow down performance, but will give continuous updates on how the final render will look. Note that only log scale filtering is applied on each update. Full DE is not applied until iteration is complete.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Continuous Update</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="Png16BitCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Save each RGBA component as 16-bits when saving Png files.</p><p>This leads to greater color precision for use in high end rendering and display on HDR monitors, however it makes the file size larger.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save 16-bit Png</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="OptionsXmlSavingTab">
|
||||
@ -903,13 +913,9 @@ in interactive mode for each mouse movement</string>
|
||||
<tabstops>
|
||||
<tabstop>EarlyClipCheckBox</tabstop>
|
||||
<tabstop>OpenCLCheckBox</tabstop>
|
||||
<tabstop>YAxisUpCheckBox</tabstop>
|
||||
<tabstop>DoublePrecisionCheckBox</tabstop>
|
||||
<tabstop>TransparencyCheckBox</tabstop>
|
||||
<tabstop>ShowAllXformsCheckBox</tabstop>
|
||||
<tabstop>ContinuousUpdateCheckBox</tabstop>
|
||||
<tabstop>ToggleTypeCheckBox</tabstop>
|
||||
<tabstop>Png16BitCheckBox</tabstop>
|
||||
<tabstop>LoadLastOnStartCheckBox</tabstop>
|
||||
<tabstop>ThreadCountSpin</tabstop>
|
||||
<tabstop>CpuSubBatchSpin</tabstop>
|
||||
|
Reference in New Issue
Block a user