Patch for OSA problems !!!

Blender's renderer and external renderer export

Moderators: jesterKing, stiv

rwenzlaff
Posts: 31
Joined: Wed Oct 23, 2002 2:26 pm

Patch for OSA problems !!!

Postby rwenzlaff » Wed Aug 27, 2003 4:39 pm

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 4:47 am, edited 1 time in total.

rwenzlaff
Posts: 31
Joined: Wed Oct 23, 2002 2:26 pm

Postby rwenzlaff » Wed Aug 27, 2003 6:40 pm

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

rwenzlaff
Posts: 31
Joined: Wed Oct 23, 2002 2:26 pm

Postby rwenzlaff » Fri Aug 29, 2003 5:09 am

I put it at the top, too, but

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

soletread
Posts: 83
Joined: Fri Jan 10, 2003 7:11 pm

Postby soletread » Sat Aug 30, 2003 4:14 pm

This is a great investgative effort. !!!

Well done. :o

Will this patch make the 2.29 release?

------------

z3r0_d
Posts: 1522
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Postby z3r0_d » Sat Aug 30, 2003 8:26 pm

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)

rwenzlaff
Posts: 31
Joined: Wed Oct 23, 2002 2:26 pm

Postby rwenzlaff » Mon Sep 01, 2003 8:42 am

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


Return to “Rendering”

Who is online

Users browsing this forum: No registered users and 2 guests