Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
aa03741
moving references to doc section
Jun 24, 2026
5d706d4
Updating c++ standard to 26
Jun 24, 2026
b746cc1
Update citation url
Jun 24, 2026
f4ff65b
Adding hiprt build function to test
AurelienBesnier Jul 3, 2026
e0e3194
removing tinyobjloader external folder and installing with conda
AurelienBesnier Jul 3, 2026
a5ffd0f
fixing example compilation
AurelienBesnier Jul 3, 2026
faaabf9
Fixing cpp test build
AurelienBesnier Jul 3, 2026
08332b9
Not building tests by default
AurelienBesnier Jul 3, 2026
89e830c
Adding dep in pyproject
AurelienBesnier Jul 3, 2026
c96cf90
Adding hip option in cmake
AurelienBesnier Jul 6, 2026
3883350
Adding GLTF model loading method
AurelienBesnier Jul 6, 2026
04aa923
Adding python binding to GLTF loading
AurelienBesnier Jul 6, 2026
a588144
Adding missing dep
AurelienBesnier Jul 6, 2026
663b3d1
trying other ways of finding lib
AurelienBesnier Jul 6, 2026
9431d4e
Removing unecessary link
AurelienBesnier Jul 6, 2026
561ea34
Removing unecessary link
AurelienBesnier Jul 6, 2026
35efd79
Trying with other link flag
AurelienBesnier Jul 6, 2026
f406d9e
Using fetch content
AurelienBesnier Jul 6, 2026
cec30d1
Revert "Adding missing dep"
AurelienBesnier Jul 6, 2026
5988f72
Revert "Using fetch content"
AurelienBesnier Jul 6, 2026
1167435
Actually using the loadGTLF fct
AurelienBesnier Jul 6, 2026
3fc6a72
removing result directory in test
AurelienBesnier Jul 6, 2026
2b84b41
setting minimum mac version
AurelienBesnier Jul 6, 2026
03433fe
[ci skip] adding missing dep in dev env
AurelienBesnier Jul 9, 2026
a35dbdf
Cleaning some code (unused imports, etc...)
AurelienBesnier Aug 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vscode/
.cache/
build/
doc/
doc/_build
.idea/
.DS_Store
CMakeLists.txt.user
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "externals/tinyobjloader"]
path = externals/tinyobjloader
url = https://github.com/tinyobjloader/tinyobjloader.git
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ authors:
family-names: Boudon
affiliation: CIRAD
orcid: 'https://orcid.org/0000-0001-9636-3102'
repository-code: 'https://github.com/openalea-incubator/spice'
repository-code: 'https://github.com/openalea/spice'
keywords:
- photon mapping
- light simulation
Expand Down
35 changes: 30 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cmake_minimum_required(VERSION 3.20)
project(photon_mapping LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD 26)

option(BUILD_TESTS "build c++ tests" OFF)
option(BUILD_CXX_EXAMPLE "build c++ example" OFF)

option(HIP "GPU support with HIP" OFF)

# --- Build setup
find_package(TBB CONFIG REQUIRED)
find_package(Threads REQUIRED)
Expand All @@ -18,6 +20,7 @@ endif()
# apple newer C++ features with old SDK
if(APPLE)
set(CMAKE_CXX_FLAGS "${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
endif()

# Embree4
Expand All @@ -29,9 +32,31 @@ else()
message(FATAL_ERROR "Could not find Embree")
endif()

# find tinyobjloader & tinygltf
include(FetchContent)

set(TINYOBJLOADER_BUILD_TEST_LOADER OFF CACHE INTERNAL "")

FetchContent_Declare(
tinyobjloader
GIT_REPOSITORY https://github.com/tinyobjloader/tinyobjloader.git
GIT_TAG release
)

set(TINYGLTF_BUILD_EXAMPLES OFF CACHE INTERNAL "")

# externals
add_subdirectory("externals")
FetchContent_Declare(
tinygltf
GIT_REPOSITORY https://github.com/syoyo/tinygltf.git
GIT_TAG release
)

# Bring both packages into the build tree
FetchContent_MakeAvailable(tinyobjloader tinygltf)

if(HIP)
find_package(hiprt CONFIG REQUIRED)
endif()

add_subdirectory("src/cpp/include")

Expand All @@ -41,13 +66,13 @@ add_library(pm INTERFACE src/python/ext_photonmapping_nano.cpp)

set_target_properties(pm
PROPERTIES
CXX_STANDARD 23
CXX_STANDARD 26
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS YES
)


target_link_libraries(pm INTERFACE TBB::tbb OpenMP::OpenMP_CXX tinyobjloader embree Threads::Threads photon_map primitive triangle image)
target_link_libraries(pm INTERFACE TBB::tbb OpenMP::OpenMP_CXX embree Threads::Threads photon_map primitive triangle image)

# wrapper
add_subdirectory("src/python/")
Expand Down
2 changes: 2 additions & 0 deletions conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ dependencies:
- openalea.lpy
- openalea.plantgl
- openalea.widgets
- tinyobjloader
- embree
- make
- cxx-compiler
- tinygltf
- cmake
- tbb
- tbb-devel
Expand Down
102 changes: 85 additions & 17 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# {# pkglts, sphinx
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXATUOBUILD = sphinx-autobuild
PAPER =
BUILDDIR = _build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand All @@ -20,19 +15,22 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

.PHONY: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " rtdhtml Build html using same settings used on ReadtheDocs"
@echo " livehtml Make standalone HTML files and rebuild the documentation when a change is detected. Also includes a livereload enabled web server"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
Expand All @@ -46,135 +44,205 @@ help:
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"

.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
rm -rf generated/*
rm -rf auto_gallery/

.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

.PHONY: rtdhtml
rtdhtml:
$(SPHINXBUILD) -T -j auto -E -W --keep-going -b html -d $(BUILDDIR)/doctrees -D language=en . $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."


.PHONY: livehtml
livehtml:
# @echo "$(SPHINXATUOBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html"
$(SPHINXATUOBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

.PHONY: html-noplot
html-noplot:
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

.PHONY: htmlhelp
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

.PHONY: qthelp
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pkglts.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xarray.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pkglts.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xarray.qhc"

.PHONY: applehelp
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."

.PHONY: devhelp
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/pkglts"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pkglts"
@echo "# mkdir -p $$HOME/.local/share/devhelp/xarray"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xarray"
@echo "# devhelp"

.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

.PHONY: epub3
epub3:
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."

.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

.PHONY: text
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

.PHONY: man
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."

.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

# #}
.PHONY: dummy
dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Openalea Spice documentation
guide.rst
code_example.rst
notebook_examples.rst
references.rst


.. include:: ../README.md
Expand Down
Loading
Loading