Выходные данные от фрагментного шейдера буфера кадра
This commit is contained in:
		
							parent
							
								
									bef6eee09b
								
							
						
					
					
						commit
						c5f9eaea77
					
				| @ -24,7 +24,8 @@ uniform sampler2D tex_diffuse; | |||||||
| uniform sampler2D tex_ambient; | uniform sampler2D tex_ambient; | ||||||
| uniform sampler2D tex_specular; | uniform sampler2D tex_specular; | ||||||
| 
 | 
 | ||||||
| out vec4 color;  | layout (location = 0) out vec4 colors; | ||||||
|  | layout (location = 1) out vec4 normals; | ||||||
| 
 | 
 | ||||||
| void main()  | void main()  | ||||||
| {  | {  | ||||||
| @ -36,6 +37,7 @@ void main() | |||||||
|     // Зеркальная составляющая |     // Зеркальная составляющая | ||||||
|     float specular = pow(max(dot(H, N), 0.0), p*4); // скалярное произведение с отсеканием значений < 0 в степени p |     float specular = pow(max(dot(H, N), 0.0), p*4); // скалярное произведение с отсеканием значений < 0 в степени p | ||||||
| 
 | 
 | ||||||
|     color = vec4(light_f.color*ka, 1)*texture2D(tex_ambient, texCoord) + vec4(light_f.color*kd*diffuse, 1)*texture2D(tex_diffuse, texCoord) + vec4(light_f.color*ks*specular, 1)*texture2D(tex_specular, texCoord); |     colors = vec4(light_f.color*ka, 1)*texture2D(tex_ambient, texCoord) + vec4(light_f.color*kd*diffuse, 1)*texture2D(tex_diffuse, texCoord) + vec4(light_f.color*ks*specular, 1)*texture2D(tex_specular, texCoord); | ||||||
|  |     normals = vec4(N, 1.0); | ||||||
| }  | }  | ||||||
|   |   | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user