Previous Thread  Next Thread

chat icon Patch for OSA problems !!!

rwenzlaff

Posted: Wed Aug 27, 2003 3:39 pm
Joined: 23 Oct 2002
Posts: 31
I discovered that the OSA problems Blender experiences are only apparent when the (spec+ref) settings of a background object total more than 1.00.

This kind of makes sense. Since spec and ref are supposed to be the % of light reflected specularly, and diffusely, They should never total more than 1.00. (It's interesting that Blender's default material reflects 130% of the light that falls on it.)

So if the background object is reflecting more light than it recieves, it makes sense that its samples in the OSA sum are weighted too high. Setting spec=2 and ref=1 escentially turns off OSA for those edges, since the background is outweighed up to 3:1. I think just clipping the OSA contribution of any face to 1.00 will solve this. A better solution might be to apply some kind of gamma function to the contribution.

I'll look tonight to see if I can find the spot in the code to do this.

EDIT: Did it. A simple change to pixelblending.c seems to fix this. I also added a button to turn it off to test to make sure I didn't introduce any other artifacts.

http://www.soylent-green.com/ClipOSA.patch


Det. Thorn

Last edited by rwenzlaff on Fri Aug 29, 2003 3:47 am; edited 1 time in total
Reply with quote


rwenzlaff

Posted: Wed Aug 27, 2003 5:40 pm
Joined: 23 Oct 2002
Posts: 31
BTW: Heres a file that shows what I mean:

http://www.soylent-green.com/AA.blend

Play with the spec and ref settings of the "white" material.

TTFN
Reply with quote


rwenzlaff

Posted: Fri Aug 29, 2003 4:09 am
Joined: 23 Oct 2002
Posts: 31
I put it at the top, too, but

http://www.soylent-green.com/ClipOSA.patch
Reply with quote


soletread

Posted: Sat Aug 30, 2003 3:14 pm
Joined: 10 Jan 2003
Posts: 82
This is a great investgative effort. !!!

Well done. Surprised

Will this patch make the 2.29 release?

------------
Reply with quote


z3r0_d

Posted: Sat Aug 30, 2003 7:26 pm
Joined: 16 Oct 2002
Posts: 1520
but blender is not the real world, why should I care about inaccuracies it has?

(though the blending should be bounded before the blending, if that is the problem)

so: don't change my material settings, try to fix the problem before the values are blended. (instead of as they are converted to rgb)
Reply with quote


rwenzlaff

Posted: Mon Sep 01, 2003 7:42 am
Joined: 23 Oct 2002
Posts: 31
z3r0_d wrote:
but blender is not the real world, why should I care about inaccuracies it has?


Cause it looks terrible???? You like jagged edges? Feel free to turn OSA off.
z3r0_d wrote:

(though the blending should be bounded before the blending, if that is the problem)
so: don't change my material settings, try to fix the problem before the values are blended. (instead of as they are converted to rgb)

The problem comes from the fact that internally blender was using a number greater than 1, but it can't display anything brighter than that.
A color value of 1.0 converts to 0xff.

Before if a pixel was 1/2 intensity 0.8, and 1/2 intensity 1.3, the average came out to 1.05 which was clipped to 1.0. Since the face that was 1.3 is really shown as 1.0, this means the darker face's contribution was wiped out. The pixel escentially had OSA turned off and rendered with a jagged edge.

With my patch, the 0.8 contributes as normal, but the 1.3 only contributes 1.0 (because this is what it really gets displayed as). The average is 0.9 which is exactly the color you'd expect for a pixel that is 1/2 0.8 and 1/2 1.0 (as displayed).

Det Thorn
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group