-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
145 additions
and
51 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include std_head_fs.inc | ||
|
||
uniform sampler2D tex3; | ||
uniform sampler2D tex4; | ||
uniform sampler2D tex5; | ||
uniform sampler2D tex6; | ||
uniform sampler2D tex7; | ||
|
||
varying vec2 texcoordout; | ||
varying vec2 bumpcoordout; | ||
varying vec3 lightVector; | ||
varying float dist; | ||
varying float lightFactor; | ||
varying float texFactor; | ||
|
||
void main(void) { | ||
vec4 texc = mix( | ||
mix(texture2D(tex0, texcoordout), texture2D(tex2, texcoordout), clamp(texFactor, 0.0, 1.0)), | ||
mix(texture2D(tex4, texcoordout), texture2D(tex6, texcoordout), clamp((texFactor - 2.0), 0.0, 1.0)), | ||
clamp((texFactor - 1.0), 0.0, 1.0)); | ||
texc.rgb += unib[1] - vec3(0.5); | ||
float ffact = smoothstep(unif[5][0]/3.0, unif[5][0], dist); // ------ smoothly increase fog between 1/3 and full fogdist | ||
vec3 bump = normalize(mix( | ||
mix(texture2D(tex1, bumpcoordout), texture2D(tex3, bumpcoordout), clamp(texFactor, 0.0, 1.0)), | ||
mix(texture2D(tex5, bumpcoordout), texture2D(tex7, bumpcoordout), clamp((texFactor - 2.0), 0.0, 1.0)), | ||
clamp((texFactor - 1.0), 0.0, 1.0)).rgb * 2.0 - 1.0); | ||
#include std_bump.inc | ||
|
||
gl_FragColor = (1.0 - ffact) * texc + ffact * vec4(unif[4], unif[5][1]); // ------ combine using factors | ||
gl_FragColor.a *= unif[5][2]; | ||
} | ||
|
||
|
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,22 @@ | ||
#include std_head_vs.inc | ||
|
||
varying vec2 texcoordout; | ||
varying vec2 bumpcoordout; | ||
varying float dist; | ||
varying vec3 lightVector; | ||
varying float lightFactor; | ||
varying float texFactor; | ||
|
||
void main(void) { | ||
vec3 normout; | ||
#include std_main_vs.inc | ||
texcoordout = fract(texcoord * unib[2].xy + unib[3].xy); | ||
bumpcoordout = texcoordout * vec2(1.0, 1.0) * unib[0][0]; | ||
texFactor = floor(texcoord[0]); // ----- u and v expected to go up together! | ||
|
||
vec3 inray = vec3(relPosn - vec4(unif[6], 0.0)); // ----- vector from the camera to this vertex | ||
dist = length(inray); | ||
|
||
gl_Position = modelviewmatrix[1] * vec4(vertex,1.0); | ||
gl_PointSize = unib[2][2] / dist; | ||
} |
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