Date: Fri, 29 Mar 2024 09:13:10 +0000 (UTC) Message-ID: <553112465.575.1711703590427@ip-10-0-0-233.us-west-2.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_574_111809224.1711703590424" ------=_Part_574_111809224.1711703590424 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
In Ri, shaders are bound the last active Bxdf. In this case, two differe= nce Bxdfs named "disney1" are bound to two different spheres.
Attribu= teBegin Bxdf "PxrDisney" "disney1" "color base color" [0 1 1] Translate -1 0 0 =09Sphere 1 -1 1 360 AttributeEnd AttributeBegin Bxdf "PxrDisney" "disney1" "color base color" [0 1 1] Translate 1 0 0 =09Sphere 1 -1 1 360 AttributeEnd
Because attribute and transformation hierarchies often don't match mater= ial hierarchies, material network may be duplicated in Ri streams. In the a= bove example, the two Bxdfs are identical. RenderMan provides a special "st= ring __materialid" mechanism to identify and re-bind to previously emitted = materials. In this case, a single "disney1" material network is emitted but= bound to two different spheres. The same "string __materialid" parameter c= an use used to identify and deduplicate RiBxdf, RiLight, and RiDisplace sha= ding networks.
Attribu= teBegin Bxdf "PxrDisney" "disney1" "color base color" [0 1 1] "string __materia= lid" ["material1"] AttributeEnd AttributeBegin Bxdf "" "" "string __materialid" ["material1"] Translate -1 0 0 Sphere 1 -1 1 360 AttributeEnd AttributeBegin Bxdf "" "" "string __materialid" ["material1"] Translate 1 0 0 Sphere 1 -1 1 360 AttributeEnd
The same mechanism can be used to late bind materials inside Ri procedur= als. In this case, a sphere is bound to material "PxrDiffuse1SG".
static = RtUString const k_materialid("string __materialid"); RtUString materialid("PxrDiffuse1SG"); RtUString nms[] =3D { k_materialid }; RtPointer vals[] =3D { &materialid }; ri->BxdfV(Rix::k_empty, Rix::k_empty, 1, nms, vals); ri->SphereV(1, -1, 1, 360, 0, nullptr, nullptr);