Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main(){
- vec3 norm = normalize(Normal);
- vec3 viewDir = normalize(- FragPos);
- vec2 texcoords = TexCoords;
- if(parallaxmappingEnabled == true){
- viewDir = normalize(-TangentFragPos);
- texcoords = ParallaxMapping(TexCoords, viewDir);
- // then sample textures with new texture coords
- }
- if(normalMapON == true){
- norm = texture(normalMap, texcoords).rgb;
- // transform normal vector to range [-1,1]
- norm = normalize(norm * 2.0 - 1.0);
- viewDir = normalize(-TangentFragPos);
- }
- vec3 LighT = vec3(0.0);
- for(uint i = 0; i < 1; i++){
- LighT += PointLightFunc(light[i], lightpos[i], i, norm, viewDir);
- }
- FragColor = vec4(LighT, 1.0);
- }
Add Comment
Please, Sign In to add comment