Kak proverish skorost' renderinga, ne polenis', zapost'
P.S.
v ruchnuu:
#rib
Format 700 700 1
Display "none" "it" "rgb"
ShadingInterpolation "smooth"
ShadingRate 1
PixelSamples 2 2
PixelFilter "mitchell" 3 3
Option "limits" "bucketsize" [32 32]
Option "limits" "gridsize" 1024
Projection "perspective" "fov" 30
WorldBegin
Attribute "visibility" "trace" 1
Attribute "visibility" "transmission" "shader"
Translate 0.0 2. 10.
Attribute "grouping" "string membership" "lightsource"
Color 0.0 20.0 0.0
Surface "constant"
Sphere 1 -1 1 360
Translate 0.0 -1. 0.
Attribute "grouping" "string membership" "geometry"
surface "wire" "D" 0.1 "r" 0.01
Patch "bilinear" "P" [-5 -1.5 -5 5 -1.5 -5 -5 -1.5 5 5 -1.5 5]
"Cs" [0 0 0 1 0 0 0 1 0 0 0 1 1 1 1]
Color 1 1 1
Surface "objlighted_rts" "samples" 64
Patch "bilinear" "P" [-5 -2 -5 5 -2 -5 -5 -2 5 5 -2 5]
WorldEnd
surface
objlighted_rts (uniform float samples=1)
{
Ci=0;
varying color hitc=0;
varying point hitp=0;
gather ("illuminance", P, faceforward(N,I), PI/2, samples,
"subset", "lightsource",
"distribution", "uniform",
"surface:Ci",hitc,"primitive
", hitp)
{
Ci+=hitc*transmission(P,hitp,"subset","geometry");
}
Oi = Os;
Ci = Ci * Cs / samples * Os;
}
surface wire (uniform float D=1, r=0.25)
{
uniform float R=D/2, h=R-r;
varying float un=abs(mod(u,D)-R);
varying float vn=abs(mod(v,D)-R);
if (un>h || vn>h)
{
Oi=Os;
if (N.I<0) Ci=Cs;
else Ci=color(1)-trace(P,I);
}
else Oi=0;
}