Beispiel #1
0
Cylinder(0.5,
         1.0,
         world,
         transform=translate(0.5, 5, 4) * rotate(90, 0, 0),
         material=UniformSurfaceEmitter(d65_white, 0.5))
Cylinder(0.5,
         1.0,
         world,
         transform=translate(0.5, 5, 2) * rotate(90, 0, 0),
         material=UniformSurfaceEmitter(d65_white, 0.5))

# observer
rgb = RGBPipeline2D(display_unsaturated_fraction=0.85)
sampler = RGBAdaptiveSampler2D(rgb,
                               ratio=10,
                               fraction=0.2,
                               min_samples=500,
                               cutoff=0.01)
camera = PinholeCamera((1024, 512),
                       pipelines=[rgb],
                       frame_sampler=sampler,
                       transform=translate(0, 3.3, 0) * rotate(0, -47, 0),
                       fov=42,
                       parent=world)
camera.spectral_rays = 1
camera.spectral_bins = 15
camera.pixel_samples = 250

# start ray tracing
ion()
name = 'modifier_add'
Beispiel #2
0
                        transform=rotate(-35.5, 0, 0) * translate(0.10, 0, 0) *
                        rotate(90, 0, 0))

# background light source
top_light = Sphere(0.25,
                   parent=world,
                   transform=translate(-1, 2, 1),
                   material=UniformSurfaceEmitter(d65_white, scale=5))

# Give the prism a high importance to ensure adequate sampling
prism.material.importance = 9

rgb = RGBPipeline2D()
rgb.display_sensitivity = 2.0

sampler = RGBAdaptiveSampler2D(rgb, min_samples=500)

# create and setup the camera
camera = PinholeCamera((1920, 1080),
                       fov=45,
                       parent=world,
                       pipelines=[rgb],
                       frame_sampler=sampler)
camera.transform = translate(0, 0.075, -0.05) * rotate(
    180, -45, 0) * translate(0, 0, -0.75)
camera.ray_importance_sampling = True
camera.ray_important_path_weight = 0.75
camera.ray_max_depth = 500
camera.ray_extinction_prob = 0.01
camera.spectral_bins = 32
camera.spectral_rays = 32
Beispiel #3
0
                     transform=translate(-1.1, 1, 0.8) * rotate(10, 0, 0))

box_rotated = Box(Point3D(-1, -1, -0.25),
                  Point3D(1, 1, 0.25),
                  material=VolumeTransform(CosGlow(), rotate(0, 90, 0)),
                  parent=world,
                  transform=translate(-3.2, 1, 0) * rotate(30, 0, 0))

floor = Box(Point3D(-100, -0.1, -100),
            Point3D(100, 0, 100),
            world,
            material=RoughTitanium(0.1))

# camera
rgb_pipeline = RGBPipeline2D(display_update_time=5)
sampler = RGBAdaptiveSampler2D(rgb_pipeline, min_samples=100, fraction=0.2)
camera = PinholeCamera((512, 256),
                       parent=world,
                       transform=translate(0, 6.5, -10) * rotate(0, -30, 0),
                       pipelines=[rgb_pipeline],
                       frame_sampler=sampler)
camera.spectral_bins = 15
camera.spectral_rays = 1
camera.pixel_samples = 100

# integration resolution
box_unshifted.material.integrator.step = 0.05
box_down_shifted.material.material.integrator.step = 0.05
box_up_shifted.material.material.integrator.step = 0.05
box_rotated.material.material.integrator.step = 0.05
Beispiel #4
0
# front light
Sphere(5,
       world,
       transform=translate(1, 8, -10),
       material=UniformVolumeEmitter(d65_white, 1.0))

# fill light
Sphere(10,
       world,
       transform=translate(7, 20, 20),
       material=UniformSurfaceEmitter(d65_white, 0.15))

# camera
rgb = RGBPipeline2D(display_update_time=15, display_unsaturated_fraction=0.995)
sampler = RGBAdaptiveSampler2D(rgb,
                               min_samples=1000,
                               fraction=0.1,
                               cutoff=0.01)
camera = PinholeCamera((1024, 1024),
                       parent=world,
                       transform=translate(0, 4, -3.5) * rotate(0, -46, 0),
                       pipelines=[rgb],
                       frame_sampler=sampler)
camera.spectral_bins = 21
camera.spectral_rays = 21
camera.pixel_samples = 250
camera.ray_max_depth = 10000
camera.ray_extinction_min_depth = 3
camera.ray_extinction_prob = 0.002

# start ray tracing
ion()