diff --git a/CMakeLists.txt b/CMakeLists.txt index 6135080f1..def99fe77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,23 @@ if (CMAKE_BUILD_TYPE STREQUAL Release) ) endif() +# OBJ +add_library(Obj SHARED) +set_target_properties(Obj PROPERTIES + CXX_STANDARD 20 + PREFIX "" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Entities" +) +if (CMAKE_BUILD_TYPE STREQUAL Release) + set_target_properties(Obj PROPERTIES + UNITY_BUILD true + UNITY_BUILD_MODE BATCH + ) +endif() + # --------- Filters plugins --------- + +# SSAAx4 add_library(SSAAx4 SHARED) set_target_properties(SSAAx4 PROPERTIES CXX_STANDARD 20 @@ -247,6 +263,20 @@ if (CMAKE_BUILD_TYPE STREQUAL Release) ) endif() +# BlackAndWhite +add_library(BlackAndWhite SHARED) +set_target_properties(BlackAndWhite PROPERTIES + CXX_STANDARD 20 + PREFIX "" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Filters" +) +if (CMAKE_BUILD_TYPE STREQUAL Release) + set_target_properties(BlackAndWhite PROPERTIES + UNITY_BUILD true + UNITY_BUILD_MODE BATCH + ) +endif() + # --------- Materials plugins --------- add_library(PlainMaterial SHARED) set_target_properties(PlainMaterial PROPERTIES @@ -261,6 +291,18 @@ if (CMAKE_BUILD_TYPE STREQUAL Release) ) endif() +add_library(RefractionMaterial SHARED) +set_target_properties(RefractionMaterial PROPERTIES + CXX_STANDARD 20 + PREFIX "" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Materials" +) +if (CMAKE_BUILD_TYPE STREQUAL Release) + set_target_properties(RefractionMaterial PROPERTIES + UNITY_BUILD true + UNITY_BUILD_MODE BATCH + ) +endif() add_library(TransparencyMaterial SHARED) set_target_properties(TransparencyMaterial PROPERTIES @@ -301,6 +343,19 @@ if (CMAKE_BUILD_TYPE STREQUAL Release) ) endif() +add_library(MirrorMaterial SHARED) +set_target_properties(MirrorMaterial PROPERTIES + CXX_STANDARD 20 + PREFIX "" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugins/Materials" +) +if (CMAKE_BUILD_TYPE STREQUAL Release) + set_target_properties(MirrorMaterial PROPERTIES + UNITY_BUILD true + UNITY_BUILD_MODE BATCH + ) +endif() + # ----------------------------------- # --------- Main executable --------- diff --git a/PluginsExt/BlackAndWhite/BlackAndWhiteCreator.cpp b/PluginsExt/BlackAndWhite/BlackAndWhiteCreator.cpp new file mode 100644 index 000000000..e86abbb9b --- /dev/null +++ b/PluginsExt/BlackAndWhite/BlackAndWhiteCreator.cpp @@ -0,0 +1,25 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** BlackAndWhiteCreator.cpp +*/ + +#include "BlackAndWhiteCreator.hpp" +#include "BlackAndWhiteFilter.hpp" + +namespace RayTracer::PluginsExt::BlackAndWhite { + BlackAndWhiteCreator::~BlackAndWhiteCreator() + { + for (auto element : _elements) { + delete element; + } + } + + Filters::IFilter *BlackAndWhiteCreator::create(const Scenes::ISetting &config, ILogger &logger) + { + BlackAndWhiteFilter *element = new BlackAndWhiteFilter(config, logger); + _elements.push_back(element); + return element; + } +} diff --git a/PluginsExt/BlackAndWhite/BlackAndWhiteCreator.hpp b/PluginsExt/BlackAndWhite/BlackAndWhiteCreator.hpp new file mode 100644 index 000000000..64744e4b7 --- /dev/null +++ b/PluginsExt/BlackAndWhite/BlackAndWhiteCreator.hpp @@ -0,0 +1,30 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** BlackAndWhiteCreator.hpp +*/ + +#ifndef SPHERE_CREATOR_HPP_ + #define SPHERE_CREATOR_HPP_ + + #include + #include + #include "IFilter.hpp" + #include "IFilterCreator.hpp" + #include "ILogger.hpp" + #include "ISetting.hpp" + #include "BlackAndWhiteFilter.hpp" + +namespace RayTracer::PluginsExt::BlackAndWhite { + class BlackAndWhiteCreator : public Plugins::Filters::IFilterCreator { + public: + ~BlackAndWhiteCreator(); + Filters::IFilter *create(const Scenes::ISetting &config, ILogger &logger) final; + + private: + std::vector _elements; + }; +} + +#endif diff --git a/PluginsExt/BlackAndWhite/BlackAndWhiteFilter.cpp b/PluginsExt/BlackAndWhite/BlackAndWhiteFilter.cpp new file mode 100644 index 000000000..d55b577c8 --- /dev/null +++ b/PluginsExt/BlackAndWhite/BlackAndWhiteFilter.cpp @@ -0,0 +1,123 @@ + +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** BlackAndWhileFilter.hpp +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "Color.hpp" +#include "ILogger.hpp" +#include "IFilter.hpp" +#include "ISetting.hpp" +#include "Image.hpp" +#include "BlackAndWhiteFilter.hpp" +#include "Vector2i.hpp" + +namespace RayTracer::PluginsExt::BlackAndWhite { + BlackAndWhiteFilter::BlackAndWhiteFilter(const Scenes::ISetting &config, ILogger &logger): + _logger(logger), + _method(*config.get("method")) + { + std::vector availibleModes = { + "R", "G", "B", "Max", "Min", "Average" + }; + try { + _maxThread = static_cast(*config.get("maxThreads")); + _maxThread = (_maxThread == -1) ? std::thread::hardware_concurrency() : _maxThread; + } catch (const Scenes::ISetting::IParsingException &e) { + _maxThread = std::thread::hardware_concurrency(); + } catch (const Scenes::ISetting::ITypeException &e) { + _maxThread = std::thread::hardware_concurrency(); + } + _maxThread = (_maxThread <= 0) ? 1 : _maxThread; + _maxThread = std::thread::hardware_concurrency(); + _logger.info("BlackAndWhile Max threads : " + std::to_string(_maxThread)); + if (std::find(availibleModes.begin(), availibleModes.end(), _method) == availibleModes.end()) { + std::string message = "BlackAndWhile method " + _method + " is not available (choose between:"; + for (auto it : availibleModes) { + message += " " + it; + } + message += ")"; + _logger.fatal(message); + throw std::runtime_error(message); + } + } + + void BlackAndWhiteFilter::waitOnePlace() + { + while (_futures.size() >= _maxThread) { + for (auto it = _futures.begin() ; it != _futures.end(); it++) { + if ((*it).wait_for(std::chrono::milliseconds(1)) == std::future_status::ready) { + _futures.erase(it); + break; + } + } + } + } + + void BlackAndWhiteFilter::waitAllFinisehd() + { + while (_futures.size() > 0) { + for (auto it = _futures.begin() ; it != _futures.end(); it++) { + if ((*it).wait_for(std::chrono::milliseconds(1)) == std::future_status::ready) { + _futures.erase(it); + break; + } + } + } + } + + void BlackAndWhiteFilter::apply(Images::Image &image) + { + _logger.info("Applying BlackAndWhile..."); + + for (int x = 0; x < image.getSize().getX(); x++) { + this->waitOnePlace(); + std::string method = _method; + _futures.push_back(std::async(std::launch::async, [&image, x, method]() { + for (int y = 0; y < image.getSize().getY(); y++) { + image[y][x] = BlackAndWhiteFilter::getColorsMean(image[y][x], method); + } + })); + } + this->waitAllFinisehd(); + _logger.info("BlackAndWhile applied."); + } + + Images::Color BlackAndWhiteFilter::getColorsMean(const Images::Color &color, const std::string &method) + { + static std::map> _methods = { + {"R", [](const Images::Color &color) { + return Images::Color(color[Images::Color::Types::RED], color[Images::Color::Types::RED], color[Images::Color::Types::RED], color[Images::Color::Types::ALPHA]); + }}, + {"G", [](const Images::Color &color) { + return Images::Color(color[Images::Color::Types::GREEN], color[Images::Color::Types::GREEN], color[Images::Color::Types::GREEN], color[Images::Color::Types::ALPHA]); + }}, + {"B", [](const Images::Color &color) { + return Images::Color(color[Images::Color::Types::BLUE], color[Images::Color::Types::BLUE], color[Images::Color::Types::BLUE], color[Images::Color::Types::ALPHA]); + }}, + {"Max", [](const Images::Color &color) { + double max = std::max(std::max(color[Images::Color::Types::RED], color[Images::Color::Types::GREEN]), color[Images::Color::Types::BLUE]); + return Images::Color(max, max, max, color[Images::Color::Types::ALPHA]); + }}, + {"Min", [](const Images::Color &color) { + double min = std::min(std::min(color[Images::Color::Types::RED], color[Images::Color::Types::GREEN]), color[Images::Color::Types::BLUE]); + return Images::Color(min, min, min, color[Images::Color::Types::ALPHA]); + }}, + {"Average", [](const Images::Color &color) { + double sum = color[Images::Color::Types::RED] + color[Images::Color::Types::GREEN] + color[Images::Color::Types::BLUE]; + return Images::Color(sum / 3, sum / 3, sum / 3, color[Images::Color::Types::ALPHA]); + }} + }; + return _methods[method](color); + } +} diff --git a/PluginsExt/BlackAndWhite/BlackAndWhiteFilter.hpp b/PluginsExt/BlackAndWhite/BlackAndWhiteFilter.hpp new file mode 100644 index 000000000..2e3208a05 --- /dev/null +++ b/PluginsExt/BlackAndWhite/BlackAndWhiteFilter.hpp @@ -0,0 +1,50 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** BlackAndWhiteFilter.hpp +*/ + +#ifndef BASICENTITY_HPP_ + #define BASICENTITY_HPP_ + + #include +#include + #include + #include "Color.hpp" + #include "ILogger.hpp" + #include "IFilter.hpp" + #include "ISetting.hpp" + #include "Image.hpp" + +namespace RayTracer::PluginsExt::BlackAndWhite { + class BlackAndWhiteFilter : public Filters::IFilter { + public: + BlackAndWhiteFilter(const Scenes::ISetting &config, ILogger &logger); + void apply(Images::Image &image) final; + + private: + /** + * @brief Wait one place in the vector of futures + */ + void waitOnePlace(); + /** + * @brief Wait all places in the vector of futures + */ + void waitAllFinisehd(); + /** + * @brief Mean of the colors + * + * @param colors The colors to mean + * + * @return The mean + */ + static Images::Color getColorsMean(const Images::Color &color, const std::string &method); + ILogger &_logger; + int _maxThread; + std::vector> _futures; + std::string _method; + }; +} + +#endif diff --git a/PluginsExt/BlackAndWhite/CMakeLists.txt b/PluginsExt/BlackAndWhite/CMakeLists.txt new file mode 100644 index 000000000..85804f8d4 --- /dev/null +++ b/PluginsExt/BlackAndWhite/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.13) + +target_sources(BlackAndWhite PRIVATE + EntryPoint.cpp + BlackAndWhiteFilter.cpp + BlackAndWhiteCreator.cpp +) diff --git a/PluginsExt/BlackAndWhite/EntryPoint.cpp b/PluginsExt/BlackAndWhite/EntryPoint.cpp new file mode 100644 index 000000000..5c5dc6b04 --- /dev/null +++ b/PluginsExt/BlackAndWhite/EntryPoint.cpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** EntryPoint.cpp +*/ + +#include +#include "BlackAndWhiteFilter.hpp" +#include "Api.hpp" +#include "BlackAndWhiteCreator.hpp" + +extern "C" { + void *getCreator(void) + { + return new RayTracer::PluginsExt::BlackAndWhite::BlackAndWhiteCreator(); + } + + void deleteCreator(void *creator) + { + delete static_cast(creator); + } +} diff --git a/PluginsExt/CMakeLists.txt b/PluginsExt/CMakeLists.txt index 8efefeb49..e1949f0ec 100644 --- a/PluginsExt/CMakeLists.txt +++ b/PluginsExt/CMakeLists.txt @@ -14,8 +14,12 @@ add_subdirectory(Cylinder) add_subdirectory(LimitedCylinder) add_subdirectory(AntiAliasing) add_subdirectory(PlainMaterial) +add_subdirectory(RefractionMaterial) add_subdirectory(TransparencyMaterial) add_subdirectory(Triangle) +add_subdirectory(Obj) add_subdirectory(ChessBoardMaterial) add_subdirectory(ZebraMaterial) +add_subdirectory(MirrorMaterial) add_subdirectory(Torus) +add_subdirectory(BlackAndWhite) diff --git a/PluginsExt/MirrorMaterial/CMakeLists.txt b/PluginsExt/MirrorMaterial/CMakeLists.txt new file mode 100644 index 000000000..09f1d8327 --- /dev/null +++ b/PluginsExt/MirrorMaterial/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.13) + +target_sources(MirrorMaterial PRIVATE + MirrorMaterial.cpp + MirrorCreator.cpp + EntryPoint.cpp +) diff --git a/PluginsExt/MirrorMaterial/EntryPoint.cpp b/PluginsExt/MirrorMaterial/EntryPoint.cpp new file mode 100644 index 000000000..f3b9265a5 --- /dev/null +++ b/PluginsExt/MirrorMaterial/EntryPoint.cpp @@ -0,0 +1,22 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** EntryPoint.cpp +*/ + +#include +#include "Api.hpp" +#include "MirrorCreator.hpp" + +extern "C" { + void *getCreator(void) + { + return new RayTracer::PluginsExt::Mirror::MirrorCreator(); + } + + void deleteCreator(void *creator) + { + delete static_cast(creator); + } +} diff --git a/PluginsExt/MirrorMaterial/MirrorCreator.cpp b/PluginsExt/MirrorMaterial/MirrorCreator.cpp new file mode 100644 index 000000000..6c36d373a --- /dev/null +++ b/PluginsExt/MirrorMaterial/MirrorCreator.cpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** PlaneCreator.cpp +*/ + +#include "MirrorCreator.hpp" +#include "ILogger.hpp" +#include "MirrorMaterial.hpp" + +namespace RayTracer::PluginsExt::Mirror { + MirrorCreator::~MirrorCreator() { + for (MirrorMaterial *element : this->_elements) + delete element; + } + + RayTracer::Entities::IMaterial *MirrorCreator::create(const Scenes::ISetting &config, ILogger &logger) { + MirrorMaterial *element = new MirrorMaterial(config); + this->_elements.push_back(element); + return element; + } +} diff --git a/PluginsExt/MirrorMaterial/MirrorCreator.hpp b/PluginsExt/MirrorMaterial/MirrorCreator.hpp new file mode 100644 index 000000000..5212e3321 --- /dev/null +++ b/PluginsExt/MirrorMaterial/MirrorCreator.hpp @@ -0,0 +1,28 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** PlaneCreator.hpp +*/ + +#ifndef MIRRORMATERIALCREATOR_HPP_ + #define MIRRORMATERIALCREATOR_HPP_ + + #include + #include + #include "IMaterialCreator.hpp" + #include "ILogger.hpp" + #include "MirrorMaterial.hpp" + +namespace RayTracer::PluginsExt::Mirror { + class MirrorCreator : public RayTracer::Plugins::Materials::IMaterialCreator { + public: + ~MirrorCreator(); + RayTracer::Entities::IMaterial *create(const Scenes::ISetting &config, ILogger &logger) final; + protected: + private: + std::vector _elements; + }; +} + +#endif /*PLANECREATOR_HPP_*/ diff --git a/PluginsExt/MirrorMaterial/MirrorMaterial.cpp b/PluginsExt/MirrorMaterial/MirrorMaterial.cpp new file mode 100644 index 000000000..98dccc66b --- /dev/null +++ b/PluginsExt/MirrorMaterial/MirrorMaterial.cpp @@ -0,0 +1,117 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** PlainMaterial.cpp +*/ + +#include +#include +#include +#include "MirrorMaterial.hpp" +#include "Color.hpp" +#include "ISetting.hpp" +#include "Ray.hpp" +#include "ILight.hpp" +#include "IPrimitive.hpp" +#include "Vector3f.hpp" +#include "PixelThread.hpp" + +namespace RayTracer::PluginsExt::Mirror { + MirrorMaterial::MirrorMaterial(const Scenes::ISetting &config): + _shininess(static_cast(*config.get("shininess"))), + _ambient(Entities::Transform::Vector3f(*config.get("ambient"))), + _diffuse(Entities::Transform::Vector3f(*config.get("diffuse"))), + _specular(Entities::Transform::Vector3f(*config.get("specular"))), + _transparency(*config.get("transparency")), + _color(Images::Color(*config.get("color"))) + { } + + double MirrorMaterial::randomDouble(double min, double max) const { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_real_distribution<> dis(min, max); + return dis(gen); + } + + Images::Color MirrorMaterial::getNextColor(const Images::Ray &ray, const Entities::Transform::ITransform ¢erObj, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const { + Images::Color final(0, 0, 0, 255); + std::vector> list; + list.push_back(final); + Entities::Transform::Vector3f center = centerObj.getPosition() + Entities::Transform::Vector3f(randomDouble(-0.01, 0.01), randomDouble(-0.01, 0.01), randomDouble(-0.01, 0.01)); + Entities::Transform::Vector3f normal = (intersect - center).getNormalized(); + Entities::Transform::Vector3f spawn = intersect + normal; + Images::Ray newRay(intersect, spawn); + Images::PixelThread pixelThread(displayable, list, newRay); + + pixelThread(); + return final; + } + + Images::Color MirrorMaterial::getColor(const Images::Ray &ray, const Entities::Transform::ITransform ¢erObj, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const + { + Entities::Transform::Vector3f normal = (intersect - centerObj.getPosition()).getNormalized(); + size_t size = displayable.getLightList().size(); + Images::Color color(0, 0, 0, 255); + Images::Color final = this->getNextColor(ray, centerObj, intersect, displayable); + Images::Color now = this->_color; + double r = 0; + double g = 0; + double b = 0; + + if (size == 1) + return {0, 0, 0, 0}; + for (const std::reference_wrapper &light : displayable.getLightList()) { + color = light.get().getColor(intersect, displayable); + if (light.get().isAmbient()) { + r += color[Images::Color::Types::RED] * light.get().getPower(); + g += color[Images::Color::Types::GREEN] * light.get().getPower(); + b += color[Images::Color::Types::BLUE] * light.get().getPower(); + continue; + } + Entities::Transform::Vector3f lightNormal = (light.get().getTransform().getPosition() - intersect).getNormalized(); + Entities::Transform::Vector3f cameraNormal = ray.getDirection().getNormalized(); + + double dot = 2 * (normal.getX() * lightNormal.getX() + normal.getY() * lightNormal.getY() + normal.getZ() * lightNormal.getZ()); + Entities::Transform::Vector3f reflexionNormal = Entities::Transform::Vector3f( + lightNormal.getX() - dot * normal.getX(), + lightNormal.getY() - dot * normal.getY(), + lightNormal.getZ() - dot * normal.getZ()).getNormalized(); + + double ar = _ambient.getX() * color[Images::Color::Types::RED]; + double ag = _ambient.getY() * color[Images::Color::Types::GREEN]; + double ab = _ambient.getZ() * color[Images::Color::Types::BLUE]; + + dot = normal.getX() * lightNormal.getX() + normal.getY() * lightNormal.getY() + normal.getZ() * lightNormal.getZ(); + double dr = _diffuse.getX() * color[Images::Color::Types::RED] * dot; + double dg = _diffuse.getY() * color[Images::Color::Types::GREEN] * dot; + double db = _diffuse.getZ() * color[Images::Color::Types::BLUE] * dot; + + dot = reflexionNormal.getX() * cameraNormal.getX() + reflexionNormal.getY() * cameraNormal.getY() + reflexionNormal.getZ() * cameraNormal.getZ(); + double sr = _specular.getX() * color[Images::Color::Types::RED] * pow(dot, _shininess); + double sg = _specular.getY() * color[Images::Color::Types::GREEN] * pow(dot, _shininess); + double sb = _specular.getZ() * color[Images::Color::Types::BLUE] * pow(dot, _shininess); + + r += (ar + dr + sr) * light.get().getPower(); + g += (ag + dg + sg) * light.get().getPower(); + b += (ab + db + sb) * light.get().getPower(); + } + r /= size; + g /= size; + b /= size; + color = Images::Color(r, g, b, this->_transparency); + now.applyAlpha(final); + color.applyAlpha(now); + return color; + } + + void MirrorMaterial::setColor(const Images::Color &color) + { + _color = color; + } + + Images::Color MirrorMaterial::redirectionLight(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const { + return this->_color; + } +} diff --git a/PluginsExt/MirrorMaterial/MirrorMaterial.hpp b/PluginsExt/MirrorMaterial/MirrorMaterial.hpp new file mode 100644 index 000000000..17dd96800 --- /dev/null +++ b/PluginsExt/MirrorMaterial/MirrorMaterial.hpp @@ -0,0 +1,40 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** PlainMaterial.hpp +*/ + +#ifndef MIRRORMATERIAL_HPP_ + #define MIRRORMATERIAL_HPP_ + + #include "ISetting.hpp" + #include "Ray.hpp" + #include "Color.hpp" + #include "ITransform.hpp" + #include "Vector3f.hpp" + #include "IMaterial.hpp" + +namespace RayTracer::PluginsExt::Mirror { + class MirrorMaterial : public Entities::IMaterial { + public: + MirrorMaterial(const Scenes::ISetting &config); + + Images::Color getColor(const Images::Ray &ray, const Entities::Transform::ITransform ¢erObj, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const final; + void setColor(const Images::Color &color) final; + Images::Color redirectionLight(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const final; + + private: + double randomDouble(double min, double max) const; + Images::Color getNextColor(const Images::Ray &ray, const Entities::Transform::ITransform ¢erObj, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const; + Images::Color _color; + Entities::Transform::Vector3f _ambient; + Entities::Transform::Vector3f _diffuse; + Entities::Transform::Vector3f _specular; + double _shininess; + double _transparency; + }; +} + +#endif diff --git a/PluginsExt/Obj/CMakeLists.txt b/PluginsExt/Obj/CMakeLists.txt new file mode 100644 index 000000000..c34c26cdd --- /dev/null +++ b/PluginsExt/Obj/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.13) + +target_sources(Obj PRIVATE + ObjEntity.cpp + ObjCreator.cpp + EntryPoint.cpp +) diff --git a/PluginsExt/Obj/EntryPoint.cpp b/PluginsExt/Obj/EntryPoint.cpp new file mode 100644 index 000000000..0f7bf1373 --- /dev/null +++ b/PluginsExt/Obj/EntryPoint.cpp @@ -0,0 +1,22 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** EntryPoint.cpp +*/ + +#include "Api.hpp" +#include "ObjEntity.hpp" +#include "ObjCreator.hpp" + +extern "C" { +void *getCreator(void) +{ + return new RayTracer::PluginsExt::Obj::ObjCreator(); +} + +void deleteCreator(void *creator) +{ + delete static_cast(creator); +} +} diff --git a/PluginsExt/Obj/ObjCreator.cpp b/PluginsExt/Obj/ObjCreator.cpp new file mode 100644 index 000000000..da9de4e06 --- /dev/null +++ b/PluginsExt/Obj/ObjCreator.cpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** ObjCreator.cpp +*/ + +#include "ObjCreator.hpp" +#include "ILogger.hpp" +#include "ObjEntity.hpp" + +namespace RayTracer::PluginsExt::Obj { + ObjCreator::~ObjCreator() { + for (ObjEntity *element : this->_elements) + delete element; + } + + RayTracer::Entities::IEntity *ObjCreator::create(const Scenes::ISetting &config, ILogger &logger) { + ObjEntity *element = new ObjEntity(config, logger); + this->_elements.push_back(element); + return element; + } +} diff --git a/PluginsExt/Obj/ObjCreator.hpp b/PluginsExt/Obj/ObjCreator.hpp new file mode 100644 index 000000000..4cbc7163e --- /dev/null +++ b/PluginsExt/Obj/ObjCreator.hpp @@ -0,0 +1,26 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** ObjCreator.hpp +*/ + +#ifndef OBJCREATOR_HPP_ + #define OBJCREATOR_HPP_ + #include + #include + #include "IEntityCreator.hpp" + #include "ILogger.hpp" + #include "ObjEntity.hpp" + +namespace RayTracer::PluginsExt::Obj { + class ObjCreator : public RayTracer::Plugins::Entities::IEntityCreator { + public: + ~ObjCreator(); + RayTracer::Entities::IEntity *create(const Scenes::ISetting &config, ILogger &logger) final; + protected: + private: + std::vector _elements; + }; +} +#endif /*OBJCREATOR_HPP_*/ diff --git a/PluginsExt/Obj/ObjEntity.cpp b/PluginsExt/Obj/ObjEntity.cpp new file mode 100644 index 000000000..1848d86e9 --- /dev/null +++ b/PluginsExt/Obj/ObjEntity.cpp @@ -0,0 +1,229 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** ObjEntity.cpp +*/ + +#include "ILogger.hpp" +#include "ObjEntity.hpp" +#include "IMaterialFactory.hpp" +#include "Vector2i.hpp" + +namespace RayTracer::PluginsExt::Obj { + + ObjEntity::Face::Face(std::string &faceString) { + std::istringstream lineStream(faceString); + int value = 0; + + int nb_spaces = 0; + for (int i = 0; lineStream.str()[i]; i++) + nb_spaces += lineStream.str()[i] == ' ' ? 1 : 0; + lineStream.ignore(); + for (int i = 0; i < nb_spaces; i++) { + std::string facePart; + lineStream >> facePart; + std::istringstream faceStringStream(facePart); + faceStringStream >> value; + _points.push_back(value); + faceStringStream.ignore(); + faceStringStream >> value; + _textures.push_back(value); + faceStringStream.ignore(); + faceStringStream >> value; + _normals.push_back(value); + _size++; + } + } + + ObjEntity::Face::Face(int firstPoint, int secondPoint, int thirdPoint, int firstNormal, int secondNormal, + int thirdNormal) { + _points.push_back(firstPoint); + _points.push_back(secondPoint); + _points.push_back(thirdPoint); + _normals.push_back(firstNormal); + _normals.push_back(secondNormal); + _normals.push_back(thirdNormal); + _size = 3; + } + + const std::vector &ObjEntity::Face::getNormalsIndexes() const { + return _normals; + } + + const std::vector &ObjEntity::Face::getPointsIndexes() const { + return _points; + } + + ObjEntity::ObjEntity(const Scenes::ISetting &config, ILogger &logger): + _transform(Entities::Transform::Transform(*config.get("transform"))), + _logger(logger) + { + std::unique_ptr settingWrapper = config.get("material"); + + std::string nameMaterial = static_cast(*settingWrapper->get("type")); + _material = static_cast(getMaterialFactoryInstance()->get(nameMaterial, *settingWrapper, _logger)); + + std::string filePath = static_cast(*config.get("filePath")); + std::ifstream file(filePath); + + if (!file.good()) + return; + std::string line; + double x, y, z; + while (std::getline(file, line)) { + std::istringstream lineStream(line); + std::string prefix; + + lineStream >> prefix; + if (prefix == "v") { + lineStream >> x >> y >> z; + _pointList.emplace_back(x, y, z); + } else if (prefix == "vn") { + lineStream >> x >> y >> z; + _normalList.emplace_back(x, y, z); + } else if (prefix == "f") { + _faceList.emplace_back(line); + } + } + for (const auto &face : _faceList) { + triangulatePolygon(face); + } + } + + void ObjEntity::triangulatePolygon(Face face) { + int size = face._size; + std::vector pointIndexes = face.getPointsIndexes(); + std::vector normalIndexes = face.getNormalsIndexes(); + + if (face._size < 3) + return; + if (face._size == 3) { + _triangleList.push_back(face); + return; + } + + int firstNormal = normalIndexes[0]; + int firstPoint = pointIndexes[0]; + for (size_t i = 1; i < size - 1; i++) { + int secondNormal = normalIndexes[i]; + int thirdNormal = normalIndexes[i + 1]; + int secondPoint = pointIndexes[i]; + int thirdPoint = pointIndexes[i + 1]; + + _triangleList.emplace_back(firstPoint, secondPoint, thirdPoint, firstNormal, secondNormal, thirdNormal); + } + } + + Entities::IEntity::Type ObjEntity::getType() const { + return Type::Primitive; + } + + Entities::Transform::ITransform &ObjEntity::getTransform() { + return this->_transform; + } + + const Entities::Transform::ITransform &ObjEntity::getTransform() const { + return this->_transform; + } + + std::optional ObjEntity::isCollided(const Images::Ray &ray) const { + const Entities::Transform::Vector3f &rayOrigin = ray.getOrigin(); + const Entities::Transform::Vector3f &rayDirection = ray.getDirection(); + + for (const auto &triangle : _triangleList) { + std::vector pointIndexes = triangle.getPointsIndexes(); + + Entities::Transform::Vector3f pointOne = _pointList[pointIndexes[0] - 1]; + Entities::Transform::Vector3f pointTwo = _pointList[pointIndexes[1] - 1]; + Entities::Transform::Vector3f pointThree = _pointList[pointIndexes[2] - 1]; + + Entities::Transform::Vector3f edgeOne = pointTwo - pointOne; + Entities::Transform::Vector3f edgeTwo = pointThree - pointOne; + Entities::Transform::Vector3f normal = edgeOne.getCrossed(edgeTwo).getNormalized(); + Entities::Transform::Vector3f pointOneRayOrigin(pointOne.getX() - rayOrigin.getX(), pointOne.getY() - rayOrigin.getY(), pointOne.getZ() - rayOrigin.getZ()); + + double denominator = normal.dot(rayDirection); + if (std::abs(denominator) < std::numeric_limits::epsilon()) + continue; + double numerator = normal.dot(pointOneRayOrigin); + double t = numerator / denominator; + + if (t < 0) + continue; + Entities::Transform::Vector3f point = rayOrigin + rayDirection * Entities::Transform::Vector3f(t, t, t); + + Entities::Transform::Vector3f collisionEdgeOne = pointTwo - pointOne; + Entities::Transform::Vector3f crossedCollisionEdgeOne = collisionEdgeOne.getCrossed(point - pointOne); + if (normal.dot(crossedCollisionEdgeOne) < 0) + continue; + Entities::Transform::Vector3f collisionEdgeTwo = pointThree - pointTwo; + Entities::Transform::Vector3f crossedCollisionEdgeTwo = collisionEdgeTwo.getCrossed(point - pointTwo); + if (normal.dot(crossedCollisionEdgeTwo) < 0) + continue; + Entities::Transform::Vector3f collisionEdgeThree = pointOne - pointThree; + Entities::Transform::Vector3f crossedCollisionEdgeThree = collisionEdgeThree.getCrossed(point - pointThree); + if (normal.dot(crossedCollisionEdgeThree) < 0) + continue; + return point; + } + return std::nullopt; + } + + bool ObjEntity::isCollided(const Entities::Transform::Vector3f &point) const { + return false; + } + + Images::Color ObjEntity::getColor(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const + { + const Entities::Transform::Vector3f &rayOrigin = ray.getOrigin(); + const Entities::Transform::Vector3f &rayDirection = ray.getDirection(); + + for (const auto &triangle : _triangleList) { + std::vector pointIndexes = triangle.getPointsIndexes(); + std::vector normalIndexes = triangle.getNormalsIndexes(); + + Entities::Transform::Vector3f pointOne = _pointList[pointIndexes[0] - 1]; + Entities::Transform::Vector3f pointTwo = _pointList[pointIndexes[1] - 1]; + Entities::Transform::Vector3f pointThree = _pointList[pointIndexes[2] - 1]; + + Entities::Transform::Vector3f edgeOne = pointTwo - pointOne; + Entities::Transform::Vector3f edgeTwo = pointThree - pointOne; + Entities::Transform::Vector3f normal = edgeOne.getCrossed(edgeTwo).getNormalized(); + Entities::Transform::Vector3f pointOneRayOrigin(pointOne.getX() - rayOrigin.getX(), pointOne.getY() - rayOrigin.getY(), pointOne.getZ() - rayOrigin.getZ()); + + double denominator = normal.dot(rayDirection); + if (std::abs(denominator) < std::numeric_limits::epsilon()) + continue; + double numerator = normal.dot(pointOneRayOrigin); + double t = numerator / denominator; + + if (t < 0) + continue; + Entities::Transform::Vector3f point = rayOrigin + rayDirection * Entities::Transform::Vector3f(t, t, t); + + Entities::Transform::Vector3f collisionEdgeOne = pointTwo - pointOne; + Entities::Transform::Vector3f crossedCollisionEdgeOne = collisionEdgeOne.getCrossed(point - pointOne); + if (normal.dot(crossedCollisionEdgeOne) < 0) + continue; + Entities::Transform::Vector3f collisionEdgeTwo = pointThree - pointTwo; + Entities::Transform::Vector3f crossedCollisionEdgeTwo = collisionEdgeTwo.getCrossed(point - pointTwo); + if (normal.dot(crossedCollisionEdgeTwo) < 0) + continue; + Entities::Transform::Vector3f collisionEdgeThree = pointOne - pointThree; + Entities::Transform::Vector3f crossedCollisionEdgeThree = collisionEdgeThree.getCrossed(point - pointThree); + if (normal.dot(crossedCollisionEdgeThree) < 0) + continue; + Entities::Transform::Transform transform = _transform; + transform.setPosition(intersect - normal); + return _material->get().getColor(ray, transform, intersect, displayable); + } + return _material->get().getColor(ray, _transform, intersect, displayable); + } + + Images::Color ObjEntity::redirectionLight(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const { + return _material->get().redirectionLight(ray, displayable, intersect); + } +} diff --git a/PluginsExt/Obj/ObjEntity.hpp b/PluginsExt/Obj/ObjEntity.hpp new file mode 100644 index 000000000..aa55eb9c0 --- /dev/null +++ b/PluginsExt/Obj/ObjEntity.hpp @@ -0,0 +1,57 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** ObjEntity.hpp +*/ +#ifndef OBJENTITY_HPP_ + #define OBJENTITY_HPP_ + #include + #include + #include + #include + #include + #include "ILogger.hpp" + #include "IPrimitive.hpp" + #include "Transform.hpp" + #include "IMaterial.hpp" + +namespace RayTracer::PluginsExt::Obj { + class ObjEntity : public RayTracer::Entities::IPrimitive { + public: + class Face { + public: + Face(std::string &faceString); + Face(int firstPoint, int secondPoint, int thirdPoint, int firstNormal, int secondNormal, int thirdNormal); + ~Face() = default; + const std::vector &getPointsIndexes() const; + const std::vector &getNormalsIndexes() const; + int _size = 0; + private: + std::vector _points; + std::vector _normals; + std::vector _textures; + }; + ObjEntity(const Scenes::ISetting &config, ILogger &logger); + void triangulatePolygon(Face face); + Type getType() const final; + Entities::Transform::ITransform &getTransform() final; + const Entities::Transform::ITransform &getTransform() const final; + bool isCollided(const Entities::Transform::Vector3f &point) const final; + std::optional isCollided(const Images::Ray &ray) const final; + Images::Color getColor(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const final; + Images::Color redirectionLight(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const final; + private: + Entities::Transform::Transform _transform; + std::optional> _material; + std::vector _pointList; + std::vector _normalList; + std::vector _faceList; + std::vector _triangleList; + ILogger &_logger; + }; +} + +#endif /*OBJENTITY_HPP_*/ diff --git a/PluginsExt/RefractionMaterial/CMakeLists.txt b/PluginsExt/RefractionMaterial/CMakeLists.txt new file mode 100644 index 000000000..8512b2abb --- /dev/null +++ b/PluginsExt/RefractionMaterial/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.13) + +target_sources(RefractionMaterial PRIVATE + RefractionMaterial.cpp + RefractionCreator.cpp + EntryPoint.cpp +) diff --git a/PluginsExt/RefractionMaterial/EntryPoint.cpp b/PluginsExt/RefractionMaterial/EntryPoint.cpp new file mode 100644 index 000000000..0bf1c4d6f --- /dev/null +++ b/PluginsExt/RefractionMaterial/EntryPoint.cpp @@ -0,0 +1,22 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** EntryPoint.cpp +*/ + +#include +#include "Api.hpp" +#include "RefractionCreator.hpp" + +extern "C" { + void *getCreator(void) + { + return new RayTracer::PluginsExt::Refraction::RefractionCreator(); + } + + void deleteCreator(void *creator) + { + delete static_cast(creator); + } +} diff --git a/PluginsExt/RefractionMaterial/RefractionCreator.cpp b/PluginsExt/RefractionMaterial/RefractionCreator.cpp new file mode 100644 index 000000000..98b646e47 --- /dev/null +++ b/PluginsExt/RefractionMaterial/RefractionCreator.cpp @@ -0,0 +1,23 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** PlaneCreator.cpp +*/ + +#include "RefractionCreator.hpp" +#include "ILogger.hpp" +#include "RefractionMaterial.hpp" + +namespace RayTracer::PluginsExt::Refraction { + RefractionCreator::~RefractionCreator() { + for (RefractionMaterial *element : this->_elements) + delete element; + } + + RayTracer::Entities::IMaterial *RefractionCreator::create(const Scenes::ISetting &config, ILogger &logger) { + RefractionMaterial *element = new RefractionMaterial(config); + this->_elements.push_back(element); + return element; + } +} diff --git a/PluginsExt/RefractionMaterial/RefractionCreator.hpp b/PluginsExt/RefractionMaterial/RefractionCreator.hpp new file mode 100644 index 000000000..4b68a8c0e --- /dev/null +++ b/PluginsExt/RefractionMaterial/RefractionCreator.hpp @@ -0,0 +1,28 @@ +/* +** EPITECH PROJECT, 2023 +** raytracer +** File description: +** PlaneCreator.hpp +*/ + +#ifndef REFRACTIONMATERIALCREATOR_HPP_ + #define REFRACTIONMATERIALCREATOR_HPP_ + + #include + #include + #include "IMaterialCreator.hpp" + #include "ILogger.hpp" + #include "RefractionMaterial.hpp" + +namespace RayTracer::PluginsExt::Refraction { + class RefractionCreator : public RayTracer::Plugins::Materials::IMaterialCreator { + public: + ~RefractionCreator(); + RayTracer::Entities::IMaterial *create(const Scenes::ISetting &config, ILogger &logger) final; + protected: + private: + std::vector _elements; + }; +} + +#endif /*PLANECREATOR_HPP_*/ diff --git a/PluginsExt/RefractionMaterial/RefractionMaterial.cpp b/PluginsExt/RefractionMaterial/RefractionMaterial.cpp new file mode 100644 index 000000000..68436579f --- /dev/null +++ b/PluginsExt/RefractionMaterial/RefractionMaterial.cpp @@ -0,0 +1,109 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** PlainMaterial.cpp +*/ + +#include +#include +#include "RefractionMaterial.hpp" +#include "Color.hpp" +#include "ISetting.hpp" +#include "Ray.hpp" +#include "ILight.hpp" +#include "IPrimitive.hpp" +#include "Vector3f.hpp" +#include "PixelThread.hpp" + +namespace RayTracer::PluginsExt::Refraction { + RefractionMaterial::RefractionMaterial(const Scenes::ISetting &config): + _shininess(static_cast(*config.get("shininess"))), + _ambient(Entities::Transform::Vector3f(*config.get("ambient"))), + _diffuse(Entities::Transform::Vector3f(*config.get("diffuse"))), + _specular(Entities::Transform::Vector3f(*config.get("specular"))), + _refraction(Entities::Transform::Vector3f(*config.get("refraction"))), + _transparency(*config.get("transparency")), + _color(Images::Color(*config.get("color"))) + { } + + Images::Color RefractionMaterial::getNextColor(const Images::Ray &ray, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const { + Images::Color final(0, 0, 0, 255); + std::vector> list; + list.push_back(final); + Entities::Transform::Vector3f normal = (ray.getDirection().getNormalized()) + _refraction; + Entities::Transform::Vector3f spawn = intersect + normal; + Images::Ray newRay(intersect, spawn); + Images::PixelThread pixelThread(displayable, list, newRay); + + pixelThread(); + return final; + } + + Images::Color RefractionMaterial::getColor(const Images::Ray &ray, const Entities::Transform::ITransform ¢erObj, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const + { + Entities::Transform::Vector3f normal = (intersect - centerObj.getPosition()).getNormalized(); + size_t size = displayable.getLightList().size(); + Images::Color color(0, 0, 0, 255); + Images::Color final = this->getNextColor(ray, intersect, displayable); + Images::Color now = this->_color; + double r = 0; + double g = 0; + double b = 0; + + if (size == 1) + return {0, 0, 0, 0}; + for (const std::reference_wrapper &light : displayable.getLightList()) { + color = light.get().getColor(intersect, displayable); + if (light.get().isAmbient()) { + r += color[Images::Color::Types::RED] * light.get().getPower(); + g += color[Images::Color::Types::GREEN] * light.get().getPower(); + b += color[Images::Color::Types::BLUE] * light.get().getPower(); + continue; + } + Entities::Transform::Vector3f lightNormal = (light.get().getTransform().getPosition() - intersect).getNormalized(); + Entities::Transform::Vector3f cameraNormal = ray.getDirection().getNormalized(); + + double dot = 2 * (normal.getX() * lightNormal.getX() + normal.getY() * lightNormal.getY() + normal.getZ() * lightNormal.getZ()); + Entities::Transform::Vector3f reflexionNormal = Entities::Transform::Vector3f( + lightNormal.getX() - dot * normal.getX(), + lightNormal.getY() - dot * normal.getY(), + lightNormal.getZ() - dot * normal.getZ()).getNormalized(); + + double ar = _ambient.getX() * color[Images::Color::Types::RED]; + double ag = _ambient.getY() * color[Images::Color::Types::GREEN]; + double ab = _ambient.getZ() * color[Images::Color::Types::BLUE]; + + dot = normal.getX() * lightNormal.getX() + normal.getY() * lightNormal.getY() + normal.getZ() * lightNormal.getZ(); + double dr = _diffuse.getX() * color[Images::Color::Types::RED] * dot; + double dg = _diffuse.getY() * color[Images::Color::Types::GREEN] * dot; + double db = _diffuse.getZ() * color[Images::Color::Types::BLUE] * dot; + + dot = reflexionNormal.getX() * cameraNormal.getX() + reflexionNormal.getY() * cameraNormal.getY() + reflexionNormal.getZ() * cameraNormal.getZ(); + double sr = _specular.getX() * color[Images::Color::Types::RED] * pow(dot, _shininess); + double sg = _specular.getY() * color[Images::Color::Types::GREEN] * pow(dot, _shininess); + double sb = _specular.getZ() * color[Images::Color::Types::BLUE] * pow(dot, _shininess); + + r += (ar + dr + sr) * light.get().getPower(); + g += (ag + dg + sg) * light.get().getPower(); + b += (ab + db + sb) * light.get().getPower(); + } + r /= size; + g /= size; + b /= size; + color = Images::Color(r, g, b, this->_transparency); + now.applyAlpha(final); + color.applyAlpha(now); + return color; + } + + void RefractionMaterial::setColor(const Images::Color &color) + { + _color = color; + } + + Images::Color RefractionMaterial::redirectionLight(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const { + return this->_color; + } +} diff --git a/PluginsExt/RefractionMaterial/RefractionMaterial.hpp b/PluginsExt/RefractionMaterial/RefractionMaterial.hpp new file mode 100644 index 000000000..06bc2bd3a --- /dev/null +++ b/PluginsExt/RefractionMaterial/RefractionMaterial.hpp @@ -0,0 +1,40 @@ +/* +** EPITECH PROJECT, 2023 +** Raytracer +** File description: +** PlainMaterial.hpp +*/ + +#ifndef REFRACTIONMATERIAL_HPP_ + #define REFRACTIONMATERIAL_HPP_ + + #include "ISetting.hpp" + #include "Ray.hpp" + #include "Color.hpp" + #include "ITransform.hpp" + #include "Vector3f.hpp" + #include "IMaterial.hpp" + +namespace RayTracer::PluginsExt::Refraction { + class RefractionMaterial : public Entities::IMaterial { + public: + RefractionMaterial(const Scenes::ISetting &config); + + Images::Color getColor(const Images::Ray &ray, const Entities::Transform::ITransform ¢erObj, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const final; + void setColor(const Images::Color &color) final; + Images::Color redirectionLight(const Images::Ray &ray, const Scenes::IDisplayable &displayable, + const Entities::Transform::Vector3f &intersect) const final; + + private: + Images::Color getNextColor(const Images::Ray &ray, const Entities::Transform::Vector3f &intersect, const Scenes::IDisplayable &displayable) const; + Images::Color _color; + Entities::Transform::Vector3f _ambient; + Entities::Transform::Vector3f _diffuse; + Entities::Transform::Vector3f _specular; + Entities::Transform::Vector3f _refraction; + double _shininess; + double _transparency; + }; +} + +#endif diff --git a/PluginsExt/Torus/TorusEntity.cpp b/PluginsExt/Torus/TorusEntity.cpp index eadd28eab..ecf5e451b 100644 --- a/PluginsExt/Torus/TorusEntity.cpp +++ b/PluginsExt/Torus/TorusEntity.cpp @@ -21,9 +21,11 @@ namespace RayTracer::PluginsExt::Torus { std::string nameMaterial = static_cast(*settingWrapper->get("type")); _material = static_cast(getMaterialFactoryInstance()->get(nameMaterial, *settingWrapper, _logger)); - if (_transform.getScale().getX() != 0 || _transform.getScale().getY() != 0 || _transform.getScale().getZ() != 0) { - _logger.warn("PLANE: config: scale x y z must be the 0 (because that's mean nothing to scale an infinite plane)"); + if (_transform.getScale().getZ() != 0) { + _logger.warn("TORUS: config: scale z must be the 0 (remainder: x is for maxRadius, y is for minRadius)"); } + _maxRadius = _transform.getScale().getX() * _maxRadius; + _minRadius = _transform.getScale().getY() * _minRadius; } Entities::IEntity::Type TorusEntity::getType() const { diff --git a/README.md b/README.md index ce3d182b8..54b777709 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ membres du projet: - [@SimonVermeulen](https://github.com/SimonVermeulen) - [@Amaz31](https://github.com/Amaz31) +[Site Doxygen Du Projet](https://saverio976.github.io/Raytracer) +[UML du Projet](https://github.com/Saverio976/Raytracer/blob/gh-pages/uml.svg) + # Introduction L'objectif est de réaliser un [Raytracer](https://fr.wikipedia.org/wiki/Ray_tracing) en [C++](https://fr.wikipedia.org/wiki/C%2B%2B) @@ -17,16 +20,45 @@ L'objectif est de réaliser un [Raytracer](https://fr.wikipedia.org/wiki/Ray_tra # Usage ```bash -USAGE: ./raytracer --scene-path --output-path [--log-level ] -USAGE: ./raytracer --help - -OPTIONS: - --scene-path path to scene config - --output-path path to output file (dont put .ppm or any extension, it is just a base file path) - --help to display the help message - --log-level log level can be {-1: no log, 0: fatal, 1: error, 2: warn, 3: info, 4: debug, 5: trace} [3 by default] - -CREDITS: + ,----, + ,/ .`| +,-.----. ,` .' : +\ / \ ; ; / +; : \ .'___,/ ,' __ ,-. __ ,-. +| | .\ : | : |,' ,'/ /| ,' ,'/ /| +. : |: | ,--.--. .--,; |.'; ;' | |' | ,--.--. ,---. ,---. ' | |' | +| | \ : / \ /_ ./|`----' | || | ,'/ \ / \ / \ | | ,' +| : . / .--. .-. | , ' , ' : ' : ;' : / .--. .-. | / / ' / / |' : / +; | | \ \__\/: . ./___/ \: | | | '| | ' \__\/: . .. ' / . ' / || | ' +| | ;\ \ ," .--.; | . \ ' | ' : |; : | ," .--.; |' ; :__ ' ; /|; : | +: ' | \.'/ / ,. | \ ; : ; |.' | , ; / / ,. |' | '.'|' | / || , ; +: : :-' ; : .' \ \ \ ; '---' ---' ; : .' \ : :| : | ---' +| |.' | , .-./ : \ \ | , .-./\ \ / \ \ / +`---' `--`---' \ ' ; `--`---' `----' `----' + `--` +__USAGE__: + ./raytracer --scene-path --output-path [--log-level ] [--gui] [--font-path ] + ./raytracer --help + +__OPTIONS__: + --scene-path path to scene config + --output-path path to output file (dont put .ppm or any extension, it is just a base file path) + --help to display the help message + --log-level log level can be {-1: no log, 0: fatal, 1: error, 2: warn, 3: info, 4: debug, 5: trace} [3 by default] + --gui to display the images in GUI mode + --font-path path to font file [./Assets/arial.ttf by default] + +__IN WINDOW__: + Z : go forward to exit + Q : go left + S : go backward to exit + D : go right + Space : go up + Left Shift : go down + Left Arrow : go previous camera + Right Arrow : go next camera + +__CREDITS__: Authors: Y A A X Repository: https://github.com/Saverio976/Raytracer ``` @@ -42,6 +74,16 @@ les primitives sont: - [Cone-Limité](#Cone-Limité) - [Cylindre](#Cylindre) - [Cylindre-Limité](#Cylindre-Limité) +- [Torus](#Torus) +- [Triangle](#Triangle) + +les materiaux sont: +- [PlainMaterial](#PlainMaterial) +- [ChessBoardMaterial](#ChessBoardMaterial) +- [ZebraMaterial](#ZebraMaterial) +- [TransparencyMaterial](#TransparencyMaterial) +- [RefractionMaterial](#RefractionMaterial) +- [MirrorMaterial](#MirrorMaterial) les lumières sont: - [PointLight](#PointLight) (mais la documentation est sur toutes les primitives) @@ -801,21 +843,1185 @@ primitives : rotation = {x = 0.0; y = 0.0; z = 1.57}; }; material = { - # Taux de reflet de la lumière + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du disque + color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation de la couche du disque + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + + + +# Cylindre + +![image](/documentation/cylinder1-basic.png) + +
+ afficher ... + +```python +# cylinder.yaax + +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des cylindres + Cylinder = ( + # Cylindre numero 1 + { + transform = { + # Position du cylindre + position = {x = 100.0; y = 0.0; z = -100.0;}; + # X: agrandis/diminus le rayon du cylindre + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (La roation n'est pas supportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + # Rayon du cylindre + radius = 50.0; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # Couleur du cylindre + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation du matériau + type = "PlainMaterial"; + } + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +# Cylindre-Limité + +![image](/documentation/cylinder1-basic-limited.png) + +
+ afficher ... + +```python +# cylinder-limited.yaax + +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des cylindres + LimitedCylinder = ( + # Cylindre numero 1 + { + transform = { + # Position du cylindre + position = {x = 100.0; y = 0.0; z = -100.0;}; + # X: agrandis/diminus le rayon du cylindre + # Y: agrandis/diminus la taille du cylindre + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (La roation n'est pas supportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + # Rayon du cylindre + radius = 50.0; + # Taille du cylindre + height = 60.0; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # Couleur du cylindre + color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation du matériau + type = "PlainMaterial"; + } + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## Torus + +![image](/documentation/torus1-basic.png) + +
+ afficher ... + +```python +# torus.yaax + +# configuration des cameras +cameras: +{ + # camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # l'echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # la rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # distance de la caméra par rapport à l'écran + focal = 200.0; + # nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# les objets de la scene +primitives : +{ + # list of torus + Torus = ( + { + minRadius = 50.0; + maxRadius = 120.0; + transform = { + # position du torus + position = {x = 0.0; y = 30.0; z = 0.0;}; + # x: agrandis/diminus l'angle maxradius + # y: agrandis/diminus l'angle minradius + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (la rotation n'est pas suportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + # utilisation du matériau + type = "PlainMaterial"; + # taux de reflet de la lumière + shininess = 1.0; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + specular = {x = 1.0; y = 1.0; z = 1.0;}; + # couleur du torus + color = {r = 50.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# configuration de la lumière +lights : +{ + # point de lumière (une lampe par example) + PointLight = ( + # première lampe de type pointlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus le rayon de la lampe + # y: agrandis/diminus la puissance de la lampe + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # première lampe de type ambientlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus la puissance de la lampe + # y/z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## Triangle + +![image](/documentation/triangle1-basic.png) + +
+ afficher ... + +```python +# triangle.yaax + +# configuration des cameras +cameras: +{ + # camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # l'echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # la rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # distance de la caméra par rapport à l'écran + focal = 200.0; + # nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxthreads = -1; + # filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# les objets de la scene +primitives : +{ + # list of triangle + Triangle = ( + { + # Premier point du triangle + pointOne = {x = 0.0; y = 100.0; z = 200.0;}; + # Second point du triangle + pointTwo = {x = 40.0; y = 100.0; z = 0.0;}; + # Troisième point du triangle + pointThree = {x = -40.0; y = 100.0; z = 0.0;}; + transform = { + # X/Y/Z: mettre 0.0 + position = {x = 0.0; y = 0.0; z = 20.0;}; + # X/Y/Z: mettre 0.0 + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + # Utilisation du matériau + type = "PlainMaterial"; + # taux de reflet de la lumière + shininess = 1.0; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + specular = {x = 1.0; y = 1.0; z = 1.0;}; + # Couleur du triangle + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# configuration de la lumière +lights : +{ + # point de lumière (une lampe par example) + PointLight = ( + # première lampe de type pointlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus le rayon de la lampe + # y: agrandis/diminus la puissance de la lampe + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # première lampe de type ambientlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus la puissance de la lampe + # y/z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## PlainMaterial + +![image](/documentation/plainmaterial1-basic.png) + +
+ afficher ... + +```python +# plainmaterial.yaax + +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisation de la couche de la sphere + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## ChessBoardMaterial + +![image](/documentation/chessboardmaterial1-basic.png) + +
+ afficher ... + +```python +# chessboardmaterial.yaax + +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "ChessBoardMaterial"; + # taille des cases + size = 10.0; + # Couleur des cases impairs + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Couleur des cases pairs + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## ZebraMaterial + +![image](/documentation/zebramaterial1-basic.png) + +
+ afficher ... + +```python +# zebramaterial.yaax + +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "ZebraMaterial"; + # Taux de reflet de la lumière + shininess = 1.0; + # Taille d'une bande de rayure du zèbre + size = 10.0; + # Couleur impair + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Couleur pair + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## TransparencyMaterial + +![image](/documentation/transparencymaterial1-basic.png) + +
+ afficher ... + +```python +# transpacparencymaterial.yaax + +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "TransparencyMaterial"; + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # pourcentage de transparance + # entre 0 et 255 + # 0: totalement transparent + # 255: totalement opaque + transparency = 150.0; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; +``` + +
+ +## RefractionMaterial + +![image](/documentation/refractionmaterial1-basic.png) + +
+ afficher ... + +```python +# refractionmaterial.yaax + +# Configuration des cameras +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Les objets de la scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 222.0; g = 102.0; b = 97.0; a = 25.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 10.0;}; + type = "PlainMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -30.0; y = 25.0; z = -15.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 100; y = 150;}; + material = { + # Taux d'éblouissement de la lumière + shininess = 1.0; + # Couleur du materiel + color = {r = 50.0; g = 50.0; b = 0.0; a = 50.0;}; + # Type de materiel + type = "RefractionMaterial"; + # Transparence (de 0 à 255) + # 0 = invisible + # 255 = opaque + transparency = 25.0; + # Refraction [x=0.0, y=0.0, z=0.0] correspond à un plan transparent + # Vecteur ajouté à la normal de l'object + refraction = {x = 0.5; y = 0.7; z = -0.2}; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { shininess = 1.0; - # Couleur du disque - color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; - # Utilisation de la couche du disque - type = "PlainMaterial"; - # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est ambiante) ambient = {x = 1.0; y = 1.0; z = 1.0}; - # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) diffuse = {x = 1.0; y = 1.0; z = 1.0}; - # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; }; } - ) + ); }; # Configuration de la lumière @@ -866,241 +2072,197 @@ lights :
-# Cylindre +## MirrorMaterial -![image](/documentation/cylinder1-basic.png) +![image](/documentation/mirrormaterial1-basic.png)
- afficher ... + afficher ... ```python -# cylinder.yaax +# mirrormaterial.yaax -# Configuration des cameras +# Configuration of the camera cameras: { - # Camera par defaut (la plus simple d'utilisation) - Camera: ( + CameraCluster: ( { - # Taille de l'image (de l'écran) (en pixels) - size = {x: 500; y = 500;}; - transform = { - # Position de l'écran + screenSize = {x: 500; y = 500;}; + screen = { position = {x = 0.0; y = 0.0; z = 0.0;}; - # L'Echelle n'est pas suportée scale = {x = 0.0; y = 0.0; z = 0.0;}; - # La rotation n'est pas suportée - rotation = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; }; - # Distance de la caméra par rapport à l'écran - focal = 200.0; - # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) - maxThreads = -1; - # Filtres (étape après la génération de l'image) - filters = {}; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } } ); }; -# Les objets de la scene +# Primitives in the scene primitives : { - # Liste des cylindres - Cylinder = ( - # Cylindre numero 1 + # List of spheres + Sphere = ( { + radius = 100.0; transform = { - # Position du cylindre - position = {x = 100.0; y = 0.0; z = -100.0;}; - # X: agrandis/diminus le rayon du cylindre - # Y/Z: mettre 0.0 + position = {x = -150.0; y = 150.0; z = 50.0;}; scale = {x = 1.0; y = 0.0; z = 0.0;}; - # X/Y/Z: mettre 0.0 (La roation n'est pas supportée) rotation = {x = 0.0; y = 0.0; z = 0.0;}; } - # Rayon du cylindre - radius = 50.0; material = { - # Taux de reflet de la lumière + # Type de material + type = "MirrorMaterial"; shininess = 1.0; - # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + color = {r = 255.0; g = 255.0; b = 255.0; a = 50.0;}; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; ambient = {x = 1.0; y = 1.0; z = 1.0}; - # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) diffuse = {x = 1.0; y = 1.0; z = 1.0}; - # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) specular = {x = 1.0; y = 1.0; z = 1.0}; - # Couleur du cylindre - color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; - # Utilisation du matériau - type = "PlainMaterial"; + }; + }, + { + radius = 25.0; + transform = { + position = {x = 0.0; y = -50.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; } - } - ) -}; - -# Configuration de la lumière -lights : -{ - # Point de lumière (une lampe par example) - PointLight = ( - # Première lampe de type PointLight + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "MirrorMaterial"; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, { + radius = 50.0; transform = { - # Position de la lampe - position = {x = 150.0; y = 0.0; z = 100.0;}; - # X: agrandis/diminus le rayon de la lampe - # Y: agrandis/diminus la puissance de la lampe - # Z: mettre 0.0 + position = {x = 15.0; y = 100.0; z = 50.0;}; scale = {x = 1.0; y = 0.0; z = 0.0;}; - # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; }; - # Couleur de la lampe - color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; - # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) - power = 1.0; - # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) - radius = 500.0; - } - ); - AmbientLight = ( - # Première lampe de type AmbientLight + }, { + radius = 50.0; transform = { - # Position de la lampe - position = {x = 150.0; y = 0.0; z = 100.0;}; - # X: agrandis/diminus la puissance de la lampe - # Y/Z: mettre 0.0 + position = {x = 125.0; y = 100.0; z = 50.0;}; scale = {x = 1.0; y = 0.0; z = 0.0;}; - # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; }; - # Couleur de la lampe - color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; - # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) - power = 1.0; } ); -}; -``` - -
- -# Cylindre-Limité - -![image](/documentation/cylinder1-basic-limited.png) - -
- afficher ... - -```python -# cylinder-limited.yaax - -# Configuration des cameras -cameras: -{ - # Camera par defaut (la plus simple d'utilisation) - Camera: ( + Plane = ( { - # Taille de l'image (de l'écran) (en pixels) - size = {x: 500; y = 500;}; transform = { - # Position de l'écran - position = {x = 0.0; y = 0.0; z = 0.0;}; - # L'Echelle n'est pas suportée + position = {x = 0.0; y = 150.0; z = 0.0;}; scale = {x = 0.0; y = 0.0; z = 0.0;}; - # La rotation n'est pas suportée - rotation = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; }; - # Distance de la caméra par rapport à l'écran - focal = 200.0; - # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) - maxThreads = -1; - # Filtres (étape après la génération de l'image) - filters = {}; - } - ); -}; - -# Les objets de la scene -primitives : -{ - # Liste des cylindres - LimitedCylinder = ( - # Cylindre numero 1 + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, { transform = { - # Position du cylindre - position = {x = 100.0; y = 0.0; z = -100.0;}; - # X: agrandis/diminus le rayon du cylindre - # Y: agrandis/diminus la taille du cylindre - # Z: mettre 0.0 - scale = {x = 1.0; y = 1.0; z = 0.0;}; - # X/Y/Z: mettre 0.0 (La roation n'est pas supportée) - rotation = {x = 0.0; y = 0.0; z = 0.0;}; - } - # Rayon du cylindre - radius = 50.0; - # Taille du cylindre - height = 60.0; + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; material = { - # Taux de reflet de la lumière shininess = 1.0; - # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) ambient = {x = 1.0; y = 1.0; z = 1.0}; - # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) diffuse = {x = 1.0; y = 1.0; z = 1.0}; - # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) specular = {x = 1.0; y = 1.0; z = 1.0}; - # Couleur du cylindre - color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; - # Utilisation du matériau + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; type = "PlainMaterial"; - } + }; } - ) + ); }; -# Configuration de la lumière +# Light configuration lights : { - # Point de lumière (une lampe par example) PointLight = ( - # Première lampe de type PointLight { transform = { - # Position de la lampe position = {x = 150.0; y = 0.0; z = 100.0;}; - # X: agrandis/diminus le rayon de la lampe - # Y: agrandis/diminus la puissance de la lampe - # Z: mettre 0.0 scale = {x = 1.0; y = 1.0; z = 0.0;}; - # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) rotation = {x = 0.0; y = 0.0; z = 0.0;}; }; - # Couleur de la lampe color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; - # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; power = 1.0; - # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) radius = 500.0; } ); AmbientLight = ( - # Première lampe de type AmbientLight { transform = { - # Position de la lampe position = {x = 150.0; y = 0.0; z = 100.0;}; - # X: agrandis/diminus la puissance de la lampe - # Y/Z: mettre 0.0 scale = {x = 1.0; y = 0.0; z = 0.0;}; - # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) rotation = {x = 0.0; y = 0.0; z = 0.0;}; }; - # Couleur de la lampe color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; - # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) power = 1.0; } ); @@ -1457,6 +2619,8 @@ lights: { } ``` +
+ ## SpotLight ![image](/documentation/spotlight1-basic.png) @@ -2203,7 +3367,7 @@ lights: { } ``` -
+
## SSAAx4 diff --git a/Scenes/Scene_01.yaax b/Scenes/Scene_01.yaax new file mode 100644 index 000000000..61d5f7023 --- /dev/null +++ b/Scenes/Scene_01.yaax @@ -0,0 +1,67 @@ +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = -1; + filters: { + }; + } + ); +}; + +# Primitives in the scene +primitives : +{ + Cone = ( + { + angle = 0.5; + transform = { + position = {x = 0.0; y = 100.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 1.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.5;}; + }; + material = { + type = "PlainMaterial"; + shininess = 0.2; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + # List of ambient lights + AmbientLight = ( + { + transform = { + position = {x = 60.0; y = 20.0; z = 50.0;}; + scale = {x = 5.0; y = 0.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); + PointLight = ( + { + transform = { + position = {x = 100.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 255.0; g = 100.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); +}; diff --git a/documentation/chessboardmaterial1-basic.png b/documentation/chessboardmaterial1-basic.png new file mode 100644 index 000000000..598368863 Binary files /dev/null and b/documentation/chessboardmaterial1-basic.png differ diff --git a/documentation/mirrormaterial1-basic.png b/documentation/mirrormaterial1-basic.png new file mode 100644 index 000000000..270cb4df1 Binary files /dev/null and b/documentation/mirrormaterial1-basic.png differ diff --git a/documentation/plainmaterial1-basic.png b/documentation/plainmaterial1-basic.png new file mode 100644 index 000000000..0bfe132c0 Binary files /dev/null and b/documentation/plainmaterial1-basic.png differ diff --git a/documentation/refractionmaterial1-basic.png b/documentation/refractionmaterial1-basic.png new file mode 100644 index 000000000..5fc72df22 Binary files /dev/null and b/documentation/refractionmaterial1-basic.png differ diff --git a/documentation/ssaax4-basic.png b/documentation/ssaax4-basic.png index c7f4c5a35..70506c27e 100644 Binary files a/documentation/ssaax4-basic.png and b/documentation/ssaax4-basic.png differ diff --git a/documentation/torus1-basic.png b/documentation/torus1-basic.png new file mode 100644 index 000000000..ffe083001 Binary files /dev/null and b/documentation/torus1-basic.png differ diff --git a/documentation/transparencymaterial1-basic.png b/documentation/transparencymaterial1-basic.png new file mode 100644 index 000000000..11a8f54e7 Binary files /dev/null and b/documentation/transparencymaterial1-basic.png differ diff --git a/documentation/triangle1-basic.png b/documentation/triangle1-basic.png new file mode 100644 index 000000000..952391757 Binary files /dev/null and b/documentation/triangle1-basic.png differ diff --git a/documentation/zebramaterial1-basic.png b/documentation/zebramaterial1-basic.png new file mode 100644 index 000000000..d8acb794f Binary files /dev/null and b/documentation/zebramaterial1-basic.png differ diff --git a/scenes/documentation/ambientlight.yaax b/scenes/documentation/ambientlight.yaax new file mode 100644 index 000000000..490a84328 --- /dev/null +++ b/scenes/documentation/ambientlight.yaax @@ -0,0 +1,162 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); + # Point de lumière (une lampe par example) + # ####### Atention + # ###### Pour une question de test, la point light à un rayon de 1 (donc elle éclaire rien) + # ###### La scene devient noir si il n'y a qu'une source de lumière + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 1.0; + } + ); +} diff --git a/scenes/documentation/camera-cluster1.yaax b/scenes/documentation/camera-cluster1.yaax new file mode 100644 index 000000000..b67fdb20d --- /dev/null +++ b/scenes/documentation/camera-cluster1.yaax @@ -0,0 +1,182 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + # Taille de l'écran + screenSize = {x: 500; y = 500;}; + screen = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance entre la caméra est l'écran + distanceFromScreen = 200.0; + # le rapport entre 1 rayon -> pixel + # dans le cas présent, 1 rayon = 1 pixel + cluster = 1; + # Nombre maximum de threads utilisé (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = () + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); + SpotLight = ( + { + transform = { + # Position de la lampe + position = {x = -50.0; y = 0.0; z = 0.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: agrandis/diminus l'angle de la lampe + scale = {x = 1.0; y = 1.0; z = 1.0;}; + # vecteur normalisé de direction de la lampe + rotation = {x = 0.0; y = 1.0; z = -0.5;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 5.0; + # Rayon du chants d'actions de la lumière + radius = 500.0; + # Angle de la lampe (comme le cone) + angle = 50.0; + } + ); + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); +} diff --git a/scenes/documentation/camera-cluster2.yaax b/scenes/documentation/camera-cluster2.yaax new file mode 100644 index 000000000..3ecb296de --- /dev/null +++ b/scenes/documentation/camera-cluster2.yaax @@ -0,0 +1,182 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + # Taille de l'écran + screenSize = {x: 500; y = 500;}; + screen = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance entre la caméra est l'écran + distanceFromScreen = 200.0; + # le rapport entre 1 rayon -> pixel + # dans le cas présent, 1 rayon = 4 pixels + cluster = 2; + # Nombre maximum de threads utilisé (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = () + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); + SpotLight = ( + { + transform = { + # Position de la lampe + position = {x = -50.0; y = 0.0; z = 0.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: agrandis/diminus l'angle de la lampe + scale = {x = 1.0; y = 1.0; z = 1.0;}; + # vecteur normalisé de direction de la lampe + rotation = {x = 0.0; y = 1.0; z = -0.5;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 5.0; + # Rayon du chants d'actions de la lumière + radius = 500.0; + # Angle de la lampe (comme le cone) + angle = 50.0; + } + ); + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); +} diff --git a/scenes/documentation/camera-cluster5.yaax b/scenes/documentation/camera-cluster5.yaax new file mode 100644 index 000000000..ab5d8eb0e --- /dev/null +++ b/scenes/documentation/camera-cluster5.yaax @@ -0,0 +1,182 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + # Taille de l'écran + screenSize = {x: 500; y = 500;}; + screen = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance entre la caméra est l'écran + distanceFromScreen = 200.0; + # le rapport entre 1 rayon -> pixel + # dans le cas présent, 1 rayon = 25 pixels + cluster = 5; + # Nombre maximum de threads utilisé (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = () + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); + SpotLight = ( + { + transform = { + # Position de la lampe + position = {x = -50.0; y = 0.0; z = 0.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: agrandis/diminus l'angle de la lampe + scale = {x = 1.0; y = 1.0; z = 1.0;}; + # vecteur normalisé de direction de la lampe + rotation = {x = 0.0; y = 1.0; z = -0.5;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 5.0; + # Rayon du chants d'actions de la lumière + radius = 500.0; + # Angle de la lampe (comme le cone) + angle = 50.0; + } + ); + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); +} diff --git a/scenes/documentation/chessboardmaterial.yaax b/scenes/documentation/chessboardmaterial.yaax new file mode 100644 index 000000000..a06fe17f1 --- /dev/null +++ b/scenes/documentation/chessboardmaterial.yaax @@ -0,0 +1,110 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "ChessBoardMaterial"; + # taille des cases + size = 10.0; + # Couleur des cases impairs + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Couleur des cases pairs + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/cone-limited.yaax b/scenes/documentation/cone-limited.yaax new file mode 100644 index 000000000..e0037be24 --- /dev/null +++ b/scenes/documentation/cone-limited.yaax @@ -0,0 +1,110 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des cones + LimitedCone: ( + # Cone numéro 1 + { + # Angle du cone + angle = 1.0; + # Taille du cone + height = 200.0; + transform = { + # Position du cone + position = {x = 0.0; y = 200.0; z = 0.0;}; + # X: agrandis/diminus l'angle + # Y: agrandis/diminus la taille + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # vecteur qui va vers la direction du cone + # ce cone regardera le ciel + rotation = {x = 0.0; y = 0.0; z = 1.57}; + }; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du disque + color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation de la couche du disque + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/cone.yaax b/scenes/documentation/cone.yaax new file mode 100644 index 000000000..885ff0d0d --- /dev/null +++ b/scenes/documentation/cone.yaax @@ -0,0 +1,107 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des cones + Cone: ( + # Cone numéro 1 + { + # Angle du cone + angle = 1.0; + transform = { + # Position du cone + position = {x = 0.0; y = 200.0; z = 0.0;}; + # X: agrandis/diminus l'angle + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # vecteur qui va vers la direction du cone + # ce cone regardera le ciel + rotation = {x = 0.0; y = 0.0; z = 1.57}; + }; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du disque + color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation de la couche du disque + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/cylinder-limited.yaax b/scenes/documentation/cylinder-limited.yaax new file mode 100644 index 000000000..efd8b2028 --- /dev/null +++ b/scenes/documentation/cylinder-limited.yaax @@ -0,0 +1,109 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des cylindres + LimitedCylinder = ( + # Cylindre numero 1 + { + transform = { + # Position du cylindre + position = {x = 100.0; y = 0.0; z = -100.0;}; + # X: agrandis/diminus le rayon du cylindre + # Y: agrandis/diminus la taille du cylindre + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (La roation n'est pas supportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + # Rayon du cylindre + radius = 50.0; + # Taille du cylindre + height = 60.0; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # Couleur du cylindre + color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation du matériau + type = "PlainMaterial"; + } + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/cylinder.yaax b/scenes/documentation/cylinder.yaax new file mode 100644 index 000000000..6d9aa2499 --- /dev/null +++ b/scenes/documentation/cylinder.yaax @@ -0,0 +1,106 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des cylindres + Cylinder = ( + # Cylindre numero 1 + { + transform = { + # Position du cylindre + position = {x = 100.0; y = 0.0; z = -100.0;}; + # X: agrandis/diminus le rayon du cylindre + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (La roation n'est pas supportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + # Rayon du cylindre + radius = 50.0; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # Couleur du cylindre + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation du matériau + type = "PlainMaterial"; + } + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/disk.yaax b/scenes/documentation/disk.yaax new file mode 100644 index 000000000..33aca395d --- /dev/null +++ b/scenes/documentation/disk.yaax @@ -0,0 +1,136 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des disk + Disk: ( + # Disque numéro 1 + { + # Taille du rayon + radius = 100.0; + transform = { + # Position du disque + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon du disque + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # vecteur normalisé perpendiculaire au disque + # cette config va faire un disque parallelle à la caméra + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + } + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du disque + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Utilisation de la couche du disque + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + } + }, + # Disque numéro 2 + { + # Taille du rayon + radius = 100.0; + transform = { + # Position du disque + position = {x = 15.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon du disque + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # vecteur normalisé perpendiculaire au disque + # cette config va faire un truc que je sais pas expliqué, c.f. l'exemple ci-dessous + rotation = {x = 1.0; y = 0.0; z = 0.0;}; + } + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du disque + color = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation de la couche du disque + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du disque (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + } + } + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/plainmaterial.yaax b/scenes/documentation/plainmaterial.yaax new file mode 100644 index 000000000..9632de670 --- /dev/null +++ b/scenes/documentation/plainmaterial.yaax @@ -0,0 +1,106 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisation de la couche de la sphere + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/plan-limited.yaax b/scenes/documentation/plan-limited.yaax new file mode 100644 index 000000000..1dff4b4aa --- /dev/null +++ b/scenes/documentation/plan-limited.yaax @@ -0,0 +1,138 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des plans limité + LimitedPlane = ( + # Plan numéro 1 + { + transform = { + # Position du plan + position = {x = 0.0; y = 150.0; z = 0.0;}; + # X: agrandis/diminue la taille x + # Y: agrandis/diminue la taille y + # Z: mettre a 0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # vecteur normalisé perpendiculaire au plan + # cette config va faire un plan parallelle à la caméra + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + # Taille du plan + size = {x: 100; y = 200;}; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du plan + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Utilisation de la couche du plan + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + # Plan numéro 2 + { + transform = { + # Position du plan + position = {x = 0.0; y = 10.0; z = -100.0;}; + # X: agrandis/diminue la taille x + # Y: agrandis/diminue la taille y + # Z: mettre a 0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # vecteur normalisé perpendiculaire au plan + # cette config va faire un plan correspondant au sol + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + # Taille du plan + size = {x: 100; y = 100;}; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # Couleur du plan + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation de la couche du plan + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/plan.yaax b/scenes/documentation/plan.yaax new file mode 100644 index 000000000..391cd44c1 --- /dev/null +++ b/scenes/documentation/plan.yaax @@ -0,0 +1,130 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des plans + Plane = ( + # Plan numéro 1 + { + transform = { + # Position du plan + position = {x = 0.0; y = 150.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert d'agrandir un plan infini ?) + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # vecteur normalisé perpendiculaire au plan + # cette config va faire un plan parallelle à la caméra + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur du plan + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Utilisation de la couche du plan + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + # Plan numéro 2 + { + transform = { + # Position du plan + position = {x = 0.0; y = 10.0; z = -100.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert d'agrandir un plan infini ?) + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # vecteur normalisé perpendiculaire au plan + # cette config va faire un plan correspondant au sol + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur du plan (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # Couleur du plan + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Utilisation de la couche du plan + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/pointlight.yaax b/scenes/documentation/pointlight.yaax new file mode 100644 index 000000000..30508f316 --- /dev/null +++ b/scenes/documentation/pointlight.yaax @@ -0,0 +1,162 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + ###### Atention + # ### Pour le test, la puissance est à 0 + # ### Il y est obligé d'avoir 2 lumière sinon la scene devient noire + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 0.0; + } + ); + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); +} diff --git a/scenes/documentation/sphere.yaax b/scenes/documentation/sphere.yaax new file mode 100644 index 000000000..9632de670 --- /dev/null +++ b/scenes/documentation/sphere.yaax @@ -0,0 +1,106 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisation de la couche de la sphere + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/spotlight.yaax b/scenes/documentation/spotlight.yaax new file mode 100644 index 000000000..1066e99ca --- /dev/null +++ b/scenes/documentation/spotlight.yaax @@ -0,0 +1,159 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + SpotLight = ( + { + transform = { + # Position de la lampe + position = {x = -50.0; y = 0.0; z = 0.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: agrandis/diminus l'angle de la lampe + scale = {x = 1.0; y = 1.0; z = 1.0;}; + # vecteur normalisé de direction de la lampe + rotation = {x = 0.0; y = 1.0; z = -0.5;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 5.0; + # Rayon du chants d'actions de la lumière + radius = 500.0; + # Angle de la lampe (comme le cone) + angle = 50.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +} diff --git a/scenes/documentation/ssaax4.yaax b/scenes/documentation/ssaax4.yaax new file mode 100644 index 000000000..467d0cf50 --- /dev/null +++ b/scenes/documentation/ssaax4.yaax @@ -0,0 +1,189 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + # Taille de l'écran + screenSize = {x: 500; y = 500;}; + screen = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: Mettre 0.0 (pas suporté) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance entre la caméra est l'écran + distanceFromScreen = 200.0; + # le rapport entre 1 rayon -> pixel + # dans le cas présent, 1 rayon = 1 pixel + cluster = 1; + # Nombre maximum de threads utilisé (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = { + # Filtre de type SSAAx4 (anti aliasing basique) + SSAAx4: ( + { + maxThreads = -1; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights: { + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); + SpotLight = ( + { + transform = { + # Position de la lampe + position = {x = -50.0; y = 0.0; z = 0.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: agrandis/diminus l'angle de la lampe + scale = {x = 1.0; y = 1.0; z = 1.0;}; + # vecteur normalisé de direction de la lampe + rotation = {x = 0.0; y = 1.0; z = -0.5;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 5.0; + # Rayon du chants d'actions de la lumière + radius = 500.0; + # Angle de la lampe (comme le cone) + angle = 50.0; + } + ); + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); +} diff --git a/scenes/documentation/torus.yaax b/scenes/documentation/torus.yaax new file mode 100644 index 000000000..db0e8c524 --- /dev/null +++ b/scenes/documentation/torus.yaax @@ -0,0 +1,106 @@ +# configuration des cameras +cameras: +{ + # camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # l'echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # la rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # distance de la caméra par rapport à l'écran + focal = 200.0; + # nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# les objets de la scene +primitives : +{ + # list of torus + Torus = ( + { + minRadius = 50.0; + maxRadius = 120.0; + transform = { + # position du torus + position = {x = 0.0; y = 30.0; z = 0.0;}; + # x: agrandis/diminus l'angle maxradius + # y: agrandis/diminus l'angle minradius + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (la rotation n'est pas suportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + # utilisation du matériau + type = "PlainMaterial"; + # taux de reflet de la lumière + shininess = 1.0; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + specular = {x = 1.0; y = 1.0; z = 1.0;}; + # couleur du torus + color = {r = 50.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# configuration de la lumière +lights : +{ + # point de lumière (une lampe par example) + PointLight = ( + # première lampe de type pointlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus le rayon de la lampe + # y: agrandis/diminus la puissance de la lampe + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # première lampe de type ambientlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus la puissance de la lampe + # y/z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/transparencymaterial.yaax b/scenes/documentation/transparencymaterial.yaax new file mode 100644 index 000000000..6607b318f --- /dev/null +++ b/scenes/documentation/transparencymaterial.yaax @@ -0,0 +1,111 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "TransparencyMaterial"; + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # pourcentage de transparance + # entre 0 et 255 + # 0: totalement transparent + # 255: totalement opaque + transparency = 150.0; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/triangle.yaax b/scenes/documentation/triangle.yaax new file mode 100644 index 000000000..8854b84ba --- /dev/null +++ b/scenes/documentation/triangle.yaax @@ -0,0 +1,108 @@ +# configuration des cameras +cameras: +{ + # camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # l'echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # la rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # distance de la caméra par rapport à l'écran + focal = 200.0; + # nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxthreads = -1; + # filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# les objets de la scene +primitives : +{ + # list of triangle + Triangle = ( + { + # Premier point du triangle + pointOne = {x = 0.0; y = 100.0; z = 200.0;}; + # Second point du triangle + pointTwo = {x = 40.0; y = 100.0; z = 0.0;}; + # Troisième point du triangle + pointThree = {x = -40.0; y = 100.0; z = 0.0;}; + transform = { + # X/Y/Z: mettre 0.0 + position = {x = 0.0; y = 0.0; z = 20.0;}; + # X/Y/Z: mettre 0.0 + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + # Utilisation du matériau + type = "PlainMaterial"; + # taux de reflet de la lumière + shininess = 1.0; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + specular = {x = 1.0; y = 1.0; z = 1.0;}; + # Couleur du triangle + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# configuration de la lumière +lights : +{ + # point de lumière (une lampe par example) + PointLight = ( + # première lampe de type pointlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus le rayon de la lampe + # y: agrandis/diminus la puissance de la lampe + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # première lampe de type ambientlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus la puissance de la lampe + # y/z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/documentation/zebramaterial.yaax b/scenes/documentation/zebramaterial.yaax new file mode 100644 index 000000000..e5efb3cd9 --- /dev/null +++ b/scenes/documentation/zebramaterial.yaax @@ -0,0 +1,110 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "ZebraMaterial"; + # Taux de reflet de la lumière + shininess = 1.0; + # Taille d'une bande de rayure du zèbre + size = 10.0; + # Couleur impair + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Couleur pair + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/scenes/generateScreens.sh b/scenes/generateScreens.sh new file mode 100755 index 000000000..d1991f708 --- /dev/null +++ b/scenes/generateScreens.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +mkdir -p scenes + +find scenes -name '*.yaax' -type f -exec ./raytracer --scene-path {} --output-path {} \; + +mkdir -p screenshots +mv ./scenes/*.ppm screenshots diff --git a/scenes/sceneBasic1.yaax b/scenes/sceneBasic1.yaax new file mode 100644 index 000000000..2180ba359 --- /dev/null +++ b/scenes/sceneBasic1.yaax @@ -0,0 +1,136 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 50.0; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 50.0; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneBasic2.yaax b/scenes/sceneBasic2.yaax new file mode 100644 index 000000000..1e69d91f8 --- /dev/null +++ b/scenes/sceneBasic2.yaax @@ -0,0 +1,132 @@ +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = 1000; + filters = () + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + type = "PlainMaterial"; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + } + ); + SpotLight = ( + { + transform = { + position = {x = -50.0; y = 0.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 1.0;}; + rotation = {x = 0.0; y = 1.0; z = -0.5;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 5.0; + radius = 500.0; + angle = 50.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneBasic3.yaax b/scenes/sceneBasic3.yaax new file mode 100644 index 000000000..d48fdb5b5 --- /dev/null +++ b/scenes/sceneBasic3.yaax @@ -0,0 +1,120 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + Torus = ( + { + minRadius = 50.0; + maxRadius = 120.0; + transform = { + position = {x = 0.0; y = 30.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + type = "PlainMaterial"; + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 206.0; g = 123.0; b = 124.0; a = 255.0;}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneBasic4.yaax b/scenes/sceneBasic4.yaax new file mode 100644 index 000000000..a07df5fcf --- /dev/null +++ b/scenes/sceneBasic4.yaax @@ -0,0 +1,187 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + Sphere = ( + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 85.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + type = "PlainMaterial"; + }; + }, + { + radius = 25.0; + transform = { + position = {x = -150.0; y = 25.0; z = 0.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); + Cone = ( + { + transform = { + position = {x = 185.0; y = 80.0; z = 0.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 1.0; y = 0.0; z = 0.0;}; + }; + angle = 10.0; + material = { + shininess = 50.0; + color = {r = 57.0; g = 255.0; b = 20.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -150.0; y = 50.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 200; y = 1000;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 150.0; y = 100.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 200; y = 1000;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -250.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneDamier.yaax b/scenes/sceneDamier.yaax new file mode 100644 index 000000000..800d9bcb5 --- /dev/null +++ b/scenes/sceneDamier.yaax @@ -0,0 +1,170 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + distanceFromScreen = 200.0; + maxThreads = -1; + cluster = 1; + filters = { + SSAAx4: ( + { + maxThreads = -1; + } + ), + BlackAndWhite: ( + { + maxThreads = -1; + method = "R"; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "ZebraMaterial"; + size = 1.0; + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "PlainMaterial"; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); + LimitedCylinder = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + radius = 50.0; + height = 100.0; + material = { + type = "ChessBoardMaterial"; + size = 10.0; + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ) + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + type = "PlainMaterial"; + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + type = "ChessBoardMaterial"; + size = 1.0; + impair = {r = 238.0; g = 61.0; b = 236.0; a = 255.0;}; + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 255.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneLimitedCylinder.yaax b/scenes/sceneLimitedCylinder.yaax new file mode 100644 index 000000000..fac0eb049 --- /dev/null +++ b/scenes/sceneLimitedCylinder.yaax @@ -0,0 +1,120 @@ +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = -1; + filters = { + SSAAx4: ( + { + maxThreads = -1; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + LimitedCylinder = ( + { + height = 50.0; + radius = 50.0; + transform = { + position = {x = 200.0; y = 100.0; z = 10.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "PlainMaterial"; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + type = "PlainMaterial"; + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + type = "PlainMaterial"; + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 255.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneMirrorMaterial.yaax b/scenes/sceneMirrorMaterial.yaax new file mode 100644 index 000000000..4ba60c0f0 --- /dev/null +++ b/scenes/sceneMirrorMaterial.yaax @@ -0,0 +1,172 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 50.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 25.0; + transform = { + position = {x = 0.0; y = -50.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 125.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneMirrorMaterial2.yaax b/scenes/sceneMirrorMaterial2.yaax new file mode 100644 index 000000000..0e0499e9a --- /dev/null +++ b/scenes/sceneMirrorMaterial2.yaax @@ -0,0 +1,156 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + Sphere = ( + { + radius = 50.0; + transform = { + position = {x = 0.0; y = 50.0; z = 0.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "MirrorMaterial"; + transparency = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -150.0; y = 50.0; z = -25.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 1.0; y = 0.0; z = 0.0;}; + }; + size = {x = 100; y = 100;}; + material = { + shininess = 1.0; + color = {r = 25.0; g = 255.0; b = 14.0; a = 10.0;}; + type = "MirrorMaterial"; + transparency = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 150.0; y = 50.0; z = -25.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = -1.0; y = 0.0; z = 0.0;}; + }; + size = {x = 100; y = 100;}; + material = { + shininess = 1.0; + color = {r = 250.0; g = 25.0; b = 14.0; a = 10.0;}; + type = "MirrorMaterial"; + transparency = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneObj.yaax b/scenes/sceneObj.yaax new file mode 100644 index 000000000..909e78e17 --- /dev/null +++ b/scenes/sceneObj.yaax @@ -0,0 +1,75 @@ +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = -30.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = -1; + filters = { + SSAAx4: ( + { + maxThreads = -1; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of OBJ + Obj = ( + { + filePath = "./tests/obj/monkey.obj"; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 1.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "PlainMaterial"; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 0.0; y = -10.0; z = 0.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 255.0; g = 126.0; b = 255.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneRefractionMaterial.yaax b/scenes/sceneRefractionMaterial.yaax new file mode 100644 index 000000000..854225807 --- /dev/null +++ b/scenes/sceneRefractionMaterial.yaax @@ -0,0 +1,147 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 222.0; g = 102.0; b = 97.0; a = 25.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 10.0;}; + type = "PlainMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -30.0; y = 25.0; z = -15.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 100; y = 150;}; + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 0.0; a = 50.0;}; + type = "RefractionMaterial"; + transparency = 25.0; + refraction = {x = 0.5; y = 0.7; z = -0.2}; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 0.0; y = 0.0; z = 200.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 700.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/scenes/sceneTransparencyMaterial.yaax b/scenes/sceneTransparencyMaterial.yaax new file mode 100644 index 000000000..175685ba6 --- /dev/null +++ b/scenes/sceneTransparencyMaterial.yaax @@ -0,0 +1,137 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 10.0;}; + type = "TransparencyMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f59f536f1..15c71ea49 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,16 +36,20 @@ target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pipeline PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") add_subdirectory(Filters) add_subdirectory(Entities) diff --git a/src/Display/Modules/CanvasModule.cpp b/src/Display/Modules/CanvasModule.cpp index b1699f8b7..8aa220204 100644 --- a/src/Display/Modules/CanvasModule.cpp +++ b/src/Display/Modules/CanvasModule.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "CanvasModule.hpp" #include "Parameters.hpp" #include "Transform.hpp" @@ -58,7 +59,13 @@ namespace RayTracer::Display { sprite.setTexture(texture); window.draw(sprite); window.draw(text); - if (_clock.getElapsedTime() > sf::seconds(0.5) && this->_scene.getCameras()[this->_position].get().getCluster() != 1) { + if (_isScreenShot) { + _isScreenShot = false; + Parameters::getInstance().setIfNotExists("screen-shot-path", "./DisplaySfmlScreenshot"); + image.saveToFile(Parameters::getInstance().getString("screen-shot-path") + "_" + _scene.getFileBase() + std::to_string(this->_position) + "_" + std::to_string(_nbPrinted) + ".png"); + _nbPrinted++; + } + if (_clock.getElapsedTime() > sf::seconds(1) && this->_scene.getCameras()[this->_position].get().getCluster() != 1) { this->_scene.getCameras()[this->_position].get().setCluster(1); this->_scene.cancel(); this->_scene.renders(); @@ -66,6 +73,8 @@ namespace RayTracer::Display { } void CanvasModule::start(sf::RenderWindow &window) { + _isScreenShot = false; + _nbPrinted = 0; this->resizeWindow(window); if (!this->_font.loadFromFile(Parameters::getInstance().getString("font-path"))) { throw std::runtime_error("Can't load font"); @@ -92,12 +101,14 @@ namespace RayTracer::Display { {sf::Keyboard::LShift, std::bind(&CanvasModule::goDown, this, std::ref(window), std::ref(event))}, {sf::Keyboard::S, std::bind(&CanvasModule::goBackward, this, std::ref(window), std::ref(event))}, {sf::Keyboard::Z, std::bind(&CanvasModule::goForward, this, std::ref(window), std::ref(event))}, + {sf::Keyboard::P, [this]() { this->_isScreenShot = true; }}, + {sf::Keyboard::R, [this]() { this->resetCluster(); }}, }; if (event.type == sf::Event::KeyPressed) { auto it = keyMap.find(event.key.code); if (it != keyMap.end()) { - if (_clock.getElapsedTime() > sf::seconds(0.5)) { + if (_clock.getElapsedTime() > sf::seconds(1)) { this->_scene.getCameras()[this->_position].get().setCluster(5); } _clock.restart(); @@ -110,6 +121,12 @@ namespace RayTracer::Display { } + void CanvasModule::resetCluster() { + this->_scene.getCameras()[this->_position].get().setCluster(1); + this->_scene.cancel(); + this->_scene.renders(); + } + std::string CanvasModule::getName() const { return "Canvas"; } diff --git a/src/Display/Modules/CanvasModule.hpp b/src/Display/Modules/CanvasModule.hpp index 56370d649..d6c78ed06 100644 --- a/src/Display/Modules/CanvasModule.hpp +++ b/src/Display/Modules/CanvasModule.hpp @@ -9,8 +9,9 @@ #define CANVASMODULE_HPP_ #include -#include -#include + #include + #include + #include #include #include "ICamera.hpp" #include "IDisplayModule.hpp" @@ -44,11 +45,14 @@ namespace RayTracer::Display { void goBackward(sf::RenderWindow &window, const sf::Event &event); void goUp(sf::RenderWindow &window, const sf::Event &event); void goDown(sf::RenderWindow &window, const sf::Event &event); + void resetCluster(); Scenes::Scene &_scene; std::size_t &_position; sf::Font _font; sf::Clock _clock; + bool _isScreenShot; + std::size_t _nbPrinted; }; } diff --git a/src/Entities/CMakeLists.txt b/src/Entities/CMakeLists.txt index 54745071c..2e0ad9217 100644 --- a/src/Entities/CMakeLists.txt +++ b/src/Entities/CMakeLists.txt @@ -10,15 +10,18 @@ target_include_directories(Disk PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pixelthread PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/src/Entities/Transform/CMakeLists.txt b/src/Entities/Transform/CMakeLists.txt index 553f3fcf4..2dd981ed8 100644 --- a/src/Entities/Transform/CMakeLists.txt +++ b/src/Entities/Transform/CMakeLists.txt @@ -15,17 +15,21 @@ target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_ray PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_image PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pipeline PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pixelthread PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(ray_transform PRIVATE Transform.cpp @@ -63,18 +67,26 @@ target_sources(Cylinder PRIVATE $) target_sources(Torus PRIVATE $) +target_sources(Obj PRIVATE $) + target_sources(PlainMaterial PRIVATE $) +target_sources(RefractionMaterial PRIVATE $) + target_sources(TransparencyMaterial PRIVATE $) target_sources(ChessBoardMaterial PRIVATE $) target_sources(ZebraMaterial PRIVATE $) +target_sources(MirrorMaterial PRIVATE $) + target_sources(LimitedCylinder PRIVATE $) target_sources(SSAAx4 PRIVATE $) +target_sources(BlackAndWhite PRIVATE $) + target_sources(CameraCustom PRIVATE $) target_sources(CameraCluster PRIVATE $) diff --git a/src/Factories/CMakeLists.txt b/src/Factories/CMakeLists.txt index 474a40cef..6cdd76ebe 100644 --- a/src/Factories/CMakeLists.txt +++ b/src/Factories/CMakeLists.txt @@ -9,18 +9,22 @@ target_include_directories(LimitedPlane PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Disk PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(raytracer PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/EntityFactory.cpp" diff --git a/src/Filters/CMakeLists.txt b/src/Filters/CMakeLists.txt index a1fd90d52..ec009707b 100644 --- a/src/Filters/CMakeLists.txt +++ b/src/Filters/CMakeLists.txt @@ -7,6 +7,7 @@ target_include_directories(Sphere PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Plane PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedPlane PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Disk PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") @@ -15,12 +16,15 @@ target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pipeline PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(raytracer PRIVATE # sources of current directory diff --git a/src/Images/CMakeLists.txt b/src/Images/CMakeLists.txt index ed0163c00..24391f835 100644 --- a/src/Images/CMakeLists.txt +++ b/src/Images/CMakeLists.txt @@ -15,15 +15,19 @@ target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pipeline PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pixelthread PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(ray_image_color PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/Color.cpp" @@ -115,6 +119,11 @@ target_sources(Torus PRIVATE $ ) +target_sources(Obj PRIVATE + $ + $ +) + target_sources(Triangle PRIVATE $ $ @@ -140,6 +149,17 @@ target_sources(TransparencyMaterial PRIVATE $ $ ) +target_sources(RefractionMaterial PRIVATE + $ + $ + $ +) + +target_sources(MirrorMaterial PRIVATE + $ + $ + $ +) target_sources(ChessBoardMaterial PRIVATE $ @@ -165,3 +185,8 @@ target_sources(SSAAx4 PRIVATE $ $ ) + +target_sources(BlackAndWhite PRIVATE + $ + $ +) diff --git a/src/Images/ImagePipeLine.cpp b/src/Images/ImagePipeLine.cpp index b517d60b6..f562810bb 100644 --- a/src/Images/ImagePipeLine.cpp +++ b/src/Images/ImagePipeLine.cpp @@ -77,6 +77,9 @@ namespace RayTracer::Images { } void ImagePipeLine::apply(Filters::IFilter &filter) { + if (this->_state.getState() == RayTracer::Scenes::ISceneState::States::CANCELLED) { + return; + } filter.apply(this->_image); } } diff --git a/src/Logger.cpp b/src/Logger.cpp index 1c7ec965c..d00f87c2d 100644 --- a/src/Logger.cpp +++ b/src/Logger.cpp @@ -7,6 +7,8 @@ #include #include +#include +#include #include "Logger.hpp" #include "Parameters.hpp" @@ -94,6 +96,15 @@ namespace RayTracer { void Logger::print(int levelT, const std::string &level, const std::string &message) { + static std::map colors = { + {0, "\033[31m"}, + {1, "\033[33m"}, + {2, "\033[34m"}, + {3, "\033[32m"}, + {4, "\033[38m"}, + {5, "\033[30m"}, + {6, "\033[0m"}, + }; std::time_t rawtime; struct tm *timeinfo; std::string time; @@ -105,7 +116,7 @@ namespace RayTracer { time = std::asctime(timeinfo); time.erase(time.find_last_of("\n")); mes = time + " [" + level + "] " + message; - std::cerr << mes << std::endl; + std::cerr << colors[levelT] << mes << colors[6] << std::endl; if (it != _callbacks.end()) { for (auto it1 = it->second.begin(); it1 != it->second.end(); ++it1) { it1->second(mes); diff --git a/src/Main.cpp b/src/Main.cpp index bfce67d4f..944e55c43 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "ILogger.hpp" #include "ISetting.hpp" #include "Logger.hpp" @@ -19,6 +20,7 @@ #include "SceneLoader.hpp" #include "Parameters.hpp" #include "Display.hpp" +#include "SceneState.hpp" namespace RayTracer { static const std::vector mainHelpHeader = { @@ -40,6 +42,38 @@ namespace RayTracer { " `--` " }; + // ----------------------------------------------------------------------- + // Main::MainError + // ----------------------------------------------------------------------- + + Main::MainError::MainError(const std::string &message): + _message(message) + { + } + + const char *Main::MainError::what() const noexcept + { + return _message.c_str(); + } + + // ----------------------------------------------------------------------- + // Main::ArgumentError + // ----------------------------------------------------------------------- + + Main::ArgumentError::ArgumentError(const std::string &message): + _message(message) + { + } + + const char *Main::ArgumentError::what() const noexcept + { + return _message.c_str(); + } + + // ----------------------------------------------------------------------- + // Main + // ----------------------------------------------------------------------- + Main::Main(ILogger &logger): _logger(logger), _scene(logger) @@ -88,7 +122,8 @@ namespace RayTracer { void Main::run() { Scenes::SceneLoader loader(_sceneConfFilePath, _logger); - bool isGui = Parameters::getInstance().getString("display-mode") == "gui"; // TODO: Faire le mode displayMode + bool isGui = Parameters::getInstance().getString("display-mode") == "gui"; + bool isCtrlC = false; loader.subscribe("onChange", [&](const Scenes::ISetting &setting) { _scene(setting, "onChange"); @@ -109,16 +144,24 @@ namespace RayTracer { Display::Display display(this->_logger, this->_scene, loader); display.start(); } else { + std::signal(SIGINT, catch_sigint); while (!_scene.isReady()) { - std::this_thread::sleep_for(std::chrono::seconds(5)); - try { - loader.update(); - } catch (const std::exception &e) { - std::string message = e.what(); - _logger.warn(message + ": Waiting 5 more seconds (unlimited times)"); + std::this_thread::sleep_for(std::chrono::seconds(1)); + if (isCtrlC) { + continue; + } + try { + Parameters::getInstance().getInt("signal"); + this->_scene.cancel(); + isCtrlC = true; + } catch (const Parameters::KeyNotFoundError &e) {} + try { + loader.update(); + } catch (const std::exception &e) { + _logger.warn(std::string(e.what()) + ": Waiting 5 more seconds (unlimited times)"); + } } } - } } void Main::exportScene(const std::string &baseFilePath) @@ -126,6 +169,9 @@ namespace RayTracer { int i = 0; std::vector> futures; + if (_scene.getState().getState() == Scenes::SceneState::States::CANCELLED) { + return; + } for (const auto &camera : _scene.getCameras()) { futures.push_back(std::async(std::launch::async, [camera, baseFilePath, i, this]() { _logger.info("Exporting camera index " + std::to_string(i) + "..."); @@ -172,6 +218,8 @@ namespace RayTracer { std::cout << "\tLeft Shift : go down" << std::endl; std::cout << "\tLeft Arrow : go previous camera" << std::endl; std::cout << "\tRight Arrow : go next camera" << std::endl; + std::cout << "\tR : set cluster to 1" << std::endl; + std::cout << "\tP : take a screenshot to current screen" << std::endl; std::cout << std::endl; std::cout << "__CREDITS__:" << std::endl; std::cout << "\tAuthors: Y A A X" << std::endl; @@ -192,36 +240,19 @@ namespace RayTracer { return 0; } run(); + if (this->_scene.getState().getState() == Scenes::SceneState::States::CANCELLED) { + throw MainError("Cancelled.."); + } exportScene(_baseFilePath); return 0; } +} - // ----------------------------------------------------------------------- - // Main::MainError - // ----------------------------------------------------------------------- - - Main::MainError::MainError(const std::string &message): - _message(message) - { - } - - const char *Main::MainError::what() const noexcept - { - return _message.c_str(); - } - - // ----------------------------------------------------------------------- - // Main::ArgumentError - // ----------------------------------------------------------------------- - - Main::ArgumentError::ArgumentError(const std::string &message): - _message(message) - { - } - - const char *Main::ArgumentError::what() const noexcept +extern "C" { + void catch_sigint(int sig) { - return _message.c_str(); + RayTracer::Parameters::getInstance().set("signal", sig); + std::signal(SIGINT, SIG_DFL); } } diff --git a/src/Main.hpp b/src/Main.hpp index d208e97c8..daf11c1cc 100644 --- a/src/Main.hpp +++ b/src/Main.hpp @@ -15,6 +15,10 @@ #include "Parameters.hpp" #include "Scene.hpp" +extern "C" { + void catch_sigint(int sig); +} + namespace RayTracer { class Main { public: diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt index 946a554fe..c647d8346 100644 --- a/src/Plugins/CMakeLists.txt +++ b/src/Plugins/CMakeLists.txt @@ -14,14 +14,18 @@ target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(raytracer PRIVATE # sources of current directory diff --git a/src/Plugins/Entities/CMakeLists.txt b/src/Plugins/Entities/CMakeLists.txt index 6abad8533..c32fd96ce 100644 --- a/src/Plugins/Entities/CMakeLists.txt +++ b/src/Plugins/Entities/CMakeLists.txt @@ -12,6 +12,7 @@ target_include_directories(Cone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCone PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/src/Plugins/Filters/CMakeLists.txt b/src/Plugins/Filters/CMakeLists.txt index bac9c303c..021fbacc0 100644 --- a/src/Plugins/Filters/CMakeLists.txt +++ b/src/Plugins/Filters/CMakeLists.txt @@ -13,10 +13,12 @@ target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(raytracer PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/FilterLoader.cpp" diff --git a/src/Plugins/Materials/CMakeLists.txt b/src/Plugins/Materials/CMakeLists.txt index 8cb3fdd5c..337c2a781 100644 --- a/src/Plugins/Materials/CMakeLists.txt +++ b/src/Plugins/Materials/CMakeLists.txt @@ -13,11 +13,14 @@ target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedPlane PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_sources(raytracer PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/MaterialLoader.cpp" diff --git a/src/Scenes/CMakeLists.txt b/src/Scenes/CMakeLists.txt index 84864cd14..1c536116d 100644 --- a/src/Scenes/CMakeLists.txt +++ b/src/Scenes/CMakeLists.txt @@ -13,13 +13,16 @@ target_include_directories(PointLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SpotLight PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Cylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Torus PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(Obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(LimitedCylinder PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(Triangle PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(SSAAx4 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(PlainMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(RefractionMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(TransparencyMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ChessBoardMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ZebraMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(MirrorMaterial PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_transform PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_ray PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_color PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") @@ -28,6 +31,7 @@ target_include_directories(CameraCustom PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(CameraCluster PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pipeline PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") target_include_directories(ray_image_pixelthread PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(BlackAndWhite PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") find_library(LIBCONFIG config++) target_link_libraries(raytracer PRIVATE ${LIBCONFIG}) diff --git a/src/Scenes/ISceneState.hpp b/src/Scenes/ISceneState.hpp index 71651653e..d1cbf42d4 100644 --- a/src/Scenes/ISceneState.hpp +++ b/src/Scenes/ISceneState.hpp @@ -22,7 +22,8 @@ namespace RayTracer::Scenes { */ enum class States { RUNNING, - CANCELLED + CANCELLED, + FINISHED }; /** * @brief Get the state (thread safe) diff --git a/src/Scenes/Scene.cpp b/src/Scenes/Scene.cpp index 8620ecf20..f831a93f4 100644 --- a/src/Scenes/Scene.cpp +++ b/src/Scenes/Scene.cpp @@ -5,11 +5,14 @@ ** Scene.cpp */ +#include +#include #include "ILogger.hpp" #include "ISetting.hpp" +#include "Parameters.hpp" #include "Scene.hpp" +#include "SceneState.hpp" #include -#include namespace RayTracer::Scenes { Scene::Scene(ILogger &logger): @@ -117,4 +120,19 @@ namespace RayTracer::Scenes { std::this_thread::sleep_for(std::chrono::milliseconds(100)); } } + + SceneState &Scene::getState() + { + return this->_state; + } + + const SceneState &Scene::getState() const + { + return this->_state; + } + + const std::string &Scene::getFileBase() const + { + return Parameters::getInstance().getString("output-path"); + } } diff --git a/src/Scenes/Scene.hpp b/src/Scenes/Scene.hpp index c0ca0ec43..8f4cc30a2 100644 --- a/src/Scenes/Scene.hpp +++ b/src/Scenes/Scene.hpp @@ -73,6 +73,24 @@ namespace RayTracer::Scenes { * @brief wait until the end of the renders */ void wait_end(); + /** + * @brief Get the state + * + * @return the state + */ + SceneState &getState(); + /** + * @brief Get the state: + * + * @return the state + */ + const SceneState &getState() const; + /** + * @brief Get the file base + * + * @return the file base + */ + const std::string &getFileBase() const; protected: private: /** diff --git a/src/Scenes/SceneLoader.cpp b/src/Scenes/SceneLoader.cpp index 6f8281559..fda0687b6 100644 --- a/src/Scenes/SceneLoader.cpp +++ b/src/Scenes/SceneLoader.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "Parameters.hpp" #include "SceneLoader.hpp" #include "ILogger.hpp" @@ -35,7 +36,11 @@ namespace RayTracer::Scenes { if (currentTime != _lastWriteTime) { _logger.info("Scene config file changed, reloading..."); auto it = _events.find("onChange"); - _configWrapper->readFile(_filePath); + try { + _configWrapper->readFile(_filePath); + } catch (const std::exception &e) { + _logger.error(e.what()); + } if (it == _events.end()) return; diff --git a/tests/documentation/chessboardmaterial.yaax b/tests/documentation/chessboardmaterial.yaax new file mode 100644 index 000000000..a06fe17f1 --- /dev/null +++ b/tests/documentation/chessboardmaterial.yaax @@ -0,0 +1,110 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "ChessBoardMaterial"; + # taille des cases + size = 10.0; + # Couleur des cases impairs + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Couleur des cases pairs + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + # Taux de reflet de la lumière + shininess = 1.0; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/documentation/mirrormaterial.yaax b/tests/documentation/mirrormaterial.yaax new file mode 100644 index 000000000..9a836ef4f --- /dev/null +++ b/tests/documentation/mirrormaterial.yaax @@ -0,0 +1,185 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Type de material + type = "MirrorMaterial"; + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 50.0;}; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 25.0; + transform = { + position = {x = 0.0; y = -50.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "MirrorMaterial"; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 125.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + # Transparence + # 0: c'est un pure mirroir (pas d'ombre dessus) + # 255: c'est plus trop un mirroir + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/tests/documentation/plainmaterial.yaax b/tests/documentation/plainmaterial.yaax new file mode 100644 index 000000000..9632de670 --- /dev/null +++ b/tests/documentation/plainmaterial.yaax @@ -0,0 +1,106 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisation de la couche de la sphere + type = "PlainMaterial"; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/documentation/refractionmaterial.yaax b/tests/documentation/refractionmaterial.yaax new file mode 100644 index 000000000..cf54e9ce8 --- /dev/null +++ b/tests/documentation/refractionmaterial.yaax @@ -0,0 +1,172 @@ +# Configuration des cameras +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Les objets de la scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 222.0; g = 102.0; b = 97.0; a = 25.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 10.0;}; + type = "PlainMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -30.0; y = 25.0; z = -15.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 100; y = 150;}; + material = { + # Taux d'éblouissement de la lumière + shininess = 1.0; + # Couleur du materiel + color = {r = 50.0; g = 50.0; b = 0.0; a = 50.0;}; + # Type de materiel + type = "RefractionMaterial"; + # Transparence (de 0 à 255) + # 0 = invisible + # 255 = opaque + transparency = 25.0; + # Refraction [x=0.0, y=0.0, z=0.0] correspond à un plan transparent + # Vecteur ajouté à la normal de l'object + refraction = {x = 0.5; y = 0.7; z = -0.2}; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/documentation/torus.yaax b/tests/documentation/torus.yaax new file mode 100644 index 000000000..db0e8c524 --- /dev/null +++ b/tests/documentation/torus.yaax @@ -0,0 +1,106 @@ +# configuration des cameras +cameras: +{ + # camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # l'echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # la rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # distance de la caméra par rapport à l'écran + focal = 200.0; + # nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# les objets de la scene +primitives : +{ + # list of torus + Torus = ( + { + minRadius = 50.0; + maxRadius = 120.0; + transform = { + # position du torus + position = {x = 0.0; y = 30.0; z = 0.0;}; + # x: agrandis/diminus l'angle maxradius + # y: agrandis/diminus l'angle minradius + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (la rotation n'est pas suportée) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + # utilisation du matériau + type = "PlainMaterial"; + # taux de reflet de la lumière + shininess = 1.0; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + specular = {x = 1.0; y = 1.0; z = 1.0;}; + # couleur du torus + color = {r = 50.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# configuration de la lumière +lights : +{ + # point de lumière (une lampe par example) + PointLight = ( + # première lampe de type pointlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus le rayon de la lampe + # y: agrandis/diminus la puissance de la lampe + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # première lampe de type ambientlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus la puissance de la lampe + # y/z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/documentation/transparencymaterial.yaax b/tests/documentation/transparencymaterial.yaax new file mode 100644 index 000000000..6607b318f --- /dev/null +++ b/tests/documentation/transparencymaterial.yaax @@ -0,0 +1,111 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "TransparencyMaterial"; + # Taux de reflet de la lumière + shininess = 1.0; + # Couleur de la sphere + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + # pourcentage de transparance + # entre 0 et 255 + # 0: totalement transparent + # 255: totalement opaque + transparency = 150.0; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/documentation/triangle.yaax b/tests/documentation/triangle.yaax new file mode 100644 index 000000000..8854b84ba --- /dev/null +++ b/tests/documentation/triangle.yaax @@ -0,0 +1,108 @@ +# configuration des cameras +cameras: +{ + # camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # l'echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # la rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # distance de la caméra par rapport à l'écran + focal = 200.0; + # nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxthreads = -1; + # filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# les objets de la scene +primitives : +{ + # list of triangle + Triangle = ( + { + # Premier point du triangle + pointOne = {x = 0.0; y = 100.0; z = 200.0;}; + # Second point du triangle + pointTwo = {x = 40.0; y = 100.0; z = 0.0;}; + # Troisième point du triangle + pointThree = {x = -40.0; y = 100.0; z = 0.0;}; + transform = { + # X/Y/Z: mettre 0.0 + position = {x = 0.0; y = 0.0; z = 20.0;}; + # X/Y/Z: mettre 0.0 + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + material = { + # Utilisation du matériau + type = "PlainMaterial"; + # taux de reflet de la lumière + shininess = 1.0; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + # utilisé pour modifier le taux de reflet/couleur de la sphere (lumière lampe) + specular = {x = 1.0; y = 1.0; z = 1.0;}; + # Couleur du triangle + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + }; + } + ); +}; + +# configuration de la lumière +lights : +{ + # point de lumière (une lampe par example) + PointLight = ( + # première lampe de type pointlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus le rayon de la lampe + # y: agrandis/diminus la puissance de la lampe + # z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # première lampe de type ambientlight + { + transform = { + # position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # x: agrandis/diminus la puissance de la lampe + # y/z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # x/y/z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/documentation/zebramaterial.yaax b/tests/documentation/zebramaterial.yaax new file mode 100644 index 000000000..e5efb3cd9 --- /dev/null +++ b/tests/documentation/zebramaterial.yaax @@ -0,0 +1,110 @@ +# Configuration des cameras +cameras: +{ + # Camera par defaut (la plus simple d'utilisation) + Camera: ( + { + # Taille de l'image (de l'écran) (en pixels) + size = {x: 500; y = 500;}; + transform = { + # Position de l'écran + position = {x = 0.0; y = 0.0; z = 0.0;}; + # L'Echelle n'est pas suportée + scale = {x = 0.0; y = 0.0; z = 0.0;}; + # La rotation n'est pas suportée + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Distance de la caméra par rapport à l'écran + focal = 200.0; + # Nombre de pixel d'éxécution en parallelle (-1 laisse la caméra sélectionner le maximum possible) + maxThreads = -1; + # Filtres (étape après la génération de l'image) + filters = {}; + } + ); +}; + +# Les objets de la scene +primitives : +{ + # Liste des spheres + Sphere = ( + # notre sphere est configuré ici + { + # Taille du rayon + radius = 100.0; + transform = { + # Position de la sphere + position = {x = -150.0; y = 150.0; z = 50.0;}; + # X: agrandis/diminus le rayon de la sphere + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une sphere ?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + # Utilisation de la couche de la sphere + type = "ZebraMaterial"; + # Taux de reflet de la lumière + shininess = 1.0; + # Taille d'une bande de rayure du zèbre + size = 10.0; + # Couleur impair + impair = {r = 255.0; g = 255.0; b = 255.0; a = 255.0;}; + # Couleur pair + pair = {r = 0.0; g = 0.0; b = 0.0; a = 255.0;}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est ambiante) + ambient = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + # Utilisé pour modifier le taux de reflet/couleur de la sphere (quand la lumière est une lampe) + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + ) +}; + +# Configuration de la lumière +lights : +{ + # Point de lumière (une lampe par example) + PointLight = ( + # Première lampe de type PointLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus le rayon de la lampe + # Y: agrandis/diminus la puissance de la lampe + # Z: mettre 0.0 + scale = {x = 1.0; y = 1.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair de tous les cotés?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + # Rayon du chants d'actions de la lumière (au-delà la lumière n'éclair pas) + radius = 500.0; + } + ); + AmbientLight = ( + # Première lampe de type AmbientLight + { + transform = { + # Position de la lampe + position = {x = 150.0; y = 0.0; z = 100.0;}; + # X: agrandis/diminus la puissance de la lampe + # Y/Z: mettre 0.0 + scale = {x = 1.0; y = 0.0; z = 0.0;}; + # X/Y/Z: mettre 0.0 (à quoi ça sert de changer la rotation d'une lampe qui écair partout?) + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + # Couleur de la lampe + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + # Puissance de la lampe (plus il est grand, plus il comptera par rapport aux autres lumières) + power = 1.0; + } + ); +}; diff --git a/tests/obj/cube.obj b/tests/obj/cube.obj new file mode 100644 index 000000000..4d50f7559 --- /dev/null +++ b/tests/obj/cube.obj @@ -0,0 +1,46 @@ +# Blender v2.76 (sub 0) OBJ File: '' +# www.blender.org +mtllib cube.mtl +o Cube +v 100.000000 -100.000000 -100.000000 +v 100.000000 -100.000000 100.000000 +v -100.000000 -100.000000 100.000000 +v -100.000000 -100.000000 -100.000000 +v 100.000000 100.000000 -99.999999 +v 99.999999 100.000000 100.00000100 +v -100.000000 100.000000 100.000000 +v -100.000000 100.000000 -100.000000 +vt 1.000000 0.333333 +vt 1.000000 0.666667 +vt 0.666667 0.666667 +vt 0.666667 0.333333 +vt 0.666667 0.000000 +vt 0.000000 0.333333 +vt 0.000000 0.000000 +vt 0.333333 0.000000 +vt 0.333333 1.000000 +vt 0.000000 1.000000 +vt 0.000000 0.666667 +vt 0.333333 0.333333 +vt 0.333333 0.666667 +vt 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 1.000000 0.000000 +vn 1.000000 0.000000 0.000000 +vn -0.000000 0.000000 1.000000 +vn -1.000000 -0.000000 -0.000000 +vn 0.000000 0.000000 -1.000000 +usemtl Material +s off +f 2/1/1 3/2/1 4/3/1 +f 8/1/2 7/4/2 6/5/2 +f 5/6/3 6/7/3 2/8/3 +f 6/8/4 7/5/4 3/4/4 +f 3/9/5 7/10/5 8/11/5 +f 1/12/6 4/13/6 8/11/6 +f 1/4/1 2/1/1 4/3/1 +f 5/14/2 8/1/2 6/5/2 +f 1/12/3 5/6/3 2/8/3 +f 2/12/4 6/8/4 3/4/4 +f 4/13/5 3/9/5 8/11/5 +f 5/6/6 1/12/6 8/11/6 \ No newline at end of file diff --git a/tests/obj/cube_younes.obj b/tests/obj/cube_younes.obj new file mode 100644 index 000000000..7b9bdb905 --- /dev/null +++ b/tests/obj/cube_younes.obj @@ -0,0 +1,40 @@ +# Blender v3.5.0 OBJ File: '' +# www.blender.org +mtllib untitled.mtl +o Cube +v 3.049409 3.049409 -3.049409 +v 3.049409 -3.049409 -3.049409 +v 3.049409 3.049409 3.049409 +v 3.049409 -3.049409 3.049409 +v -3.049409 3.049409 -3.049409 +v -3.049409 -3.049409 -3.049409 +v -3.049409 3.049409 3.049409 +v -3.049409 -3.049409 3.049409 +vt 0.625000 0.500000 +vt 0.875000 0.500000 +vt 0.875000 0.750000 +vt 0.625000 0.750000 +vt 0.375000 0.750000 +vt 0.625000 1.000000 +vt 0.375000 1.000000 +vt 0.375000 0.000000 +vt 0.625000 0.000000 +vt 0.625000 0.250000 +vt 0.375000 0.250000 +vt 0.125000 0.500000 +vt 0.375000 0.500000 +vt 0.125000 0.750000 +vn 0.0000 1.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 -1.0000 0.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +usemtl Material +s off +f 1/1/1 5/2/1 7/3/1 3/4/1 +f 4/5/2 3/4/2 7/6/2 8/7/2 +f 8/8/3 7/9/3 5/10/3 6/11/3 +f 6/12/4 2/13/4 4/5/4 8/14/4 +f 2/13/5 1/1/5 3/4/5 4/5/5 +f 6/11/6 5/10/6 1/1/6 2/13/6 diff --git a/tests/obj/cube_younes_big.obj b/tests/obj/cube_younes_big.obj new file mode 100644 index 000000000..eeaf34697 --- /dev/null +++ b/tests/obj/cube_younes_big.obj @@ -0,0 +1,39 @@ +# Blender 3.5.0 +# www.blender.org +mtllib untitled.mtl +o Cube +v -156.051407 -156.051407 156.051407 +v -156.051407 156.051407 156.051407 +v -156.051407 -156.051407 -156.051407 +v -156.051407 156.051407 -156.051407 +v 156.051407 -156.051407 156.051407 +v 156.051407 156.051407 156.051407 +v 156.051407 -156.051407 -156.051407 +v 156.051407 156.051407 -156.051407 +vn -0.0000 -1.0000 -0.0000 +vn -0.0000 -0.0000 -1.0000 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 1.0000 -0.0000 +vn -1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 1.0000 +vt 0.625000 0.500000 +vt 0.375000 0.500000 +vt 0.625000 0.750000 +vt 0.375000 0.750000 +vt 0.875000 0.500000 +vt 0.625000 0.250000 +vt 0.125000 0.500000 +vt 0.375000 0.250000 +vt 0.875000 0.750000 +vt 0.625000 1.000000 +vt 0.625000 0.000000 +vt 0.375000 1.000000 +vt 0.375000 0.000000 +vt 0.125000 0.750000 +s 0 +usemtl Material +f 4/4/2 8/12/2 7/10/2 3/3/2 +f 8/13/3 6/8/3 5/6/3 7/11/3 +f 6/7/4 8/14/4 4/4/4 2/2/4 +f 2/2/5 4/4/5 3/3/5 1/1/5 +f 6/8/6 2/2/6 1/1/6 5/6/6 diff --git a/tests/sceneDamier.yaax b/tests/sceneDamier.yaax index faf7b0744..800d9bcb5 100644 --- a/tests/sceneDamier.yaax +++ b/tests/sceneDamier.yaax @@ -17,6 +17,12 @@ cameras: { maxThreads = -1; } + ), + BlackAndWhite: ( + { + maxThreads = -1; + method = "R"; + } ) } } diff --git a/tests/sceneMirrorMaterial.yaax b/tests/sceneMirrorMaterial.yaax new file mode 100644 index 000000000..4ba60c0f0 --- /dev/null +++ b/tests/sceneMirrorMaterial.yaax @@ -0,0 +1,172 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 50.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 25.0; + transform = { + position = {x = 0.0; y = -50.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 125.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 50.0;}; + type = "MirrorMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/tests/sceneMirrorMaterial2.yaax b/tests/sceneMirrorMaterial2.yaax new file mode 100644 index 000000000..0e0499e9a --- /dev/null +++ b/tests/sceneMirrorMaterial2.yaax @@ -0,0 +1,156 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + Sphere = ( + { + radius = 50.0; + transform = { + position = {x = 0.0; y = 50.0; z = 0.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 255.0; a = 25.0;}; + type = "MirrorMaterial"; + transparency = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -150.0; y = 50.0; z = -25.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 1.0; y = 0.0; z = 0.0;}; + }; + size = {x = 100; y = 100;}; + material = { + shininess = 1.0; + color = {r = 25.0; g = 255.0; b = 14.0; a = 10.0;}; + type = "MirrorMaterial"; + transparency = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 150.0; y = 50.0; z = -25.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = -1.0; y = 0.0; z = 0.0;}; + }; + size = {x = 100; y = 100;}; + material = { + shininess = 1.0; + color = {r = 250.0; g = 25.0; b = 14.0; a = 10.0;}; + type = "MirrorMaterial"; + transparency = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 500.0; + }, + { + transform = { + position = {x = -150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 0.0; b = 0.0; a = 255.0;}; + power = 1.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/tests/sceneRefractionMaterial.yaax b/tests/sceneRefractionMaterial.yaax new file mode 100644 index 000000000..854225807 --- /dev/null +++ b/tests/sceneRefractionMaterial.yaax @@ -0,0 +1,147 @@ +# Configuration of the camera +cameras: +{ + CameraCluster: ( + { + screenSize = {x: 500; y = 500;}; + screen = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 90.0; y = 90.0; z = 0.0;}; + }; + maxThreads = 1; + cluster = 1, + distanceFromScreen = 200.0; + filters = { + SSAAx4: ( + { + maxThreads = -1 + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of spheres + Sphere = ( + { + radius = 100.0; + transform = { + position = {x = -150.0; y = 150.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 222.0; g = 102.0; b = 97.0; a = 25.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + radius = 50.0; + transform = { + position = {x = 15.0; y = 100.0; z = 50.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 50.0; a = 10.0;}; + type = "PlainMaterial"; + transparency = 50.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + LimitedPlane = ( + { + transform = { + position = {x = -30.0; y = 25.0; z = -15.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 100; y = 150;}; + material = { + shininess = 1.0; + color = {r = 50.0; g = 50.0; b = 0.0; a = 50.0;}; + type = "RefractionMaterial"; + transparency = 25.0; + refraction = {x = 0.5; y = 0.7; z = -0.2}; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + } + ); + Plane = ( + { + transform = { + position = {x = 0.0; y = 150.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 1.0; z = 0.0;}; + }; + size = {x = 50.0; y = 50.0; z = 0.0;}; + material = { + shininess = 1.0; + color = {r = 255.0; g = 255.0; b = 0.0; a = 255.0;}; + type = "PlainMaterial"; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + }; + }, + { + transform = { + position = {x = 0.0; y = 10.0; z = -100.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 1.0;}; + }; + size = {x = 1000.0; y = 500.0; z = 500.0;}; + material = { + shininess = 1.0; + ambient = {x = 1.0; y = 1.0; z = 1.0}; + diffuse = {x = 1.0; y = 1.0; z = 1.0}; + specular = {x = 1.0; y = 1.0; z = 1.0}; + color = {r = 0.0; g = 255.0; b = 255.0; a = 255.0;}; + type = "PlainMaterial"; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 0.0; y = 0.0; z = 200.0;}; + scale = {x = 1.0; y = 1.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 255.0; g = 126.0; b = 300.0; a = 255.0;}; + power = 3.0; + radius = 700.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +}; diff --git a/tests/testObj.yaax b/tests/testObj.yaax new file mode 100644 index 000000000..909e78e17 --- /dev/null +++ b/tests/testObj.yaax @@ -0,0 +1,75 @@ +# Configuration of the camera +cameras: +{ + Camera: ( + { + size = {x: 500; y = 500;}; + transform = { + position = {x = 0.0; y = -30.0; z = 0.0;}; + scale = {x = 0.0; y = 0.0; z = 0.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + }; + focal = 200.0; + maxThreads = -1; + filters = { + SSAAx4: ( + { + maxThreads = -1; + } + ) + } + } + ); +}; + +# Primitives in the scene +primitives : +{ + # List of OBJ + Obj = ( + { + filePath = "./tests/obj/monkey.obj"; + transform = { + position = {x = 0.0; y = 0.0; z = 0.0;}; + scale = {x = 1.0; y = 1.0; z = 1.0;}; + rotation = {x = 0.0; y = 0.0; z = 0.0;}; + } + material = { + type = "PlainMaterial"; + shininess = 10.0; + ambient = {x = 1.0; y = 1.0; z = 1.0;}; + diffuse = {x = 1.0; y = 1.0; z = 1.0;}; + specular = {x = 1.0; y = 1.0; z = 1.0;}; + color = {r = 68.0; g = 171.0; b = 128.0; a = 255.0;}; + }; + } + ); +}; + +# Light configuration +lights : +{ + PointLight = ( + { + transform = { + position = {x = 0.0; y = -10.0; z = 0.0;}; + scale = {x = 500.0; y = 1.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 255.0; g = 126.0; b = 255.0; a = 255.0;}; + power = 2.0; + radius = 500.0; + } + ); + AmbientLight = ( + { + transform = { + position = {x = 150.0; y = 0.0; z = 100.0;}; + scale = {x = 1.0; y = 0.0; z = 0.0;}; + rotation = {x = 60.0; y = 20.0; z = -10.0;}; + }; + color = {r = 50.0; g = 50.0; b = 50.0; a = 255.0;}; + power = 1.0; + } + ); +};