面向多边形决定了渲染的结果

时间:2011-07-19 18:55:46

标签: graphics rendering voronoi

我在aqsis renderman中使用了voroni函数。当我在下面使用此功能时 polygon它会生成看起来像星形场的斑点:

Polygon "P" [ -70 -70 -1 70 -70 -1 70 70 -1 -70 70 -1]

但是这个多边形只会生成一堆行:

Polygon "P" [ -700 0 480 700 0 480 700 0 -170 -700 0 -170   ]

这是voroni功能:

void voronoi_f1_3d (float jitter; float frequency; output float f1)
{   
    point p=point(s*frequency,t*frequency,0);
    point thiscell = point (floor(s*frequency)+0.5,floor(t*frequency)+0.5,0);

    f1 = 1000;
    uniform float i, j;
    for (i = -1; i <= 1; i += 1) {
        for (j = -1; j <= 1; j += 1) {
            point testcell = thiscell + vector(i,j,0);
            point pos = testcell+jitter*(vector cellnoise (testcell) - 0.5);
            vector offset = pos - p;
            float dist = offset . offset;
            if (dist < f1) {
                f1 = dist; //pos1 = pos;
            }
        }
    }
    f1 = sqrt(f1);
}

以下是我如何使用它:

voronoi_f1_3d(jidder,gfrq,pointy);
T = Cs*(1-smoothstep(0.1,1,pointy))*Nf;
Ci = T;    

我认为差异在于多边形面临的方式,但我不知道如何补偿。

0 个答案:

没有答案