mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Changes to GLSL files for OpenGL
This commit is contained in:
parent
2142d452d4
commit
6aea37b407
98 changed files with 3366 additions and 2686 deletions
|
|
@ -28,10 +28,10 @@ uniform float specularPower;
|
|||
uniform vec4 ambient;
|
||||
uniform float accumTime;
|
||||
|
||||
varying vec2 TEX0;
|
||||
varying vec4 outLightVec;
|
||||
varying vec3 outPos;
|
||||
varying vec3 outEyePos;
|
||||
in vec2 TEX0;
|
||||
in vec4 outLightVec;
|
||||
in vec3 outPos;
|
||||
in vec3 outEyePos;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -42,14 +42,14 @@ void main()
|
|||
texOffset.x = TEX0.x + sinOffset1 + sinOffset2;
|
||||
texOffset.y = TEX0.y + cos( accumTime * 3.0 + TEX0.x * 6.28319 * 2.0 ) * 0.05;
|
||||
|
||||
vec4 bumpNorm = texture2D(bumpMap, texOffset) * 2.0 - 1.0;
|
||||
vec4 diffuse = texture2D(diffMap, texOffset);
|
||||
vec4 bumpNorm = texture(bumpMap, texOffset) * 2.0 - 1.0;
|
||||
vec4 diffuse = texture(diffMap, texOffset);
|
||||
|
||||
gl_FragColor = diffuse * (clamp(dot(outLightVec.xyz, bumpNorm.xyz), 0.0, 1.0) + ambient);
|
||||
OUT_FragColor0 = diffuse * (clamp(dot(outLightVec.xyz, bumpNorm.xyz), 0.0, 1.0) + ambient);
|
||||
|
||||
vec3 eyeVec = normalize(outEyePos - outPos);
|
||||
vec3 halfAng = normalize(eyeVec + outLightVec.xyz);
|
||||
float specular = clamp(dot(bumpNorm.xyz, halfAng), 0.0, 1.0) * outLightVec.w;
|
||||
specular = pow(specular, specularPower);
|
||||
gl_FragColor += specularColor * specular;
|
||||
OUT_FragColor0 += specularColor * specular;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue