large scale renderer rework

- Abstracts all OpenGL functionality including UI objects
- Cleans up several rendering codepaths
- Improves threading functionality
- Removes old code and problematic functions
This commit is contained in:
itsmattkc
2020-11-10 11:24:51 +11:00
parent 52b98f3fa3
commit 1d61f89920
42 changed files with 927 additions and 820 deletions
+7 -20
View File
@@ -245,17 +245,9 @@ FramePtr FrameHashCache::LoadCacheFrame(const QString &fn)
PixelFormat::Format image_format;
if (pix_type == Imf::HALF) {
if (has_alpha) {
image_format = PixelFormat::PIX_FMT_RGBA16F;
} else {
image_format = PixelFormat::PIX_FMT_RGB16F;
}
image_format = PixelFormat::PIX_FMT_RGBA16F;
} else {
if (has_alpha) {
image_format = PixelFormat::PIX_FMT_RGBA32F;
} else {
image_format = PixelFormat::PIX_FMT_RGB32F;
}
image_format = PixelFormat::PIX_FMT_RGBA32F;
}
frame = Frame::Create();
@@ -268,7 +260,7 @@ FramePtr FrameHashCache::LoadCacheFrame(const QString &fn)
int bpc = PixelFormat::BytesPerChannel(image_format);
size_t xs = PixelFormat::ChannelCount(image_format) * bpc;
size_t xs = kRGBAChannels * bpc;
size_t ys = frame->linesize_bytes();
Imf::FrameBuffer framebuffer;
@@ -411,8 +403,7 @@ bool FrameHashCache::SaveCacheFrame(const QString &filename, char *data, const V
// Floating point types are stored in EXR
Imf::PixelType pix_type;
if (vparam.format() == PixelFormat::PIX_FMT_RGB16F
|| vparam.format() == PixelFormat::PIX_FMT_RGBA16F) {
if (vparam.format() == PixelFormat::PIX_FMT_RGBA16F) {
pix_type = Imf::HALF;
} else {
pix_type = Imf::FLOAT;
@@ -423,9 +414,7 @@ bool FrameHashCache::SaveCacheFrame(const QString &filename, char *data, const V
header.channels().insert("R", Imf::Channel(pix_type));
header.channels().insert("G", Imf::Channel(pix_type));
header.channels().insert("B", Imf::Channel(pix_type));
if (PixelFormat::FormatHasAlphaChannel(vparam.format())) {
header.channels().insert("A", Imf::Channel(pix_type));
}
header.channels().insert("A", Imf::Channel(pix_type));
header.compression() = Imf::DWAA_COMPRESSION;
header.insert("dwaCompressionLevel", Imf::FloatAttribute(200.0f));
@@ -435,16 +424,14 @@ bool FrameHashCache::SaveCacheFrame(const QString &filename, char *data, const V
int bpc = PixelFormat::BytesPerChannel(vparam.format());
size_t xs = PixelFormat::ChannelCount(vparam.format()) * bpc;
size_t xs = kRGBAChannels * bpc;
size_t ys = linesize_bytes;
Imf::FrameBuffer framebuffer;
framebuffer.insert("R", Imf::Slice(pix_type, data, xs, ys));
framebuffer.insert("G", Imf::Slice(pix_type, data + bpc, xs, ys));
framebuffer.insert("B", Imf::Slice(pix_type, data + 2*bpc, xs, ys));
if (PixelFormat::FormatHasAlphaChannel(vparam.format())) {
framebuffer.insert("A", Imf::Slice(pix_type, data + 3*bpc, xs, ys));
}
framebuffer.insert("A", Imf::Slice(pix_type, data + 3*bpc, xs, ys));
out.setFrameBuffer(framebuffer);
out.writePixels(vparam.effective_height());