forked from NikolaiVChr/f16
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Effect: Moved gbuffer shaders into aircraft to make 2020.4 accept the…
… effects. Sim: Bumped version to 3.56
- Loading branch information
1 parent
a2dcdb8
commit a76a03d
Showing
4 changed files
with
46 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#version 120 | ||
#extension GL_EXT_gpu_shader4 : enable | ||
// -*- mode: C; -*- | ||
// Licence: GPL v2 | ||
// Author: Frederic Bouvier. | ||
// | ||
|
||
varying vec3 ecNormal; | ||
varying float alpha; | ||
uniform int materialID; | ||
uniform sampler2D texture; | ||
|
||
void encode_gbuffer(vec3 normal, vec3 color, int mId, float specular, float shininess, float emission, float depth); | ||
|
||
void main() { | ||
vec4 texel = texture2D(texture, gl_TexCoord[0].st); | ||
if (texel.a * alpha < 0.1) | ||
discard; | ||
float specular = dot( gl_FrontMaterial.specular.rgb, vec3( 0.3, 0.59, 0.11 ) ); | ||
float shininess = gl_FrontMaterial.shininess; | ||
float emission = dot( gl_FrontLightModelProduct.sceneColor.rgb, vec3( 0.3, 0.59, 0.11 ) ); | ||
|
||
vec3 normal2 = normalize( (2.0 * gl_Color.a - 1.0) * ecNormal ); | ||
encode_gbuffer(normal2, gl_Color.rgb * texel.rgb, materialID, specular, shininess, emission, gl_FragCoord.z); | ||
} |
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 @@ | ||
// -*- mode: C; -*- | ||
// Licence: GPL v2 | ||
// Author: Frederic Bouvier. | ||
// | ||
#version 120 | ||
|
||
varying vec3 ecNormal; | ||
varying float alpha; | ||
void main() { | ||
ecNormal = gl_NormalMatrix * gl_Normal; | ||
gl_Position = ftransform(); | ||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
gl_FrontColor.rgb = gl_Color.rgb; gl_FrontColor.a = 1.0; | ||
gl_BackColor.rgb = gl_Color.rgb; gl_BackColor.a = 0.0; | ||
alpha = gl_Color.a; | ||
} |
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