source-tree refactoring

This commit is contained in:
2023-02-03 21:22:25 +03:00
parent b20068165f
commit 7d30802cbd
153 changed files with 606 additions and 278 deletions

View File

@@ -7,6 +7,9 @@ if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
project(QGLEngine)
if (NOT DEFINED SHSTKPROJECT)
include(SHSTKQtMacros)
endif()
find_package(QAD REQUIRED)
shstk_qt_founded(QtVersions)
set(_qgl_ok 0)
@@ -19,9 +22,8 @@ endif()
if (NOT _qgl_ok)
message(WARNING "Building ${PROJECT_NAME} available only on Qt5/6!")
else()
qad_find_qt(Core Gui OpenGL OpenGLWidgets Xml)
find_package(OpenGL REQUIRED)
include(SHSTKQtMacros)
include_directories("c:/sdk/MinGW/x32/lib/gcc/i686-w64-mingw32/8.1.0/include")
set(QGLEngine_MAJOR 1)
set(QGLEngine_MINOR 0)
@@ -35,44 +37,10 @@ else()
endif()
shstk_begin_project(QGLEngine)
set(_qglengine_root_build "${CMAKE_CURRENT_BINARY_DIR}")
qad_sources(SRC)
qad_sources(FSRC DIR "formats")
list(APPEND SRC ${FSRC})
qad_sources(FSRC DIR "core")
list(APPEND SRC ${FSRC})
qad_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
file(GLOB PHS "*_p.h" "formats/*_p.h" "core/*_p.h")
list(REMOVE_ITEM out_HDR "${PHS}")
import_version(qglengine_core QGLEngine)
set_deploy_property(qglengine_core ${QGLEngine_LIB_TYPE}
LABEL "QGLEngine core library"
FULLNAME "${QGLEngine_DOMAIN}.qglengine_core"
COMPANY "${QGLEngine_COMPANY}"
INFO "QGLEngine core library")
make_rc(qglengine_core _RC)
qad_add_library(qglengine_core ${QGLEngine_LIB_TYPE} out_CPP ${_RC})
qad_generate_export_header(qglengine_core)
list(APPEND out_HDR "${CMAKE_CURRENT_BINARY_DIR}/qglengine_core_export.h")
list(APPEND out_HDR "${QGLEngine_VERSION_FILE}")
qad_target_include_directories(qglengine_core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/core")
qad_target_link_libraries(qglengine_core QAD::Widgets assimp ${OPENGL_LIBRARIES})
message(STATUS "Building QGLEngine version ${QGLEngine_VERSION} (${QGLEngine_LIB_TYPE_MSG}) for ${QtVersions}")
list(APPEND QT_MULTILIB_LIST qglengine_core)
add_subdirectory(widgets)
add_subdirectory(src)
shstk_copy_to_parent()
shstk_qad_install("qglengine" FALSE "qglengine_core" "${out_HDR}" "out_QM")
if (NOT DEFINED ANDROID_PLATFORM)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin")
#add_subdirectory(plugin)
endif()
endif()
qad_sources(test_SRC DIR "qglview_test")
qad_wrap(${test_SRC} CPPS test_CPP)
qad_add_executable(qglengine_test test_CPP)
qad_target_link_libraries(qglengine_test qglengine_core qglengine_widgets)
qad_target_include_directories(qglengine_test PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/core" "${CMAKE_CURRENT_SOURCE_DIR}/widgets")
file(GLOB CMAKES "cmake/*.cmake" "cmake/*.in")
install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules)

View File

@@ -1,55 +0,0 @@
/*
QGL Primitives
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLPRIMITIVE_CUBE_H
#define GLPRIMITIVE_CUBE_H
#include "gltypes.h"
namespace Primitive {
Mesh * plane(float width = 1., float length = 1.);
Mesh * cube(float width = 1., float length = 1., float height = 1.);
Mesh * ellipsoid(int segments_wl, int segments_h, float radius = 1., float end_angle = 360.);
Mesh * disc(int segments, float radius = 1., float end_angle = 360.);
Mesh * cone(int segments, float radius = 1., float height = 1.);
Mesh * cylinder(int segments, float radius = 1., float height = 1., float end_angle = 360.);
Mesh * arrow(int segments = 16, float thick = 0.04, float angle = 30.); // length = 1
Mesh * torus(int segments_main = 30, int segments_second = 16, float radius_main = 2.5, float radius_second = 0.5, float end_angle = 360.);
Mesh * lineFrame(QVector3D p0, QVector3D p1);
Mesh * cubeFrame(float width = 1., float length = 1., float height = 1.);
Mesh * ellipsoidFrame(int segments_wl, int segments_h, float radius = 1.);
Mesh * coneFrame(int segments, float radius = 1., float height = 1.);
} // namespace Primitive
#endif // GLPRIMITIVE_CUBE_H

View File

@@ -1,46 +0,0 @@
<RCC>
<qresource prefix="/">
<file>coeffs_brdf.png</file>
<file>icons/add-type-camera.png</file>
<file>icons/add-type-geo.png</file>
<file>icons/add-type-light.png</file>
<file>icons/add-type-empty.png</file>
<file>icons/collapse.png</file>
<file>icons/expand.png</file>
<file>icons/edit-rename.png</file>
<file>icons/alpha.png</file>
<file>icons/application-exit.png</file>
<file>icons/configure.png</file>
<file>icons/dialog-close.png</file>
<file>icons/document-edit.png</file>
<file>icons/document-import.png</file>
<file>icons/document-new.png</file>
<file>icons/document-open.png</file>
<file>icons/document-save.png</file>
<file>icons/document-save-all.png</file>
<file>icons/edit-clear.png</file>
<file>icons/edit-clear-locationbar-rtl.png</file>
<file>icons/edit-copy.png</file>
<file>icons/edit-delete.png</file>
<file>icons/edit-find.png</file>
<file>icons/edit-paste.png</file>
<file>icons/go-jump.png</file>
<file>icons/go-top.png</file>
<file>icons/layer-visible-on.png</file>
<file>icons/layer-visible-off.png</file>
<file>icons/light-+.png</file>
<file>icons/list-add.png</file>
<file>icons/object-flip-horizontal.png</file>
<file>icons/object-flip-vertical.png</file>
<file>icons/picker.png</file>
<file>icons/qglview.png</file>
<file>icons/transform-move.png</file>
<file>icons/transform-rotate.png</file>
<file>icons/transform-scale.png</file>
<file>icons/type-camera.png</file>
<file>icons/type-geo.png</file>
<file>icons/type-light.png</file>
<file>icons/type-empty.png</file>
<file>icons/view-refresh.png</file>
</qresource>
</RCC>

View File

@@ -1,19 +0,0 @@
<RCC>
<qresource prefix="/">
<file>shaders/ds_final.glsl</file>
<file>shaders/ds_geom.glsl</file>
<file>shaders/ds_light.glsl</file>
<file>shaders/ds_tonemap.glsl</file>
<file>shaders/fxaa.frag</file>
<file>shaders/fxaa.vert</file>
<file>shaders/fxaa_v3.h</file>
<file>shaders/selection.glsl</file>
<file>shaders/selection_apply.glsl</file>
<file>shaders/selection_frame.glsl</file>
<file>shaders/selection_halo.glsl</file>
<file>shaders/service_fill.glsl</file>
<file>shaders/service_frame.glsl</file>
<file>shaders/service_line.glsl</file>
<file>shaders/sum.glsl</file>
</qresource>
</RCC>

9
src/CMakeLists.txt Normal file
View File

@@ -0,0 +1,9 @@
#if (NOT DEFINED ANDROID_PLATFORM)
# if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin")
# #add_subdirectory(plugin)
# endif()
#endif()
foreach (_d "core" "widgets" "qglview_test") # "plugin")
add_subdirectory("${_d}")
endforeach()
shstk_copy_to_parent()

35
src/core/CMakeLists.txt Normal file
View File

@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.0)
project(qglengine_core)
if (POLICY CMP0017)
cmake_policy(SET CMP0017 NEW)
endif()
qad_find_qt(Core Gui OpenGL OpenGLWidgets Xml)
find_package(OpenGL REQUIRED)
qad_sources(SRC)
set(_includes "${_qglengine_root_build}")
foreach (_d "formats" "core" "scene" "render")
qad_sources(FSRC DIR "${_d}")
list(APPEND SRC ${FSRC})
list(APPEND _includes "${CMAKE_CURRENT_SOURCE_DIR}/${_d}")
endforeach()
qad_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
file(GLOB PHS "*_p.h")
list(REMOVE_ITEM out_HDR "${PHS}")
import_version(${PROJECT_NAME} QGLEngine)
set_deploy_property(${PROJECT_NAME} ${QGLEngine_LIB_TYPE}
LABEL "QGLEngine core library"
FULLNAME "${QGLEngine_DOMAIN}.qglengine_core"
COMPANY "${QGLEngine_COMPANY}"
INFO "QGLEngine core library")
make_rc(${PROJECT_NAME} _RC)
qad_add_library(${PROJECT_NAME} ${QGLEngine_LIB_TYPE} out_CPP ${_RC})
qad_generate_export_header(${PROJECT_NAME})
list(APPEND out_HDR "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_export.h")
qad_target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" ${_includes})
qad_target_link_libraries(${PROJECT_NAME} QAD::Widgets assimp ${OPENGL_LIBRARIES})
message(STATUS "Building QGLEngine version ${QGLEngine_VERSION} (${QGLEngine_LIB_TYPE_MSG}) for ${QtVersions}")
list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME})
shstk_copy_to_parent()
#message(STATUS "Building ${PROJECT_NAME}")
shstk_qad_install("qglengine" FALSE "${PROJECT_NAME}" "${out_HDR}" "out_QM")

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -22,7 +22,7 @@
#include "gltypes.h"
class Buffer {
class QGLENGINE_CORE_EXPORT Buffer {
friend class ObjectBase;
public:

View File

@@ -22,9 +22,9 @@
#include "chunkstream.h"
#include "glshaders_types.h"
QVector<QVector3D> loadFileHDR(const QString & path, QSize * size = 0);
QVector<QVector3D> QGLENGINE_CORE_EXPORT loadFileHDR(const QString & path, QSize * size = 0);
class CubeTexture {
class QGLENGINE_CORE_EXPORT CubeTexture {
public:
CubeTexture(QOpenGLExtraFunctions * f_, int _size, const GLenum & _format = GL_RGB16F);
bool init();

View File

@@ -22,7 +22,7 @@
#include "glbuffer.h"
class Framebuffer {
class QGLENGINE_CORE_EXPORT Framebuffer {
friend class FramebufferMipmap;
public:

View File

@@ -22,7 +22,7 @@
#include "glframebuffer.h"
class FramebufferMipmap {
class QGLENGINE_CORE_EXPORT FramebufferMipmap {
public:
FramebufferMipmap(const Framebuffer & fb, int index_from_, int levels = 2);
virtual ~FramebufferMipmap();

View File

@@ -0,0 +1,145 @@
/*
QGL Framebuffer effect basic
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "glframebuffereffectbase.h"
#include "renderer.h"
#include <QTime>
FramebufferEffectBase::FramebufferEffectBase() {}
FramebufferEffectBase::~FramebufferEffectBase() {
/*if (fbo > 0) deleteGLFramebuffer(fbo);
deleteGLRenderbuffer(drbo);
for (int i = 0; i < colors.size(); ++i)
deleteGLTexture(f, colors[i]);
deleteGLTexture(f, tex_d);*/
}
void FramebufferEffectBase::resize(int width, int height, bool force) {
/*if (fbo > 0) {
if ((wid == width) && (hei == height) && !force) return;
}
wid = width;
hei = height;
if (fbo > 0) deleteGLFramebuffer(fbo);
f->glGenFramebuffers(1, &fbo);
f->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
// qDebug() << "resize" << f << wid << hei << fbo;
for (int i = 0; i < colors.size(); ++i) {
deleteGLTexture(f, colors[i]);
createGLTexture(f, colors[i], width, height, color_formats[i], target_);
f->glTexParameteri(target_, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
f->glTexParameteri(target_, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
f->glTexParameteri(target_, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
f->glTexParameteri(target_, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
f->glTexParameteri(target_, GL_TEXTURE_MAX_LEVEL, 4);
f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, target_, colors[i], 0);
}
if (is_depth) {
deleteGLTexture(f, tex_d);
if (drbo > 0) deleteGLRenderbuffer(drbo);
f->glGenRenderbuffers(1, &drbo);
f->glBindRenderbuffer(GL_RENDERBUFFER, drbo);
f->glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, width, height);
f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, drbo);
createGLTexture(f, tex_d, width, height, GL_DEPTH_COMPONENT);
f->glTexParameteri(target_, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
f->glTexParameteri(target_, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
f->glTexParameteri(target_, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
f->glTexParameteri(target_, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, target_, tex_d, 0);
}
f->glBindFramebuffer(GL_FRAMEBUFFER, 0);
if (pbo.isInit()) {
enablePixelBuffer();
}
is_changed = false;*/
}
void FramebufferEffectBase::reinit() {
/*pbo.reinit();
colors.fill(0);
fbo = drbo = 0;
tex_d = 0;
pbo_queried = 0;
is_changed = true;*/
}
void FramebufferEffectBase::bindDeferredBuffer(int role, int channel) {
r->fbo_ds.bindColorTexture(role, channel);
}
void FramebufferEffectBase::bindDepthBuffer(int channel) {
r->fbo_ds.bindDepthTexture(channel);
}
void FramebufferEffectBase::bindPreviousOutput(int channel) {
r->fbo_out.bindColorTexture(r->prev_write_plane, channel);
}
void FramebufferEffectBase::setOutputPlane(int channel) {
r->fbo_out.setWriteBuffer(channel);
r->prev_write_plane = r->cur_write_plane;
r->cur_write_plane = channel;
}
void FramebufferEffectBase::drawScreen(QOpenGLShaderProgram * prog) {
r->renderQuad(prog, r->quad, nullptr);
}
void FramebufferEffectBase::drawInternal() {
if (!r) return;
draw();
}
void FramebufferEffectBase::reloadShadersInternal() {
if (!r) return;
if (is_loaded) return;
reloadShaders();
is_loaded = true;
}
QVector<int> FramebufferEffectBase::getFreePlanes(int count) {
return r->getFreePlanes(count);
}
int FramebufferEffectBase::previousOutputPlane() const {
return r->prev_write_plane;
}
void FramebufferEffectBase::deleteShader(QOpenGLShaderProgram *& s) {
if (!s) return;
delete s;
s = nullptr;
}

