Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renderer|Client: Updated existing GLSL shaders to version 3.3
Also added a new shader for old DGL drawing routines.
- Loading branch information
Showing
20 changed files
with
542 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
doomsday/apps/client/net.dengine.client.pack/renderer.pack/shaders/dgl/dgl.dei
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Shader for the DGL drawing routines that emulate OpenGL 1.x behavior. | ||
shader dgl.draw { | ||
vertex.path = "dgl_draw.vsh" | ||
fragment.path = "dgl_draw.fsh" | ||
} |
50 changes: 50 additions & 0 deletions
50
doomsday/apps/client/net.dengine.client.pack/renderer.pack/shaders/dgl/dgl_draw.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* The Doomsday Engine Project | ||
* Common OpenGL Shaders: Legacy DGL Drawing | ||
* | ||
* Copyright (c) 2017 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* LGPL: http://www.gnu.org/licenses/lgpl.html | ||
* | ||
* <small>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</small> | ||
*/ | ||
|
||
#version 330 | ||
|
||
uniform int uEnabledTextures; | ||
uniform sampler2D uTex0; | ||
uniform sampler2D uTex1; | ||
uniform sampler2D uTex2; | ||
|
||
in vec4 vColor; | ||
in vec2 vTexCoord[3]; | ||
|
||
void main() | ||
{ | ||
out_FragColor = vColor; | ||
|
||
// Colors from textures. | ||
vec4 texColor[3] = vec4[3] (vec4(0.0), vec4(0.0), vec4(0.0)); | ||
if ((uEnabledTextures & 0x1) != 0) { | ||
texColor[0] = texture(uTex0, vTexCoord[0]); | ||
out_FragColor *= texColor[0]; | ||
} | ||
if ((uEnabledTextures & 0x2) != 0) { | ||
texColor[1] = texture(uTex1, vTexCoord[1]); | ||
} | ||
if ((uEnabledTextures & 0x4) != 0) { | ||
texColor[2] = texture(uTex2, vTexCoord[2]); | ||
} | ||
|
||
// TODO: Modulate the texture colors in the requested manner | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
doomsday/apps/client/net.dengine.client.pack/renderer.pack/shaders/dgl/dgl_draw.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* The Doomsday Engine Project | ||
* Common OpenGL Shaders: Legacy DGL Drawing | ||
* | ||
* Copyright (c) 2017 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* LGPL: http://www.gnu.org/licenses/lgpl.html | ||
* | ||
* <small>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</small> | ||
*/ | ||
|
||
#version 330 | ||
|
||
layout(location = 0) in vec3 aVertex; | ||
layout(location = 1) in vec4 aColor; | ||
layout(location = 2) in vec2 aTexCoord[3]; | ||
|
||
uniform mat4 uMvpMatrix; | ||
uniform mat4 uTextureMatrix; | ||
|
||
out vec4 vColor; | ||
out vec2 vTexCoord[3]; | ||
|
||
vec2 transformTexCoord(vec2 tc) | ||
{ | ||
vec4 coord = vec4(tc.s, tc.t, 0.0, 1.0); | ||
return (uTextureMatrix * coord).xy; | ||
} | ||
|
||
void main() | ||
{ | ||
gl_Position = uMvpMatrix * aVertex; | ||
vColor = aColor; | ||
for (int i = 0; i < 3; ++i) { | ||
vTexCoord[i] = transformTexCoord(aTexCoord[i]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.