Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Math behind Graph Bias adjustment

Math behind Graph Bias adjustment

2003-11-20       - By stephan mantler

 Back
Reply:     1     2     3     4  

Helmar Gerhardt wrote:
> Hi, I'm trying to figure out the mathematics behind Maya's ramp graph
> input bias adjustment. (...) If the input bias is 0.0 then a value of
> 0.5 will map to the exact middle of the opacity curve.

i can imagine a number of ways to achieve this, but standard
gamma correction seems like a good starting point:

in : 0 <=  x   <= 1; gamma > 0
out: 0 <= f(x) <= 1

f(x, gamma) = x^(1/gamma)


now, since you would like to specify a bias instead of gamma:
(note that we can assume -0.5 < bias < 0.5...)

f(0.5,gamma) = bias + 0.5

0.5^(1/gamma) = bias + 0.5

or, after a quick excursion into algebra,

gamma = log(0.5)/log(0.5+bias)

which can then be plugged back into our original formula:

f(x, bias) = x^(1/(log(0.5)/log(0.5+bias))   or, equally,

f(x, bias) = x^(-log(0.5+bias)/log(2))

greetings,
-stephan

ps. hope the math is correct ;-)

--
stephan mantler             | mail - step@(protected)
-- ---- ---- ---- ---- -----| icq  - 799434
It's not an adventure       | fone - +43 (676) 308-5342
until something f--ks up.   | web  - www.stephanmantler.com


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
List-help: <mailto:listar@(protected)?Subject=help>
List-archive: <http://www.highend3d.com/maya/devarchive/>