mirror of
				https://github.com/stevenrobertson/cuburn.git
				synced 2025-11-03 18:00:55 -05:00 
			
		
		
		
	Add a crap gradient detect to make DE less bad.
Use the vertical and horizontal gradients to "detect" when a pixel is part of an edge that has been softened by grid-shift AA, and avoid blurring it further. This causes occasional 1px artifacts in stills, but fixes the truly grotesque DE bleed-out for a net win. A better edge detector is still needed.
This commit is contained in:
		@ -156,6 +156,13 @@ void density_est(float4 *pixbuf, float4 *outbuf,
 | 
			
		||||
        float den;
 | 
			
		||||
        read_pix(in, den);
 | 
			
		||||
 | 
			
		||||
        float *dens = reinterpret_cast<float*>(pixbuf);
 | 
			
		||||
        float top    = dens[(idx-{{info.acc_stride}})*4+3],
 | 
			
		||||
              bottom = dens[(idx+{{info.acc_stride}})*4+3];
 | 
			
		||||
        den = fmaxf(den, fabsf(top-bottom));
 | 
			
		||||
        float left = dens[idx*4-1], right = dens[idx*4+7];
 | 
			
		||||
        den = fmaxf(den, fabsf(left-right));
 | 
			
		||||
 | 
			
		||||
        if (in.w > 0 && den > 0) {
 | 
			
		||||
            float ls = k1 * logf(1.0f + in.w * k2) / in.w;
 | 
			
		||||
            in.x *= ls;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user