Math behind Graph Bias adjustment 2003-11-20 - By Kelly Brock
Back I can see two possibilities here, unfortunately the description is relatively vague since it says "most" values will shift. Anyway, the first one is the easier one, remap the range of the curve to the range 0 to 1-bias. This does not "sound" like the answer but you can check it relatively simply I imagine.
The other, more useful version that I can think of is the bias/gain functionality described by Ebert (think it was Ebert at least, may be Musgrave, no references around here to double check it):
const float LOGP5 = -0.693147f;
const float Bias(const float value, const float bias) { return powf( value, logf(bias)/LOGP5 ); }
const float Gain(const float value, const float gain) { if( value < 0.5f ) return Bias(2.0f*value, 1.0f-gain) / 2.0f; return 1.0f-Bias(2.0f-2.0f*value, 1.0f-gain) / 2.0f; }
This is very similar to the other suggestion of using a gamma function, and in fact may give identical results in certain ranges of inputs. Graph the equation for 0, .25, .5, .75 and 1 to get an idea of the shape. It's a very useful function in this sort of "tweaky" area, though you may need to remap the bias range to match their definition. Of course they may be using something completely different, it's worth a try though..
Kelly Brock The Sims Console Group Maxis - Electronic Arts
> -- --Original Message-- -- > From: maya-dev-bounce@(protected) [mailto:maya-dev-bounce@(protected)] > On Behalf Of Helmar Gerhardt > Sent: Wednesday, November 19, 2003 5:40 PM > To: maya-dev@(protected) > Subject: Math behind Graph Bias adjustment > > Hi, > I'm trying to figure out the mathematics behind Maya's ramp graph input > bias adjustment. The fluidShape node use a lot of them. Maya's description > to the input bias control is as follows: > > Opacity Input Bias adjusts the sensitivity of the selected opacity input > used. Input values of 0 and 1 will always map to the start and end of the > opacity curve, although the bias determines where in the curve a value of > 0.5 will index. For example if one used density as an input, and one > wishes the material to become opaque at a density of 0.001, then the > density bias can be used to shift most of the curve into this density > range. Instead of cramming several values at the beginning of the ramp one > can use the full range. If the input bias is 0.0 then a value of 0.5 will > map to the exact middle of the opacity curve. > > > Anyone know the math to implement this functionality? It would be much > appreciated. Thanks. > > > Regards, > > Helmar > > > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- > List-help: <mailto:listar@(protected)?Subject=help> > List-archive: <http://www.highend3d.com/maya/devarchive/>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|