Skip to content

Commit

Permalink
Merge pull request #222 from Saverio976/dev
Browse files Browse the repository at this point in the history
Release 0.4
  • Loading branch information
bahmez authored May 11, 2023
2 parents e879481 + 6d1f173 commit c9af370
Show file tree
Hide file tree
Showing 180 changed files with 9,586 additions and 612 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Doxygen GitHub Pages Deploy Action
on:
push:
branches:
- main
- dev

jobs:
deploy:
Expand All @@ -12,6 +12,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Create dependencies
run: echo "hpp2plantuml" >> requirements.txt

- name: Install python
uses: actions/setup-python@v4
with:
Expand All @@ -22,9 +25,9 @@ jobs:
run: |
sudo apt-get install -y graphviz doxygen plantuml curl default-jre default-jdk
pip install -r ./requirements.txt
curl -Lo plantuml.jar "https://github.com/plantuml/plantuml/releases/download/v1.2023.4/plantuml.jar"
- name: Build uml
run: make -C documentation uml EXTRA_PARAMS_PLANTUML="java -jar ./plantuml.jar"
run: make -C documentation uml EXTRA_PARAMS_PLANTUML="java -jar ../.github/workflows/plantuml.jar"

- name: Build documentation
run: make -C documentation doxygen
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ jobs:
timeout 2m cmake .. || exit 2
timeout 2m make || exit 3
- name: check binary
- name: check exec
run: |
cd build || exit 1
if [[ ! -f $BINARY ]]; then
echo "::error title=Executable not found::$BINARY"
fi
find tests/documentation -type f -name '*.yaax' -exec ./raytracer --scene-path {} --output-path testit \;
publish:
needs: [compil]
Expand Down
Binary file added .github/workflows/plantuml.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,5 @@ documentation/latex
!documentation/Makefile
documentation/uml.puml
documentation/uml.svg
documentation/docbook
documentation/man
Binary file added Assets/arial.ttf
Binary file not shown.
174 changes: 161 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(Sphere SHARED)
set_target_properties(Sphere PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Sphere PROPERTIES
Expand All @@ -29,7 +29,7 @@ add_library(Camera SHARED)
set_target_properties(Camera PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Camera PROPERTIES
Expand All @@ -38,12 +38,40 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
)
endif()

# CAMERA CUSTOM
add_library(CameraCustom SHARED)
set_target_properties(CameraCustom PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(CameraCustom PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# CAMERA CLUSTER
add_library(CameraCluster SHARED)
set_target_properties(CameraCluster PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(CameraCluster PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# AMBIENT LIGHT
add_library(AmbientLight SHARED)
set_target_properties(AmbientLight PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(AmbientLight PROPERTIES
Expand All @@ -57,7 +85,7 @@ add_library(Plane SHARED)
set_target_properties(Plane PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Plane PROPERTIES
Expand All @@ -71,7 +99,7 @@ add_library(LimitedPlane SHARED)
set_target_properties(LimitedPlane PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(LimitedPlane PROPERTIES
Expand All @@ -85,7 +113,7 @@ add_library(Disk SHARED)
set_target_properties(Disk PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Disk PROPERTIES
Expand All @@ -99,7 +127,7 @@ add_library(Cone SHARED)
set_target_properties(Cone PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Cone PROPERTIES
Expand All @@ -108,12 +136,26 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
)
endif()

# LIMITED CONE
add_library(LimitedCone SHARED)
set_target_properties(LimitedCone PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(LimitedCone PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# POINT LIGHT
add_library(PointLight SHARED)
set_target_properties(PointLight PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(PointLight PROPERTIES
Expand All @@ -127,7 +169,7 @@ add_library(SpotLight SHARED)
set_target_properties(SpotLight PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(SpotLight PROPERTIES
Expand All @@ -141,7 +183,7 @@ add_library(Cylinder SHARED)
set_target_properties(Cylinder PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Cylinder PROPERTIES
Expand All @@ -155,7 +197,7 @@ add_library(LimitedCylinder SHARED)
set_target_properties(LimitedCylinder PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/EntitiesPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(LimitedCylinder PROPERTIES
Expand All @@ -164,12 +206,39 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
)
endif()

# TORUS
add_library(Torus SHARED)
set_target_properties(Torus PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Torus PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()
# TRIANGLE
add_library(Triangle SHARED)
set_target_properties(Triangle PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(Triangle PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# --------- Filters plugins ---------
add_library(SSAAx4 SHARED)
set_target_properties(SSAAx4 PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/FiltersPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Filters"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(SSAAx4 PROPERTIES
Expand All @@ -183,7 +252,7 @@ add_library(PlainMaterial SHARED)
set_target_properties(PlainMaterial PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/MaterialsPlugins"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Materials"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(PlainMaterial PROPERTIES
Expand All @@ -192,6 +261,46 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
)
endif()


add_library(TransparencyMaterial SHARED)
set_target_properties(TransparencyMaterial PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Materials"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(TransparencyMaterial PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

add_library(ChessBoardMaterial SHARED)
set_target_properties(ChessBoardMaterial PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Materials"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(ChessBoardMaterial PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

add_library(ZebraMaterial SHARED)
set_target_properties(ZebraMaterial PROPERTIES
CXX_STANDARD 20
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Materials"
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(ZebraMaterial PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# -----------------------------------
# --------- Main executable ---------

Expand Down Expand Up @@ -263,6 +372,45 @@ if (CMAKE_BUILD_TYPE STREQUAL Release)
)
endif()

# src/Image/ImagePipeLine.cpp
add_library(ray_image_pipeline OBJECT)
set_target_properties(ray_image_pipeline PROPERTIES
CXX_STANDARD 20
POSITION_INDEPENDENT_CODE ON
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(ray_image_pipeline PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# src/Image/PixelThread.cpp
add_library(ray_image_pixelthread OBJECT)
set_target_properties(ray_image_pixelthread PROPERTIES
CXX_STANDARD 20
POSITION_INDEPENDENT_CODE ON
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(ray_image_pixelthread PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()

# src/Progress.cpp
add_library(ray_progress OBJECT)
set_target_properties(ray_progress PROPERTIES
CXX_STANDARD 20
POSITION_INDEPENDENT_CODE ON
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set_target_properties(ray_progress PROPERTIES
UNITY_BUILD true
UNITY_BUILD_MODE BATCH
)
endif()


# -----------------------------------
# ------------- rest .. -------------
Expand Down
Empty file removed EntitiesPlugins/.gitkeep
Empty file.
Empty file removed FiltersPlugins/.gitkeep
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Xavier, Younes, Simon, Adbel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions PluginsExt/AmbientLight/AmbientLightEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ namespace RayTracer::PluginsExt::AmbientLight {
if (_transform.getScale().getY() != 0 || _transform.getScale().getZ() != 0) {
_logger.warn("AMBIENT_lIGHT: config: scale y z must be 0 (remainder: x is for power)");
}
if (_transform.getRotation().getX() != 0 || _transform.getRotation().getY() != 0 || _transform.getRotation().getZ() != 0) {
_logger.warn("AMBIENT_LIGHT: config: rotation x y z must be 0 (why rotate an AmbientLight ?)");
}
_power = std::abs(_power * _transform.getScale().getX());
}

Expand Down
6 changes: 6 additions & 0 deletions PluginsExt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ add_subdirectory(Plane)
add_subdirectory(LimitedPlane)
add_subdirectory(Disk)
add_subdirectory(Cone)
add_subdirectory(LimitedCone)
add_subdirectory(PointLight)
add_subdirectory(SpotLight)
add_subdirectory(Cylinder)
add_subdirectory(LimitedCylinder)
add_subdirectory(AntiAliasing)
add_subdirectory(PlainMaterial)
add_subdirectory(TransparencyMaterial)
add_subdirectory(Triangle)
add_subdirectory(ChessBoardMaterial)
add_subdirectory(ZebraMaterial)
add_subdirectory(Torus)
Loading

0 comments on commit c9af370

Please sign in to comment.