Commit 3054f22f authored by Yuri Victorovich's avatar Yuri Victorovich
Browse files

science/py-fresnel: New port: Publication quality path tracing in real time

parent 0cdc4e76
......@@ -266,6 +266,7 @@
SUBDIR += py-dlib
SUBDIR += py-eccodes
SUBDIR += py-esda
SUBDIR += py-fresnel
SUBDIR += py-geolinks
SUBDIR += py-geomet
SUBDIR += py-geometer
......
PORTNAME= fresnel
DISTVERSIONPREFIX= v
DISTVERSION= 0.13.4-4
DISTVERSIONSUFFIX= -g3ba217f
CATEGORIES= science # physics
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= yuri@FreeBSD.org
COMMENT= Publication quality path tracing in real time
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= pybind11>0:devel/pybind11
LIB_DEPENDS= libembree3.so:graphics/embree \
libqhull_r.so:math/qhull8 \
libtbb.so:devel/onetbb
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR}
USES= cmake:testing compiler:c++14-lang python
USE_GITHUB= yes
GH_ACCOUNT= glotzerlab
GH_TUPLE= glotzerlab:random123:7f2371b8c597a486cd33fb421a196d78efe08043:glotzerlab_random123/extern/random123 \
glotzerlab:fresnel-examples:dad005682fc3b5d167861ce7eda23a157baf2ce7:glotzerlab_fresnel_examples/doc/examples \
glotzerlab:qhull:613debeaea72ee66626dace9ba1a2eff11b5d37d:glotzerlab_qhull/extern/qhull
do-test: install
@cd ${WRKDIR} && ${PYTHON_CMD} ${FILESDIR}/example.py
.include <bsd.port.mk>
TIMESTAMP = 1642820220
SHA256 (glotzerlab-fresnel-v0.13.4-4-g3ba217f_GH0.tar.gz) = ac0b4f0e26050cdb4c1f5aa65cca66462127f2e6f2d6e0c97138d510fe5356e6
SIZE (glotzerlab-fresnel-v0.13.4-4-g3ba217f_GH0.tar.gz) = 11009467
SHA256 (glotzerlab-random123-7f2371b8c597a486cd33fb421a196d78efe08043_GH0.tar.gz) = c96b9240953197387977244858d624c81bef15d74c5badd77a07c8d29cb30a8e
SIZE (glotzerlab-random123-7f2371b8c597a486cd33fb421a196d78efe08043_GH0.tar.gz) = 648611
SHA256 (glotzerlab-fresnel-examples-dad005682fc3b5d167861ce7eda23a157baf2ce7_GH0.tar.gz) = c603a5a48b7b559ae091d11f4a1ccdae2628929ccef721d9da1bd17bb8928e5a
SIZE (glotzerlab-fresnel-examples-dad005682fc3b5d167861ce7eda23a157baf2ce7_GH0.tar.gz) = 8110548
SHA256 (glotzerlab-qhull-613debeaea72ee66626dace9ba1a2eff11b5d37d_GH0.tar.gz) = b4504a190dc15c3ae932b998a2eed3cba8c7bdda1ab2a886e7e09d0526ee8143
SIZE (glotzerlab-qhull-613debeaea72ee66626dace9ba1a2eff11b5d37d_GH0.tar.gz) = 1308230
# the example is taken from https://fresnel.readthedocs.io/en/stable/examples/00-Basic-tutorials/00-Introduction.html
# image display is altered to use PIL
## generate image
import fresnel
scene = fresnel.Scene()
geometry = fresnel.geometry.Sphere(scene, N=8, radius=1.0)
geometry.position[:] = [[1,1,1],
[1,1,-1],
[1,-1,1],
[1,-1,-1],
[-1,1,1],
[-1,1,-1],
[-1,-1,1],
[-1,-1,-1]]
geometry.material = fresnel.material.Material(color=fresnel.color.linear([0.25,0.5,0.9]),
roughness=0.8)
scene.camera = fresnel.camera.Orthographic.fit(scene)
fresnel.preview(scene)
fresnel.preview(scene, anti_alias=False)
fresnel.pathtrace(scene)
fresnel.pathtrace(scene, light_samples=40)
out = fresnel.preview(scene)
print(out[:].shape)
print(out[:].dtype)
import PIL
image = PIL.Image.fromarray(out[:], mode='RGBA')
image.save('output.png')
image = PIL.Image.fromarray(out[:,:,0:3], mode='RGB')
image.save('output.jpeg')
## display image
from PIL import Image
im = Image.open('output.png')
im.show()
im = Image.open('output.jpeg')
im.show()
fresnel is a python library for path tracing publication quality
images of soft matter simulations in real time. The fastest render
performance is possible on NVIDIA GPUs using their OptiX ray tracing
engine. fresnel also supports multi-core CPUs using Intel's Embree ray
tracing kernels. Path tracing enables high quality global illumination
and advanced rendering effects controlled by intuitive parameters
(like roughness, specular, and metal).
WWW: https://github.com/glotzerlab/fresnel
%%PYTHON_SITELIBDIR%%/fresnel/__init__.py
%%PYTHON_SITELIBDIR%%/fresnel/_common%%PYTHON_EXT_SUFFIX%%.so
%%PYTHON_SITELIBDIR%%/fresnel/_cpu%%PYTHON_EXT_SUFFIX%%.so
%%PYTHON_SITELIBDIR%%/fresnel/camera.py
%%PYTHON_SITELIBDIR%%/fresnel/color.py
%%PYTHON_SITELIBDIR%%/fresnel/conftest.py
%%PYTHON_SITELIBDIR%%/fresnel/geometry.py
%%PYTHON_SITELIBDIR%%/fresnel/interact.py
%%PYTHON_SITELIBDIR%%/fresnel/light.py
%%PYTHON_SITELIBDIR%%/fresnel/material.py
%%PYTHON_SITELIBDIR%%/fresnel/test/conftest.py
%%PYTHON_SITELIBDIR%%/fresnel/test/pytest.ini
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_f_stop.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_focal_distance.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_focal_length.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_height.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_pathtrace.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_box_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_box_radius.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_radius.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render0.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render1.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render2.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render3.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render4.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render5.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_outline.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_position.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_radius.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_convex_polyhedron.test_face_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_convex_polyhedron.test_outline.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_convex_polyhedron.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_color_interp.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_multiple.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_outline.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_angle.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_outline.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_position.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_rounded.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_outline.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_position.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_radius.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_metal.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_primitive_color_mix.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_roughness.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_set_material.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_solid.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_specular.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_color.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_primitive_color_mix.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_set_material.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_solid.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_camera.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_light_dir.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries1.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries2.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries3.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries4.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_tracer_direct.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_tracer_direct.test_render_aa.png
%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_tracer_path.test_render.png
%%PYTHON_SITELIBDIR%%/fresnel/test/test_camera_orthographic.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_camera_perspective.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_device.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_box.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_convex_polyhedron.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_cylinder.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_mesh.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_polygon.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_sphere.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_light.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_material.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_outline_material.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_scene.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_tracer_direct.py
%%PYTHON_SITELIBDIR%%/fresnel/test/test_tracer_path.py
%%PYTHON_SITELIBDIR%%/fresnel/tracer.py
%%PYTHON_SITELIBDIR%%/fresnel/util.py
%%PYTHON_SITELIBDIR%%/fresnel/version.py
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment