Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. diff --git a/base/shaders/world_fs.glsl b/base/shaders/world_fs.glsl
  2. index 136dfde..31b33d6 100644
  3. --- a/base/shaders/world_fs.glsl
  4. +++ b/base/shaders/world_fs.glsl
  5. @@ -50,10 +50,8 @@ in_qualifier vec3 lightDirs[R_DYNAMIC_LIGHTS];
  6. * @brief main
  7. */
  8. void main(void){
  9. -
  10. vec4 finalColor = vec4(0.0);
  11.  
  12. -
  13. /* use new dynamic lighing system, including
  14. * the Cook-Torrance specularity model with the Phong
  15. * model as a default if the roughness map isn't enabled */
  16. @@ -68,19 +66,22 @@ void main(void){
  17. vec3 lightmap = texture2D(SAMPLER1, gl_TexCoord[1].st).rgb;
  18.  
  19. #if r_bumpmap
  20. + vec4 normalmap;
  21. if(BUMPMAP > 0){
  22. /* Sample deluxemap and normalmap.*/
  23. - vec4 normalmap = texture2D(SAMPLER3, gl_TexCoord[0].st);
  24. - normalmap.rgb = normalize(two * (normalmap.rgb + negHalf));
  25. + normalmap = texture2D(SAMPLER3, gl_TexCoord[0].st);
  26. + } else {
  27. + normalmap = vec4(0.0, 0.0, 1.0, 0.8);
  28. + }
  29. + normalmap.rgb = normalize(two * (normalmap.rgb + negHalf));
  30.  
  31. - /* deluxemap contains pre-computed incoming light vectors in object tangent space */
  32. - vec3 deluxemap = texture2D(SAMPLER2, gl_TexCoord[1].st).rgb;
  33. - deluxemap = normalize(two * (deluxemap + negHalf));
  34. + /* deluxemap contains pre-computed incoming light vectors in object tangent space */
  35. + vec3 deluxemap = texture2D(SAMPLER2, gl_TexCoord[1].st).rgb;
  36. + deluxemap = normalize(two * (deluxemap + negHalf));
  37.  
  38. - /* Resolve parallax offset and bump mapping.*/
  39. - offset = BumpTexcoord(normalmap.a);
  40. - bump = BumpFragment(deluxemap, normalmap.rgb);
  41. - }
  42. + /* Resolve parallax offset and bump mapping.*/
  43. + offset = BumpTexcoord(normalmap.a);
  44. + bump = BumpFragment(deluxemap, normalmap.rgb);
  45. #endif
  46.  
  47. /* Sample the diffuse texture, honoring the parallax offset.*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement