Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/assets/shaders/GLSL/fragmentAtoms/bumpMapping.frag

Diff revisions: vs.
  @@ -40,15 +40,23 @@
40 40 vec4 ParallaxMapping(in uint bumpMapLightId, in vec2 uv){
41 41 vec3 lightVecTBN = vec3(0.0);
42 42 switch (dvd_LightSource[bumpMapLightId]._options.x){
43 - case LIGHT_DIRECTIONAL : lightVecTBN = -normalize(dvd_LightSource[bumpMapLightId]._position.xyz); break;
43 + case LIGHT_DIRECTIONAL :
44 + lightVecTBN = -normalize(dvd_LightSource[bumpMapLightId]._position.xyz);
45 + break;
44 46 case LIGHT_OMNIDIRECTIONAL :
45 - case LIGHT_SPOT : lightVecTBN = normalize(_viewDirection + dvd_LightSource[bumpMapLightId]._position.xyz); break;
47 + case LIGHT_SPOT :
48 + lightVecTBN = normalize(_viewDirection + dvd_LightSource[bumpMapLightId]._position.xyz);
49 + break;
46 50 };
47 51
48 52 vec3 viewVecTBN = normalize(_viewDirection);
49 53
50 54 //Offset, scale and bias
51 - vec2 vTexCoord = uv + ((texture(texNormalMap, uv).a - 0.5) * dvd_parallaxFactor * (vec2(viewVecTBN.x, -viewVecTBN.y) / viewVecTBN.z));
55 + vec2 vTexCoord = uv +
56 + ((texture(texNormalMap, uv).a - 0.5) *
57 + dvd_parallaxFactor *
58 + (vec2(viewVecTBN.x, -viewVecTBN.y) /
59 + viewVecTBN.z));
52 60
53 61 //Normal mapping in TBN space
54 62 return getPixelColor(vTexCoord, normalize(2.0 * texture(texNormalMap, vTexCoord).xyz - 1.0));