#version 410 in vec3 colV; in vec3 modelPosV; in vec3 worldPosV; in vec3 viewPosV; in vec3 norV; in vec2 uvV; in vec4 miscV; // refraction tweaks out vec4 fragColor; vec3 eyePos = vec3(0,0,1.8); uniform sampler2D texture1; uniform vec2 meScreenSize; void main (void) { vec2 co = gl_FragCoord.xy / vec2(meScreenSize.x, meScreenSize.y); vec3 norN = normalize(norV); vec2 nor2 = norV.xy + vec2(norV.z * .001, norV.z * .001); nor2 += sin(uvV * (3.0 + miscV[1]) * 10.0) * (1 + miscV[2]); co += nor2 * 0.001; fragColor = vec4(texture(texture1, co).rgb, 1.0) * vec4(0.83, 0.92, 0.95, 1.0); fragColor += vec4(uvV,0,1) * (1.0 - miscV[0]); // add dichroic red/green tint { vec3 nNor = normalize(norV + vec3(nor2,0)); vec3 eyePos3 = vec3(0.0, 0.0, eyePos); float spec = dot(normalize(eyePos3 - viewPosV), normalize(nNor)); spec = abs(spec); spec = pow(spec,100.0); if(spec < 0) spec = -spec; // ATI is lenient, NVidia requires. fragColor += vec4(spec, spec, spec, 1.0); } }