Пример #1
0
    def test_importor_sample(self):
        scene = example.cornell_box

        render = ims.importer_sample(ctx.Context())
        input_xy, output_color = render.drive_raycasting(scene)

        writer = sw.NormalizedWriter(ctx.Context())
        writer.write(input_xy, output_color, 'output_test1.jpg')
Пример #2
0
    def test_normalizedwriter(self):
        sample_size = 100
        input_xy = np.random.random((int(sample_size), 2)) * 2 - 1
        output_color = np.random.random((int(sample_size), 3))
        output_color[input_xy[:, 0] > input_xy[:, 1], :] = 0

        writer = sw.NormalizedWriter(ctx.Context())
        writer.write(input_xy, output_color, 'output_points.jpg')
Пример #3
0
    def test_simple_render(self):
        
        scene = example.cornell_box

        render = raycasting.SimpleReverseRayCasting(ctx.Context())
        input_xy, output_color = render.drive_raycasting(scene)
        
        writer = sw.NormalizedWriter(ctx.Context())
        writer.write(input_xy, output_color, 'output_test.jpg')
Пример #4
0
    def render(self):

        scene = make_shadow_cornell_box()

        myContext = ctx.Context()
        # myContext.raycasting_iteration = int(1e6)
        render = raycasting.SimpleReverseRayCasting(myContext)
        input_xy, output_color = render.drive_raycasting(scene)

        writer = sw.NormalizedWriter(myContext)
        writer.write(input_xy, output_color, 'output_test.jpg')


# if __name__ == "__main__":
#     test = STRRelaxRender()
#     test.render()