Skip to main content

Path-tracing Graphics

Our rendering engine allows to use path-tracing method (provided by @gkjohnson) to output 3D geometry.

Download original notebook

Warning: this is very resource consuming feature

(*VB[*)(FrontEndRef["5fd39e7f-0161-4a45-97b1-a82408c75df8"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKm6alGFummqfpGhiaGeqaJJqY6lqaJxnqJloYmRhYJJubpqRZAAB/bhVR"*)(*]VB*)
Graphics3D[ Table[With[{p = {i, j, k}/5}, {RGBColor[p], Opacity[.75], Cuboid[p, p + .15]}], {i, 5}, {j, 5}, {k, 5}], RTX->True]
(*VB[*)(FrontEndRef["94768841-0a94-40c8-a67a-8b2e55769100"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKW5qYm1lYmBjqGiRamuiaGCRb6CaamSfqWiQZpZqamptZGhoYAABvTRSQ"*)(*]VB*)

Another example transformation enables RTX for a regular 3D plot

Plot3D[Sin[x] Cos[y], {x,-10,10}, {y,-10,10}][[1]];
Graphics3D[{%, Graphics3D`Materials["Glass"], Red, Sphere[{0,0,2}, 4]}, RTX->True]
(*VB[*)(FrontEndRef["17095412-a398-40c7-b6ee-ee62d6f3e363"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKG5obWJqaGBrpJhpbWuiaGCSb6yaZpabqpqaaGaWYpRmnGpsZAwB0ohVL"*)(*]VB*)
RegionPlot3D[x y z < 1, {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, 
   PlotStyle -> {Directive[Cyan, "Roughness"->0.0]}, 
   Mesh -> None, 
   Lighting->{
     SpotLight[Green, {-2.7718, -8.7007, 8.1559}], 
     SpotLight[Red, {-2.7718, 8.7007, 8.1559}]
  }
];
Insert[%, RTX->False, {-1}]
(*VB[*)(FrontEndRef["d71cce8a-3023-46a5-85f5-f7baa4e58e9b"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKp5gbJienWiTqGhsYGeuamCWa6lqYppnqppknJSaapJpapFomAQCJChYK"*)(*]VB*)