Factor out more resources.
+ Use QOpenGLShader to get compiled shader code in TreeView. + Remove last remaining Qt resources dependency in libqtk. + shaders.h in libqtk to define default GLSL shader programs.
This commit is contained in:
22
resources/minimal_resources.qrc
Normal file
22
resources/minimal_resources.qrc
Normal file
@@ -0,0 +1,22 @@
|
||||
<RCC>
|
||||
<qresource prefix="/textures">
|
||||
<file alias="plaster.png">images/plaster.png</file>
|
||||
<file alias="crate.png">images/crate.png</file>
|
||||
<file alias="stone.png">images/stone.png</file>
|
||||
<file alias="wood.png">images/wood.png</file>
|
||||
<file>skybox/back.png</file>
|
||||
<file>skybox/bottom.png</file>
|
||||
<file>skybox/front.png</file>
|
||||
<file>skybox/left.png</file>
|
||||
<file>skybox/right.png</file>
|
||||
<file>skybox/top.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/icons">
|
||||
<file>fontawesome-free-6.2.1-desktop/svgs/solid/cube.svg</file>
|
||||
<file>fontawesome-free-6.2.1-desktop/svgs/regular/trash-can.svg</file>
|
||||
<file>fontawesome-free-6.2.1-desktop/svgs/regular/folder-open.svg</file>
|
||||
<file>fontawesome-free-6.2.1-desktop/svgs/regular/floppy-disk.svg</file>
|
||||
<file>fontawesome-free-6.2.1-desktop/svgs/brands/git-alt.svg</file>
|
||||
<file alias="icon.png">icons/icon.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -28,8 +28,6 @@
|
||||
<file alias="solid.vert">shaders/vertex/solid.vert</file>
|
||||
<file alias="solid-perspective.frag">shaders/fragment/solid-perspective.frag</file>
|
||||
<file alias="solid-perspective.vert">shaders/vertex/solid-perspective.vert</file>
|
||||
<file alias="multi-color.frag">shaders/fragment/multi-color.frag</file>
|
||||
<file alias="multi-color.vert">shaders/vertex/multi-color.vert</file>
|
||||
<file alias="rgb-normals.frag">shaders/fragment/rgb-normals.frag</file>
|
||||
<file alias="rgb-normals.vert">shaders/vertex/rgb-normals.vert</file>
|
||||
<file alias="texture-cubemap.frag">shaders/fragment/texture-cubemap.frag</file>
|
||||
@@ -44,13 +42,9 @@
|
||||
<file alias="solid-specular.vert">shaders/vertex/solid-specular.vert</file>
|
||||
<file alias="solid-phong.frag">shaders/fragment/solid-phong.frag</file>
|
||||
<file alias="solid-phong.vert">shaders/vertex/solid-phong.vert</file>
|
||||
<file alias="model-basic.frag">shaders/fragment/model-basic.frag</file>
|
||||
<file alias="model-basic.vert">shaders/vertex/model-basic.vert</file>
|
||||
<file alias="model-phong.frag">shaders/fragment/model-phong.frag</file>
|
||||
<file alias="model-phong.vert">shaders/vertex/model-phong.vert</file>
|
||||
<file alias="model-normals.frag">shaders/fragment/model-normals.frag</file>
|
||||
<file alias="model-normals.vert">shaders/vertex/model-normals.vert</file>
|
||||
<file alias="skybox.frag">skybox/skybox.frag</file>
|
||||
<file alias="skybox.vert">skybox/skybox.vert</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#version 330 core
|
||||
out vec4 fColor;
|
||||
|
||||
in vec2 vTextureCoord;
|
||||
|
||||
uniform sampler2D texture_diffuse1;
|
||||
|
||||
void main()
|
||||
{
|
||||
fColor = texture(texture_diffuse1, vTextureCoord);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#version 330
|
||||
in vec4 vColor;
|
||||
|
||||
out vec4 fColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fColor = vColor;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#version 330 core
|
||||
layout (location = 0) in vec3 aPosition;
|
||||
layout (location = 1) in vec3 aNormal;
|
||||
layout (location = 2) in vec2 aTextureCoord;
|
||||
|
||||
out vec2 vTextureCoord;
|
||||
|
||||
uniform mat4 uModel;
|
||||
uniform mat4 uView;
|
||||
uniform mat4 uProjection;
|
||||
|
||||
void main()
|
||||
{
|
||||
vTextureCoord = aTextureCoord;
|
||||
gl_Position = uProjection * uView * uModel * vec4(aPosition, 1.0);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#version 330
|
||||
layout(location = 0) in vec3 aPosition;
|
||||
layout(location = 1) in vec3 aColor;
|
||||
|
||||
out vec4 vColor;
|
||||
|
||||
uniform mat4 uModel; // Model
|
||||
uniform mat4 uView; // View
|
||||
uniform mat4 uProjection; // Projection
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = uProjection * uView * uModel * vec4(aPosition, 1.0);
|
||||
|
||||
vColor = vec4(aColor, 1.0f);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#version 330
|
||||
uniform samplerCube uTexture;
|
||||
|
||||
varying vec3 vTexCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture(uTexture, vTexCoord);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#version 330
|
||||
layout(location = 0) in vec3 aPosition;
|
||||
|
||||
out vec3 vTexCoord;
|
||||
|
||||
uniform mat4 uProjectionMatrix;
|
||||
uniform mat4 uViewMatrix;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Strip translation column from camera's 4x4 matrix
|
||||
mat4 view = mat4(mat3(uViewMatrix));
|
||||
gl_Position = uProjectionMatrix * view * vec4(aPosition, 1.0);
|
||||
vTexCoord = aPosition;
|
||||
}
|
||||
Reference in New Issue
Block a user