View File

@@ -0,0 +1,59 @@
/*
QGL Framebuffer effect basic
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef glframebuffereffectbase_H
#define glframebuffereffectbase_H
#include "glframebuffer.h"
class QGLENGINE_CORE_EXPORT FramebufferEffectBase {
friend class FramebufferMipmap;
friend class Renderer;
public:
FramebufferEffectBase();
virtual ~FramebufferEffectBase();
virtual void draw() = 0;
protected:
void resize(int width, int height, bool force = false);
void reinit();
virtual int maxPlanesUsed() const { return 1; }
virtual void reloadShaders() {}
void bindDeferredBuffer(int role, int channel);
void bindDepthBuffer(int channel);
void bindPreviousOutput(int channel);
void setOutputPlane(int channel);
void drawScreen(QOpenGLShaderProgram * prog);
void drawInternal();
void reloadShadersInternal();
QVector<int> getFreePlanes(int count);
int previousOutputPlane() const;
static void deleteShader(QOpenGLShaderProgram *& s);
private:
bool is_loaded = false;
Renderer * r = nullptr;
GLint wid, hei;
};
#endif

View File

@@ -23,7 +23,7 @@
#include "glshaders_types.h"
class Map {
class QGLENGINE_CORE_EXPORT Map {
public:
Map();
void setBitmapPath(const QString & p);
@@ -43,7 +43,7 @@ public:
int _type, _layer;
};
class Material {
class QGLENGINE_CORE_EXPORT Material {
public:
Material(const QString _name = QString());
uint hash();

View File

@@ -24,7 +24,7 @@
#include <chunkstream.h>
class Mesh {
class QGLENGINE_CORE_EXPORT Mesh {
friend QDataStream & operator<<(QDataStream & s, const Mesh * m);
friend QDataStream & operator>>(QDataStream & s, Mesh *& m);
@@ -117,7 +117,7 @@ private:
};
QDataStream & operator<<(QDataStream & s, const Mesh * m);
QDataStream & operator>>(QDataStream & s, Mesh *& m);
QGLENGINE_CORE_EXPORT QDataStream & operator<<(QDataStream & s, const Mesh * m);
QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, Mesh *& m);
#endif // GLMESH_H

View File

@@ -0,0 +1,56 @@
/*
QGL Primitives
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLPRIMITIVE_CUBE_H
#define GLPRIMITIVE_CUBE_H
#include "gltypes.h"
namespace Primitive {
QGLENGINE_CORE_EXPORT Mesh * plane(float width = 1., float length = 1.);
QGLENGINE_CORE_EXPORT Mesh * cube(float width = 1., float length = 1., float height = 1.);
QGLENGINE_CORE_EXPORT Mesh * ellipsoid(int segments_wl, int segments_h, float radius = 1., float end_angle = 360.);
QGLENGINE_CORE_EXPORT Mesh * disc(int segments, float radius = 1., float end_angle = 360.);
QGLENGINE_CORE_EXPORT Mesh * cone(int segments, float radius = 1., float height = 1.);
QGLENGINE_CORE_EXPORT Mesh * cylinder(int segments, float radius = 1., float height = 1., float end_angle = 360.);
QGLENGINE_CORE_EXPORT Mesh * arrow(int segments = 16, float thick = 0.04, float angle = 30.); // length = 1
QGLENGINE_CORE_EXPORT Mesh *
torus(int segments_main = 30, int segments_second = 16, float radius_main = 2.5, float radius_second = 0.5, float end_angle = 360.);
QGLENGINE_CORE_EXPORT Mesh * lineFrame(QVector3D p0, QVector3D p1);
QGLENGINE_CORE_EXPORT Mesh * cubeFrame(float width = 1., float length = 1., float height = 1.);
QGLENGINE_CORE_EXPORT Mesh * ellipsoidFrame(int segments_wl, int segments_h, float radius = 1.);
QGLENGINE_CORE_EXPORT Mesh * coneFrame(int segments, float radius = 1., float height = 1.);
} // namespace Primitive
#endif // GLPRIMITIVE_CUBE_H

View File

@@ -67,6 +67,7 @@ QString prepareDefines(const QStringList & defines) {
bool QGLEngineShaders::loadShadersMulti(QOpenGLShaderProgram *& prog, const QString & file, bool add_qgl, const QStringList & defines) {
if (!prog) prog = new QOpenGLShaderProgram();
prog->removeAllShaders();
QFile f(file);
if (!f.open(QIODevice::ReadOnly)) {
qDebug() << "[QGLEngine] Shader" << file << "Error: can`t open file!";

View File

@@ -23,8 +23,10 @@
namespace QGLEngineShaders {
bool loadShadersMulti(QOpenGLShaderProgram *& prog, const QString & file, bool add_qgl = true, const QStringList & defines = QStringList());
bool loadShaders(QOpenGLShaderProgram *& prog, const QStringList & files, bool add_qgl = true, const QStringList & defines = QStringList());
QGLENGINE_CORE_EXPORT bool
loadShadersMulti(QOpenGLShaderProgram *& prog, const QString & file, bool add_qgl = true, const QStringList & defines = QStringList());
QGLENGINE_CORE_EXPORT bool
loadShaders(QOpenGLShaderProgram *& prog, const QStringList & files, bool add_qgl = true, const QStringList & defines = QStringList());
} // namespace QGLEngineShaders

View File

@@ -50,6 +50,7 @@ const char qgl_fragment_head[] =
"in vec2 qgl_FragTexture;\n"
"flat in uint qgl_MaterialIndex;\n"
"out vec4 qgl_FragData[gl_MaxDrawBuffers];\n"
"uniform vec2 qgl_ViewSize;\n"
"vec4 qgl_materialTexture(uint type, vec2 coord, vec4 tex_shift) {\n"
" coord *= qgl_material[qgl_MaterialIndex].map[type].scale;\n"
" vec4 t = texture(qgl_texture_array[qgl_material[qgl_MaterialIndex].map[type].array_index],\n"

View File

@@ -22,7 +22,7 @@
#include "gltypes.h"
class Texture2DArray {
class QGLENGINE_CORE_EXPORT Texture2DArray {
public:
Texture2DArray(bool filter);
~Texture2DArray();

View File

@@ -19,13 +19,15 @@
#ifndef GLTRANSFORM_H
#define GLTRANSFORM_H
#include "qglengine_core_export.h"
#include <QMatrix4x4>
#include <QQuaternion>
#include <QVector3D>
#include <chunkstream.h>
class Transform {
class QGLENGINE_CORE_EXPORT Transform {
friend QDataStream & operator>>(QDataStream & s, Transform & v);
public:

View File

@@ -179,8 +179,8 @@ inline float urand(const float & scale = 1.) {
inline float uprand(const float & scale = 1.) {
return ((float)rand() / RAND_MAX) * scale;
}
QString readCharsUntilNull(QDataStream & s);
QString findFile(const QString & file, const QStringList & pathes);
QGLENGINE_CORE_EXPORT QString readCharsUntilNull(QDataStream & s);
QGLENGINE_CORE_EXPORT QString findFile(const QString & file, const QStringList & pathes);
inline QColor operator*(const QColor & c, float v) {
return QColor(piClamp<int>(c.red() * v, 0, 255),
piClamp<int>(c.green() * v, 0, 255),
@@ -216,29 +216,29 @@ inline void deleteGLTexture(QOpenGLExtraFunctions * f, GLuint & tex) {
if (tex != 0) f->glDeleteTextures(1, &tex);
tex = 0;
}
void glEnableDepth();
void glDisableDepth();
void glClearFramebuffer(const QColor & color = Qt::black, bool depth = true);
void glDrawQuad(QOpenGLShaderProgram * prog = nullptr,
QGLENGINE_CORE_EXPORT void glEnableDepth();
QGLENGINE_CORE_EXPORT void glDisableDepth();
QGLENGINE_CORE_EXPORT void glClearFramebuffer(const QColor & color = Qt::black, bool depth = true);
QGLENGINE_CORE_EXPORT void glDrawQuad(QOpenGLShaderProgram * prog = nullptr,
QVector4D * corner_dirs = nullptr,
GLfloat x = -1.f,
GLfloat y = -1.f,
GLfloat w = 2.f,
GLfloat h = 2.f);
void createGLTexture(QOpenGLExtraFunctions * f,
QGLENGINE_CORE_EXPORT void createGLTexture(QOpenGLExtraFunctions * f,
GLuint & tex,
int width,
int height,
const GLenum & format = GL_RGBA,
const GLenum & target = GL_TEXTURE_2D);
void createGLTexture(QOpenGLExtraFunctions * f,
QGLENGINE_CORE_EXPORT void createGLTexture(QOpenGLExtraFunctions * f,
GLuint & tex,
const QImage & image,
const GLenum & format = GL_RGBA,
const GLenum & target = GL_TEXTURE_2D);
QMatrix4x4 glMatrixPerspective(float angle, float aspect, float near_);
QImage rotateQImageLeft(const QImage & im);
QImage rotateQImageRight(const QImage & im);
QGLENGINE_CORE_EXPORT QMatrix4x4 glMatrixPerspective(float angle, float aspect, float near_);
QGLENGINE_CORE_EXPORT QImage rotateQImageLeft(const QImage & im);
QGLENGINE_CORE_EXPORT QImage rotateQImageRight(const QImage & im);
inline QImage rotateQImage180(const QImage & im) {
return im.mirrored(true, true);
}
@@ -257,6 +257,7 @@ class TextureManager;
class Texture2DArray;
class Framebuffer;
class FramebufferMipmap;
class FramebufferEffectBase;
class VertexObject;
class Mesh;
class Scene;
@@ -273,7 +274,7 @@ enum RenderPass {
typedef QList<ObjectBase *> ObjectBaseList;
struct Box3D {
struct QGLENGINE_CORE_EXPORT Box3D {
GLfloat x;
GLfloat y;
GLfloat z;
@@ -352,7 +353,7 @@ inline QDebug operator<<(QDebug d, const Box3D & v) {
#pragma pack(push, 1)
struct Vector2i {
struct QGLENGINE_CORE_EXPORT Vector2i {
Vector2i(int p0_ = 0, int p1_ = 0) {
p0 = p0_;
p1 = p1_;
@@ -401,7 +402,7 @@ inline QDataStream & operator>>(QDataStream & s, Vector2i & v) {
#pragma pack(push, 1)
struct Vector3i {
struct QGLENGINE_CORE_EXPORT Vector3i {
Vector3i(int p0_ = 0, int p1_ = 0, int p2_ = 0) {
p0 = p0_;
p1 = p1_;
@@ -453,8 +454,8 @@ inline QDataStream & operator>>(QDataStream & s, Vector3i & v) {
}
QVector3D vectorFromString(const QString & str);
QColor colorFromString(const QString & str);
QGLENGINE_CORE_EXPORT QVector3D vectorFromString(const QString & str);
QGLENGINE_CORE_EXPORT QColor colorFromString(const QString & str);
inline QVector4D QColor2QVector(const QColor & c) {
return QVector4D(c.redF(), c.greenF(), c.blueF(), c.alphaF());
}
@@ -478,10 +479,10 @@ inline void normalizeAngleDeg360(float & a) {
inline QVector3D projection(const QVector3D & v, const QVector3D & to) {
return to.normalized() * v.length() * cosABV(v, to);
}
QVector3D orthToVector(const QVector3D & v, const float & scale = 1.);
QVector3D rotateVector(const QVector3D & v, const QVector3D & a);
void setVectorLength(QVector3D & v, const float & l);
void lengthenVector(QVector3D & v, const float & l);
QGLENGINE_CORE_EXPORT QVector3D orthToVector(const QVector3D & v, const float & scale = 1.);
QGLENGINE_CORE_EXPORT QVector3D rotateVector(const QVector3D & v, const QVector3D & a);
QGLENGINE_CORE_EXPORT void setVectorLength(QVector3D & v, const float & l);
QGLENGINE_CORE_EXPORT void lengthenVector(QVector3D & v, const float & l);
inline float squareLength(const QVector3D & from, const QVector3D & to) {
return (to.x() - from.x()) * (to.x() - from.x()) + (to.y() - from.y()) * (to.y() - from.y()) +
(to.z() - from.z()) * (to.z() - from.z());

View File

@@ -23,7 +23,7 @@
#include "glshaders_types.h"
class VertexObject {
class QGLENGINE_CORE_EXPORT VertexObject {
public:
VertexObject();
~VertexObject();

View File

@@ -21,7 +21,7 @@
#include "gltypes.h"
Scene * loadScene(const QString & filepath);
QStringList supportedFormats();
QGLENGINE_CORE_EXPORT Scene * loadScene(const QString & filepath);
QGLENGINE_CORE_EXPORT QStringList supportedFormats();
#endif // LOADER_ASSIMP_H

View File

@@ -23,7 +23,7 @@
#include <QFileInfo>
Scene * loadFromQGLFile(const QString & filepath);
bool saveToQGLFile(const QString & filepath, const Scene * scene);
QGLENGINE_CORE_EXPORT Scene * loadFromQGLFile(const QString & filepath);
QGLENGINE_CORE_EXPORT bool saveToQGLFile(const QString & filepath, const Scene * scene);
#endif // LOADER_QGL_H

View File

@@ -19,6 +19,8 @@
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include "qglengine_core_export.h"
#include <QWidget>
@@ -26,7 +28,7 @@ class QGLView;
class ObjectBase;
class Scene;
class GLWidget: public QWidget {
class QGLENGINE_CORE_EXPORT GLWidget: public QWidget {
Q_OBJECT
Q_PROPERTY(qreal lineWidth READ lineWidth WRITE setLineWidth)
Q_PROPERTY(qreal FOV READ FOV WRITE setFOV)

View File

@@ -27,7 +27,7 @@
#include <QTime>
class MouseController: public QObject {
class QGLENGINE_CORE_EXPORT MouseController: public QObject {
friend class QGLView;
friend class RendererSelection;
Q_OBJECT

View File

@@ -1,3 +1,5 @@
#include "qglengine_core_export.h"
#include <QOpenGLExtraFunctions>
#include <QWindow>
@@ -6,7 +8,7 @@ class QOpenGLContext;
class QOpenGLPaintDevice;
class OpenGLWindow
class QGLENGINE_CORE_EXPORT OpenGLWindow
: public QWindow
, public QOpenGLExtraFunctions {
Q_OBJECT

View File

@@ -0,0 +1,46 @@
<RCC>
<qresource prefix="/">
<file>coeffs_brdf.png</file>
<file>../icons/add-type-camera.png</file>
<file>../icons/add-type-geo.png</file>
<file>../icons/add-type-light.png</file>
<file>../icons/add-type-empty.png</file>
<file>../icons/collapse.png</file>
<file>../icons/expand.png</file>
<file>../icons/edit-rename.png</file>
<file>../icons/alpha.png</file>
<file>../icons/application-exit.png</file>
<file>../icons/configure.png</file>
<file>../icons/dialog-close.png</file>
<file>../icons/document-edit.png</file>
<file>../icons/document-import.png</file>
<file>../icons/document-new.png</file>
<file>../icons/document-open.png</file>
<file>../icons/document-save.png</file>
<file>../icons/document-save-all.png</file>
<file>../icons/edit-clear.png</file>
<file>../icons/edit-clear-locationbar-rtl.png</file>
<file>../icons/edit-copy.png</file>
<file>../icons/edit-delete.png</file>
<file>../icons/edit-find.png</file>
<file>../icons/edit-paste.png</file>
<file>../icons/go-jump.png</file>
<file>../icons/go-top.png</file>
<file>../icons/layer-visible-on.png</file>
<file>../icons/layer-visible-off.png</file>
<file>../icons/light-+.png</file>
<file>../icons/list-add.png</file>
<file>../icons/object-flip-horizontal.png</file>
<file>../icons/object-flip-vertical.png</file>
<file>../icons/picker.png</file>
<file>../icons/qglview.png</file>
<file>../icons/transform-move.png</file>
<file>../icons/transform-rotate.png</file>
<file>../icons/transform-scale.png</file>
<file>../icons/type-camera.png</file>
<file>../icons/type-geo.png</file>
<file>../icons/type-light.png</file>
<file>../icons/type-empty.png</file>
<file>../icons/view-refresh.png</file>
</qresource>
</RCC>

View File

@@ -25,13 +25,13 @@
#include "glscene.h"
#include "mouse_controller.h"
#include "openglwindow.h"
#include "qglengine_core_export.h"
#include "renderer.h"
#include <QElapsedTimer>
#include <QMenu>
class QGLView: public OpenGLWindow {
class QGLENGINE_CORE_EXPORT QGLView: public OpenGLWindow {
friend class RendererSelection;
Q_OBJECT
Q_PROPERTY(float lineWidth READ lineWidth WRITE setLineWidth)

View File

@@ -19,6 +19,8 @@
#ifndef GLTEXTUREMANAGER_H
#define GLTEXTUREMANAGER_H
#include "qglengine_core_export.h"
#include <QDir>
#include <QFileInfo>
#include <QImage>
@@ -26,7 +28,7 @@
#include <QOpenGLExtraFunctions>
class TextureManager {
class QGLENGINE_CORE_EXPORT TextureManager {
public:
TextureManager(QOpenGLExtraFunctions * f_): f(f_) {}
virtual ~TextureManager() {}

View File

@@ -33,7 +33,7 @@ using namespace QGLEngineShaders;
Renderer::Renderer(QGLView * view_)
: RendererBase(view_)
, fbo_ds(view_, QVector<GLenum>() << GL_RGBA16F << GL_RGBA32F << GL_RGBA16F << GL_RGBA16F << GL_RGBA16F)
, fbo_ds(view_, QVector<GLenum>() << GL_RGBA16F << GL_RGBA32F << GL_RGBA16F << GL_RGBA16F << GL_RGBA16F << GL_RGBA32F << GL_RGBA16F)
, fbo_out(view_, obrBuffersCount, false, GL_RGBA16F)
, rend_mat(this)
, rend_service(this)
@@ -127,6 +127,10 @@ void Renderer::reloadShaders() {
<< "FXAA_GLSL_130 1"
<< "FXAA_QUALITY__PRESET 15";
loadShaders(shader_fxaa, QStringList() << (dir + "fxaa.vert") << (dir + "fxaa.frag"), true, fxaa_defs);
for (auto * e: fb_effects) {
e->reloadShaders();
e->is_loaded = true;
}
need_init_shaders = true;
view->scene()->setLightsChanged();
view->scene()->setTreeStructChanged();
@@ -193,6 +197,27 @@ void Renderer::releaseShader() {
}
QVector<int> Renderer::getFreePlanes(int count) {
prev_write_plane = cur_write_plane;
QVector<int> ret;
bool output_done = false;
const int total_count = 4;
for (int i = 0; i < total_count; ++i) {
int plane = obrGeneral0 + i;
if (prev_write_plane == plane) continue;
if (!output_done) {
fbo_out.setWriteBuffer(plane);
cur_write_plane = plane;
output_done = true;
continue;
}
ret << plane;
if (ret.size() == count) break;
}
return ret;
}
void Renderer::fillObjectsBuffer(const ObjectBaseList & ol, RenderPass pass) {
cur_objects_.resize(ol.size());
for (int i = 0; i < ol.size(); ++i) {
@@ -328,6 +353,8 @@ void Renderer::renderScene() {
textures_maps.bind(f, tarMaps);
renderObjects(scene, rpSolid);
}
fbo_ds.blit(dbrNormalZ, fbo_ds.id(), dbrNormalZSolid, fbo_ds.rect(), fbo_ds.rect());
fbo_ds.blit(dbrSpecularReflect, fbo_ds.id(), dbrSpecularReflectSolid, fbo_ds.rect(), fbo_ds.rect());
fbo_ds.release();
/// lighting passes
@@ -336,7 +363,9 @@ void Renderer::renderScene() {
/// transparent geometry pass
fbo_ds.bind();
glEnableDepth();
fbo_ds.setWriteBuffers({0, 1, 2, 3, 4});
glClearFramebuffer(Qt::black, false);
fbo_ds.setWriteBuffers();
if (bindShader(srGeometryPass, &prog)) {
renderObjects(scene, rpTransparent);
}
@@ -351,30 +380,50 @@ void Renderer::renderScene() {
fbo_out.bindColorTexture(obrSolidSpot, 2);
fbo_out.bindColorTexture(obrTransparentOmni, 3);
fbo_out.bindColorTexture(obrTransparentSpot, 4);
fbo_out.setWriteBuffer(obrSum);
fbo_out.setWriteBuffer(obrGeneral0);
renderQuad(prog, quad);
}
cur_write_plane = obrGeneral0;
/// tonemapping
tone_proc.process();
auto free = getFreePlanes(0);
if (bindShader(srTonemapPass, &prog)) {
fbo_out.bind();
prog->setUniformValue("gamma", gamma_);
prog->setUniformValue("frame_max", tone_proc.frameMax());
fbo_out.bindColorTexture(obrSum, 0);
fbo_out.setWriteBuffer(obrTonemap);
fbo_out.bindColorTexture(prev_write_plane, 0);
renderQuad(prog, quad);
fbo_out.release();
} else {
fbo_out.blit(obrSum, fbo_out.id(), obrTonemap, fbo_out.rect(), fbo_out.rect());
fbo_out.blit(prev_write_plane, fbo_out.id(), cur_write_plane, fbo_out.rect(), fbo_out.rect());
}
/// FXAA
if (view->isFeatureEnabled(QGLView::qglFXAA)) {
prog = shader_fxaa;
if (bindShader(prog)) {
auto free = getFreePlanes(0);
setUniformCamera(prog, 0, true, fbo_out.size());
fbo_out.bindColorTexture(prev_write_plane);
renderQuad(prog, quad, 0, false);
}
}
/// custom effects
for (auto * e: fb_effects) {
e->reloadShadersInternal();
e->drawInternal();
}
fbo_out.release();
/// apply hovers and selection frame
if (edit_mode) {
rend_selection.drawSelection(fbo_out, obrTonemap);
rend_selection.drawSelection(fbo_out, cur_write_plane);
rend_service.renderService();
} else {
fbo_out.blit(obrTonemap, 0, 0, fbo_out.rect(), QRect(QPoint(), view->size()));
fbo_out.blit(cur_write_plane, 0, 0, fbo_out.rect(), QRect(QPoint(), view->size()));
}
if (is_grabbing) {
fbo_out.queryImage(0);
@@ -393,3 +442,9 @@ void Renderer::setGrabImage(bool on) {
is_grabbing = on;
// fbo_out.enablePixelBuffer();
}
void Renderer::addFramebufferEffect(FramebufferEffectBase * e) {
e->r = this;
fb_effects << e;
}

View File

@@ -20,6 +20,7 @@
#define RENDERER_H
#include "glcubemap.h"
#include "glframebuffereffectbase.h"
#include "renderer_base.h"
#include "renderer_material.h"
#include "renderer_selection.h"
@@ -29,12 +30,13 @@
#include <QQueue>
class Renderer: public RendererBase {
class QGLENGINE_CORE_EXPORT Renderer: public RendererBase {
friend class QGLView;
friend class MouseController;
friend class RendererMaterial;
friend class RendererService;
friend class RendererSelection;
friend class FramebufferEffectBase;
friend class TonemappingProc;
enum ShaderRole {
// Selection
@@ -55,23 +57,17 @@ class Renderer: public RendererBase {
srFinalPass,
srTonemapPass,
};
enum DeferredBufferRole {
dbrDiffuse,
dbrNormalZ,
dbrSpecularReflect,
dbrEmissionRough,
dbrSpeedBitangXY,
dbrBuffersCount,
};
enum OutBufferRole {
obrTonemap,
obrSum,
obrSolidOmni,
obrSolidSpot,
obrTransparentOmni,
obrTransparentSpot,
obrGeneral0,
obrGeneral1,
obrGeneral2,
obrGeneral3,
obrBuffersCount,
};
@@ -79,6 +75,19 @@ public:
Renderer(QGLView * view_);
virtual ~Renderer();
enum DeferredBufferRole {
dbrDiffuse,
dbrNormalZ,
dbrSpecularReflect,
dbrEmissionRough,
dbrSpeedBitangXY,
dbrNormalZSolid,
dbrSpecularReflectSolid,
dbrBuffersCount,
};
void init(int width, int height);
void resize(int width, int height);
void reloadShaders();
@@ -88,6 +97,8 @@ public:
void setGrabImage(bool on);
bool isGrabImage() const { return is_grabbing; }
QImage getImage() const { return last_img; }
void addFramebufferEffect(FramebufferEffectBase * e);
void clearFramebufferEffects() { fb_effects.clear(); }
QImage materialThumbnail(Material * m) { return rend_mat.materialThumbnail(m); }
void recreateMaterialThumbnails(bool force_all = false) { rend_mat.recreateMaterialThumbnails(force_all); }
@@ -103,9 +114,11 @@ protected:
void initShaders();
void releaseShader();
QVector<int> getFreePlanes(int count);
private:
float gamma_ = 1.f;
int camera_light_mode;
int camera_light_mode, cur_write_plane = 0, prev_write_plane = 0;
bool edit_mode, need_init_shaders, need_render_sum;
Framebuffer fbo_ds, fbo_out;
QMap<ShaderRole, QString> shader_files;
@@ -129,6 +142,7 @@ private:
QVector4D corner_dirs[4];
QVector<QVector3D> hcontent;
QMap<int, QList<Light *>> cur_lights;
QVector<FramebufferEffectBase *> fb_effects;
QImage last_img;
bool is_grabbing = false;
};

View File

@@ -103,6 +103,7 @@ void RendererBase::setUniformCamera(QOpenGLShaderProgram * prog, Camera * cam, b
prog->setUniformValue("z_near", cam->depthStart());
}
prog->setUniformValue("dt", QVector2D(1. / w, 1. / h));
prog->setUniformValue("qgl_ViewSize", QVector2D(w, h));
prog->setUniformValue("qgl_ViewMatrix", mat_view);
prog->setUniformValue("qgl_ViewProjMatrix", mat_proj * mat_view);
}

View File

@@ -24,7 +24,7 @@
#include "gltexturearray.h"
class RendererBase {
class QGLENGINE_CORE_EXPORT RendererBase {
public:
RendererBase(QGLView * view_);
~RendererBase();

View File

@@ -24,7 +24,7 @@
#include <QQueue>
class RendererMaterial {
class QGLENGINE_CORE_EXPORT RendererMaterial {
friend class QGLView;
public:

View File

@@ -24,7 +24,7 @@
#include <QHash>
class RendererSelection {
class QGLENGINE_CORE_EXPORT RendererSelection {
friend class QGLView;
friend class MouseController;
friend class Renderer;

View File

@@ -25,7 +25,7 @@
#include <QQueue>
class RendererService {
class QGLENGINE_CORE_EXPORT RendererService {
friend class QGLView;
friend class MouseController;
friend class Renderer;

View File

@@ -31,7 +31,7 @@ TonemappingProc::TonemappingProc(Renderer * rend)
: QThread()
, r(rend)
, fbo_1x1(r->view, 1, false, GL_RGB32F)
, fbomm(r->fbo_out, Renderer::obrSum, 3)
, fbomm(r->fbo_out, Renderer::obrGeneral1, 3)
, buffer_vbo(GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW) {
shader_sum = 0;
timer_delim = 0;

View File

@@ -24,7 +24,7 @@
#include <QThread>
class TonemappingProc: public QThread {
class QGLENGINE_CORE_EXPORT TonemappingProc: public QThread {
friend class Renderer;
friend class QGLView;

View File

@@ -22,9 +22,9 @@
#include "globject.h"
class Camera: public AimedObject {
friend QDataStream & operator<<(QDataStream & s, const ObjectBase * p);
friend QDataStream & operator>>(QDataStream & s, ObjectBase *& p);
class QGLENGINE_CORE_EXPORT Camera: public AimedObject {
friend QGLENGINE_CORE_EXPORT QDataStream & operator<<(QDataStream & s, const ObjectBase * p);
friend QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, ObjectBase *& p);
public:
Camera();

View File

@@ -25,12 +25,12 @@
#include "gltypes.h"
class ObjectBase {
class QGLENGINE_CORE_EXPORT ObjectBase {
friend class Scene;
friend class RendererSelection;
friend QDataStream & operator<<(QDataStream & s, const ObjectBase * p);
friend QDataStream & operator>>(QDataStream & s, ObjectBase *& p);
friend QDataStream & operator>>(QDataStream & s, Scene *& p);
friend QGLENGINE_CORE_EXPORT QDataStream & operator<<(QDataStream & s, const ObjectBase * p);
friend QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, ObjectBase *& p);
friend QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, Scene *& p);
public:
enum Type {
@@ -350,7 +350,7 @@ inline bool operator<(const ObjectBase & f, const ObjectBase & s) {
}
class AimedObject: public ObjectBase {
class QGLENGINE_CORE_EXPORT AimedObject: public ObjectBase {
friend class QGLView;
friend class GLRendererBase;
friend class Light;
@@ -390,7 +390,7 @@ protected:
};
class Light: public AimedObject {
class QGLENGINE_CORE_EXPORT Light: public AimedObject {
friend class QGLView;
friend class RendererBase;
@@ -434,8 +434,8 @@ inline T globject_cast(const ObjectBase * object) {
}
QDataStream & operator<<(QDataStream & s, const ObjectBase * p);
QDataStream & operator>>(QDataStream & s, ObjectBase *& p);
QGLENGINE_CORE_EXPORT QDataStream & operator<<(QDataStream & s, const ObjectBase * p);
QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, ObjectBase *& p);
inline ObjectBaseList lights2objectList(const QList<Light *> & v) {
ObjectBaseList ret;

View File

@@ -22,7 +22,7 @@
#include "gltypes.h"
class Scene: public QObject {
class QGLENGINE_CORE_EXPORT Scene: public QObject {
Q_OBJECT
friend class RendererBase;
friend class Renderer;
@@ -31,8 +31,8 @@ class Scene: public QObject {
friend class RendererSelection;
friend class ObjectBase;
friend class Light;
friend QDataStream & operator<<(QDataStream & s, const Scene * p);
friend QDataStream & operator>>(QDataStream & s, Scene *& p);
friend QGLENGINE_CORE_EXPORT QDataStream & operator<<(QDataStream & s, const Scene * p);
friend QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, Scene *& p);
public:
explicit Scene();
@@ -138,7 +138,7 @@ signals:
};
QDataStream & operator<<(QDataStream & s, const Scene * p);
QDataStream & operator>>(QDataStream & s, Scene *& p);
QGLENGINE_CORE_EXPORT QDataStream & operator<<(QDataStream & s, const Scene * p);
QGLENGINE_CORE_EXPORT QDataStream & operator>>(QDataStream & s, Scene *& p);
#endif // GLSCENE_H

19
src/core/shaders.qrc Normal file
View File

@@ -0,0 +1,19 @@
<RCC>
<qresource prefix="/">
<file>../../shaders/ds_final.glsl</file>
<file>../../shaders/ds_geom.glsl</file>
<file>../../shaders/ds_light.glsl</file>
<file>../../shaders/ds_tonemap.glsl</file>
<file>../../shaders/fxaa.frag</file>
<file>../../shaders/fxaa.vert</file>
<file>../../shaders/fxaa_v3.h</file>
<file>../../shaders/selection.glsl</file>
<file>../../shaders/selection_apply.glsl</file>
<file>../../shaders/selection_frame.glsl</file>
<file>../../shaders/selection_halo.glsl</file>
<file>../../shaders/service_fill.glsl</file>
<file>../../shaders/service_frame.glsl</file>
<file>../../shaders/service_line.glsl</file>
<file>../../shaders/sum.glsl</file>
</qresource>
</RCC>

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show More