Fix T61857 Eevee DOF not working if the camera is in orthographic mode
It was just a bad mapping of the ogl depth to scene linear depth.
This commit is contained in:
		@@ -29,7 +29,7 @@ uniform vec2 nearFar; /* Near & far view depths values */
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \
 | 
					#define linear_depth(z) ((ProjectionMatrix[3][3] == 0.0) \
 | 
				
			||||||
		? (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) \
 | 
							? (nearFar.x  * nearFar.y) / (z * (nearFar.x - nearFar.y) + nearFar.y) \
 | 
				
			||||||
		: (z * 2.0 - 1.0) * nearFar.y)
 | 
							: z * (nearFar.y - nearFar.x) + nearFar.x) /* Only true for camera view! */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define weighted_sum(a, b, c, d, e) (a * e.x + b * e.y + c * e.z + d * e.w) / max(1e-6, dot(e, vec4(1.0)));
 | 
					#define weighted_sum(a, b, c, d, e) (a * e.x + b * e.y + c * e.z + d * e.w) / max(1e-6, dot(e, vec4(1.0)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user