mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 16:56:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			665 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			665 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| uniform_float uFactor {
 | |
|     step = 0.1;
 | |
|     min = 0.01;
 | |
|     max = 20.0;
 | |
|     default = 1.0;
 | |
|     display_name = "#{BuiltInShaders:DisplayDepthFactorName}";
 | |
|     description = "#{BuiltInShaders:DisplayDepthFactorDescription}";
 | |
| }
 | |
| 
 | |
| fragment main {
 | |
| 
 | |
|     omw_In vec2 omw_TexCoord;
 | |
| 
 | |
|     void main()
 | |
|     {
 | |
|         float depth = omw_GetDepth(omw_TexCoord);
 | |
|         float zNear = omw.near;
 | |
|         float zFar = omw.far;
 | |
|         omw_FragColor = vec4(vec3((2.0 * zNear) / (zFar + zNear - depth * (zFar - zNear))) * uFactor, 1.0);
 | |
|     }
 | |
| }
 | |
| 
 | |
| technique {
 | |
|     passes = main;
 | |
|     description = "#{BuiltInShaders:DisplayDepthDescription}";
 | |
|     author = "OpenMW";
 | |
|     version = "1.0";
 | |
| }
 |