Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gloom: Entity shaders in separate files; texture scale in metrics
- Loading branch information
Showing
17 changed files
with
161 additions
and
155 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
File renamed without changes.
20 changes: 0 additions & 20 deletions
20
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/common/indirect_textured.vsh
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
108 changes: 0 additions & 108 deletions
108
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity.dei
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity_material.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,16 @@ | ||
#version 330 core | ||
|
||
#include "common/gbuffer_out.glsl" | ||
|
||
uniform sampler2D uTex; | ||
|
||
DENG_VAR vec2 vUV; | ||
DENG_VAR vec4 vInstanceColor; | ||
DENG_VAR vec3 vNormal; | ||
|
||
void main(void) { | ||
vec4 color = texture(uTex, vUV); | ||
if (color.a < 0.5) discard; | ||
out_FragColor = color * vInstanceColor; | ||
GBuffer_SetFragNormal(vNormal); | ||
} |
26 changes: 26 additions & 0 deletions
26
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity_material.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,26 @@ | ||
#version 330 core | ||
|
||
#include "common/bones.glsl" | ||
|
||
uniform mat4 uMvpMatrix; | ||
|
||
DENG_ATTRIB mat4 aInstanceMatrix; | ||
DENG_ATTRIB vec4 aInstanceColor; | ||
|
||
DENG_ATTRIB vec4 aVertex; | ||
DENG_ATTRIB vec3 aNormal; | ||
DENG_ATTRIB vec2 aUV; | ||
DENG_ATTRIB vec4 aBounds0; | ||
|
||
DENG_VAR vec2 vUV; | ||
DENG_VAR vec4 vInstanceColor; | ||
DENG_VAR vec3 vNormal; | ||
|
||
void main(void) { | ||
vNormal = aNormal; | ||
vec4 modelPos = Gloom_BoneTransform(aVertex, vNormal); | ||
gl_Position = uMvpMatrix * (aInstanceMatrix * modelPos); | ||
vNormal = (aInstanceMatrix * vec4(vNormal, 0.0)).xyz; | ||
vUV = aBounds0.xy + aUV * aBounds0.zw; | ||
vInstanceColor = aInstanceColor; | ||
} |
10 changes: 10 additions & 0 deletions
10
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity_shadow_dir.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,10 @@ | ||
#version 330 core | ||
|
||
uniform sampler2D uTex; | ||
|
||
DENG_VAR vec2 vUV; | ||
|
||
void main(void) { | ||
float alpha = texture(uTex, vUV).a; | ||
if (alpha < 0.75) discard; | ||
} |
19 changes: 19 additions & 0 deletions
19
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity_shadow_dir.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,19 @@ | ||
#version 330 core | ||
|
||
#include "common/bones.glsl" | ||
|
||
uniform mat4 uLightMatrix; | ||
|
||
DENG_ATTRIB mat4 aInstanceMatrix; | ||
DENG_ATTRIB vec4 aInstanceColor; | ||
DENG_ATTRIB vec4 aVertex; | ||
DENG_ATTRIB vec2 aUV; | ||
DENG_ATTRIB vec4 aBounds0; | ||
|
||
DENG_VAR vec2 vUV; | ||
|
||
void main(void) { | ||
mat4 bone = Gloom_BoneMatrix(); | ||
gl_Position = uLightMatrix * (aInstanceMatrix * (bone * aVertex)); | ||
vUV = aBounds0.xy + aUV * aBounds0.zw; | ||
} |
17 changes: 17 additions & 0 deletions
17
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity_shadow_omni.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,17 @@ | ||
#version 330 core | ||
|
||
uniform sampler2D uTex; | ||
|
||
uniform vec3 uLightOrigin; // world space | ||
uniform float uFarPlane; | ||
|
||
in vec4 vWorldPos; | ||
in vec2 vFaceUV; | ||
|
||
void main(void) { | ||
float alpha = texture(uTex, vFaceUV).a; | ||
if (alpha < 0.75) discard; | ||
|
||
// Normalized distance. | ||
gl_FragDepth = distance(vWorldPos.xyz, uLightOrigin) / uFarPlane; | ||
} |
17 changes: 17 additions & 0 deletions
17
doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/entity_shadow_omni.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,17 @@ | ||
#version 330 core | ||
|
||
#include "common/bones.glsl" | ||
|
||
in mat4 aInstanceMatrix; | ||
in vec4 aInstanceColor; | ||
in vec4 aVertex; | ||
in vec2 aUV; | ||
in vec4 aBounds0; | ||
|
||
out vec2 vUV; | ||
|
||
void main(void) { | ||
mat4 bone = Gloom_BoneMatrix(); | ||
gl_Position = aInstanceMatrix * (bone * aVertex); | ||
vUV = aBounds0.xy + aUV * aBounds0.zw; | ||
} |
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
File renamed without changes.
File renamed without changes.
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.