「利用者:Juicyfruit/Color Temperature」の版間の差分

提供: wiki
移動先: 案内検索
(Created page with "=== Notes on color temperature / blackbody to rgb === === links: === -http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.html -http://www.vendian.org/mnchari...")
 
(1版 をインポートしました)
 
(相違点なし)

2018年6月29日 (金) 05:54時点における最新版

Notes on color temperature / blackbody to rgb

links:

-http://www.vendian.org/mncharity/dir3/blackbody/UnstableURLs/bbr_color.html -http://www.vendian.org/mncharity/dir3/blackbody/parameters.html -http://www.physics.sfasu.edu/astro/color/blackbodyc.txt


OSL approximate conversion

taken from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693#post2268693

shader temperature_color
[[ string description = "Color temperature to RGB converter, for 1000 < t <  40000" ]](
    float Temperature = 6500.0,
    output color Color = color(0, 0, 0)
) {
    vector a, b, c;
    if (Temperature <= 6500.0) {
        a = vector(0, -2902.1955373783176, -8257.7997278925690);
        b = vector(0, 1669.5803561666639, 2575.2827530017594);
        c = vector(1, 1.3302673723350029, 1.8993753891711275);
    } else {
        a = vector(1745.0425298314172, 1216.6168361476490, -8257.7997278925690);
        b = vector(-2666.3474220535695, -2173.1012343082230, 2575.2827530017594);
        c = vector(0.55995389139931482, 0.70381203140554553, 1.8993753891711275);
    }
    vector x = a / (Temperature + b) + c;
    Color = color(clamp(x[0], 0, 1), clamp(x[1], 0, 1), clamp(x[2], 0, 1));
}