mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 00:56:39 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			45 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
uniform_bool uDisplayDepth {
 | 
						|
    header = "#{OMWShaders:DebugHeaderDepth}";
 | 
						|
    default = true;
 | 
						|
    display_name = "#{OMWShaders:DisplayDepthName}";
 | 
						|
}
 | 
						|
 | 
						|
uniform_float uDepthFactor {
 | 
						|
    step = 0.1;
 | 
						|
    min = 0.01;
 | 
						|
    max = 20.0;
 | 
						|
    default = 1.0;
 | 
						|
    display_name = "#{OMWShaders:DisplayDepthFactorName}";
 | 
						|
    description = "#{OMWShaders:DisplayDepthFactorDescription}";
 | 
						|
}
 | 
						|
 | 
						|
uniform_bool uDisplayNormals {
 | 
						|
    header = "#{OMWShaders:DebugHeaderNormals}";
 | 
						|
    default = true;
 | 
						|
    display_name = "#{OMWShaders:DisplayNormalsName}";
 | 
						|
}
 | 
						|
 | 
						|
fragment main {
 | 
						|
 | 
						|
    omw_In vec2 omw_TexCoord;
 | 
						|
 | 
						|
    void main()
 | 
						|
    {
 | 
						|
        omw_FragColor = omw_GetLastShader(omw_TexCoord);
 | 
						|
 | 
						|
        if (uDisplayDepth)
 | 
						|
            omw_FragColor = vec4(vec3(omw_GetLinearDepth(omw_TexCoord) / omw.far * uDepthFactor), 1.0);
 | 
						|
#if OMW_NORMALS
 | 
						|
        if (uDisplayNormals && (!uDisplayDepth || omw_TexCoord.x < 0.5))
 | 
						|
            omw_FragColor.rgb = omw_GetNormals(omw_TexCoord) * 0.5 + 0.5;
 | 
						|
#endif
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
technique {
 | 
						|
    passes = main;
 | 
						|
    description = "#{OMWShaders:DebugDescription}";
 | 
						|
    author = "OpenMW";
 | 
						|
    version = "1.0";
 | 
						|
    pass_normals = true;
 | 
						|
}
 |