Учет SSAO при расчетах освещения
This commit is contained in:
		
							parent
							
								
									b43afcd6d3
								
							
						
					
					
						commit
						7b5e51c14e
					
				@ -38,6 +38,7 @@ uniform sampler2D gDiffuseP;
 | 
			
		||||
uniform sampler2D gAmbientSpecular;
 | 
			
		||||
uniform sampler2DArray sunShadowDepth;
 | 
			
		||||
uniform samplerCubeArray pointShadowDepth;
 | 
			
		||||
uniform sampler2D ssao;
 | 
			
		||||
 | 
			
		||||
out vec4 color; 
 | 
			
		||||
 | 
			
		||||
@ -50,6 +51,7 @@ void main()
 | 
			
		||||
    vec3 ka = texture(gAmbientSpecular, texCoord).rgb;
 | 
			
		||||
    float ks = texture(gAmbientSpecular, texCoord).a;
 | 
			
		||||
    float p = texture(gDiffuseP, texCoord).a;
 | 
			
		||||
    float ssao_value = texture(ssao, texCoord).r;
 | 
			
		||||
    
 | 
			
		||||
    // Переменные используемые в цикле:
 | 
			
		||||
    vec3 L_vertex; // Расположение источника относительно фрагмента
 | 
			
		||||
@ -77,7 +79,7 @@ void main()
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
    // Фоновая освещенность
 | 
			
		||||
    color = vec4(ka, 1);
 | 
			
		||||
    color = vec4(ka, 1) * ssao_value;
 | 
			
		||||
   
 | 
			
		||||
    // Расчет солнца, если его цвет не черный
 | 
			
		||||
    if (length(Sun_color) > 0)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user