Guest User

Untitled

a guest
Jun 12th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. void main(){
  2. vec3 norm = normalize(Normal);
  3. vec3 viewDir = normalize(- FragPos);
  4. vec2 texcoords = TexCoords;
  5.  
  6.  
  7. if(parallaxmappingEnabled == true){
  8. viewDir = normalize(-TangentFragPos);
  9. texcoords = ParallaxMapping(TexCoords, viewDir);
  10. // then sample textures with new texture coords
  11. }
  12.  
  13. if(normalMapON == true){
  14. norm = texture(normalMap, texcoords).rgb;
  15. // transform normal vector to range [-1,1]
  16. norm = normalize(norm * 2.0 - 1.0);
  17. viewDir = normalize(-TangentFragPos);
  18. }
  19.  
  20. vec3 LighT = vec3(0.0);
  21. for(uint i = 0; i < 1; i++){
  22. LighT += PointLightFunc(light[i], lightpos[i], i, norm, viewDir);
  23. }
  24.  
  25. FragColor = vec4(LighT, 1.0);
  26. }
Add Comment
Please, Sign In to add comment