Paste #JOz -- näytä pelkkänä tekstinä -- uusi tämän pohjalta
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | diff --git a/client/shaders/bumpmaps_liquids/opengl_fragment.glsl b/client/shaders/bumpmaps_liquids/opengl_fragment.glsl index ea61838..42c3b2d 100644 --- a/client/shaders/bumpmaps_liquids/opengl_fragment.glsl +++ b/client/shaders/bumpmaps_liquids/opengl_fragment.glsl @@ -24,12 +24,10 @@ void main (void) vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb; + float specular = 0.2 * pow(clamp(dot(R, lVec), 0.0, 1.0),1.0) * diffuse; + vec3 vSpecular = vec3(specular, specular, specular); + color += vSpecular; - float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); - vec4 vSpecular = 0.2*specular * diffuse; - color += vSpecular; - - col = vec4(color.r, color.g, color.b, alpha); col *= gl_Color; col = col * col; // SRGB -> Linear diff --git a/client/shaders/bumpmaps_solids/opengl_fragment.glsl b/client/shaders/bumpmaps_solids/opengl_fragment.glsl index 6203592..b887c08 100644 --- a/client/shaders/bumpmaps_solids/opengl_fragment.glsl +++ b/client/shaders/bumpmaps_solids/opengl_fragment.glsl @@ -21,15 +21,13 @@ void main (void) vec3 R = reflect(-vVec, bump); vec3 lVec = normalize(vec3(0.0, -0.4, 0.5)); float diffuse = max(dot(lVec, bump), 0.0); - + vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb; + float specular = 0.2 * pow(clamp(dot(R, lVec), 0.0, 1.0),1.0) * diffuse; + vec3 vSpecular = vec3(specular, specular, specular); + color += vSpecular; - float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); - vec4 vSpecular = 0.2*specular * diffuse; - color += vSpecular; - - col = vec4(color.r, color.g, color.b, alpha); col *= gl_Color; col = col * col; // SRGB -> Linear |