多边形面决定渲染结果
我在 aqsis renderman 中使用 voroni 函数。当我在以下情况下使用此功能时 多边形它生成看起来像星场的点:
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;
我认为差异在于多边形如何面对,但我不知道如何补偿。
I'm using a voroni function in aqsis renderman. When I use this function on the following
polygon it generates spots that looks like a star field:
Polygon "P" [ -70 -70 -1 70 -70 -1 70 70 -1 -70 70 -1]
But this polygon just generates a bunch of lines:
Polygon "P" [ -700 0 480 700 0 480 700 0 -170 -700 0 -170 ]
Here is the voroni function:
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);
}
And here is how I use it:
voronoi_f1_3d(jidder,gfrq,pointy);
T = Cs*(1-smoothstep(0.1,1,pointy))*Nf;
Ci = T;
The difference I think lies in how the polygons are facing but I dont know how to compensate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论