Skip to content

Commit

Permalink
Merge pull request #196 from ange-yaghi/release/v1.1.0a
Browse files Browse the repository at this point in the history
Release/v1.1.0a
  • Loading branch information
ange-yaghi committed Sep 3, 2019
2 parents e6b7ba5 + 7159923 commit 700e002
Show file tree
Hide file tree
Showing 140 changed files with 1,825 additions and 841 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,9 @@ autogen/

# Ignore temp files added by flex
project/mantaray/~flex*

# Temporary files added by Intel tools
My Advisor Results*/

# Temporary Blender files
*.blend1
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
![Alt text](docs/public/banners/mantaray_banner_v3.png?raw=true)
![Alt text](docs/public/banners/mantaray_banner_v4.png?raw=true)


**MantaRay** is an open-source renderer currently under development. It uses modern rendering techniques to generate photorealistic images of complex scenes.
**MantaRay** is an advanced open-source renderer. It uses modern rendering techniques to generate photorealistic images of complex scenes.

## Getting Started

To get started, consider reading this tutorial: [Getting Started](docs/public/tutorials/1_getting_started/1_getting_started.md).

Tutorials are continuously added here: [Tutorials](docs/public/tutorials/all_tutorials.md)
Tutorials are continually added here: [Tutorials](docs/public/tutorials/all_tutorials.md)

## Setup Instructions For Developers

Expand Down
2 changes: 1 addition & 1 deletion cli/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <iostream>

#define VERSION "v1.0.1a"
#define VERSION "v1.1.0a"

void printHeader() {
std::cout << "////////////////////////////////////////////////" << std::endl;
Expand Down
11 changes: 6 additions & 5 deletions demos/aperture_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ void manta_demo::apertureDemo(int samplesPerPixel, int resolutionX, int resoluti
blocks.setFastIntersectEnabled(false);
blocksObj.destroy();

SpherePrimitive outdoorTopLightGeometry;
outdoorTopLightGeometry.setRadius((math::real)10.0);
outdoorTopLightGeometry.setPosition(math::loadVector(10.f, 20.f, 5.5f));

// Create scene objects
KDTree kdtree;
kdtree.configure((math::real)500.0, math::constants::Zero);
Expand All @@ -66,10 +62,10 @@ void manta_demo::apertureDemo(int samplesPerPixel, int resolutionX, int resoluti
manta::SimpleLens lens;
manta::PolygonalAperture aperture;
aperture.setRadius((math::real)0.25);
aperture.setBladeCurvature(0.25f);
aperture.configure(3, 0.f, false);

lens.setAperture(&aperture);
lens.initialize();
lens.setPosition(cameraPos);
lens.setDirection(dir);
lens.setUp(up);
Expand All @@ -78,6 +74,7 @@ void manta_demo::apertureDemo(int samplesPerPixel, int resolutionX, int resoluti
lens.setSensorResolutionY(resolutionY);
lens.setSensorHeight(10.0f);
lens.setSensorWidth(10.0f * (resolutionX / (math::real)resolutionY));
lens.configure();
lens.update();

RandomSampler sampler;
Expand Down Expand Up @@ -118,6 +115,10 @@ void manta_demo::apertureDemo(int samplesPerPixel, int resolutionX, int resoluti

// Output the results to a scene buffer
ImagePlane sceneBuffer;
GaussianFilter filter;
filter.setExtents(math::Vector2(2.0, 2.0));
filter.configure((math::real)4.0);
sceneBuffer.setFilter(&filter);

// Run the ray tracer
rayTracer.configure(200 * MB, 50 * MB, 12, 100, true);
Expand Down
5 changes: 5 additions & 0 deletions demos/blocks_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void manta_demo::blocksDemo(int samplesPerPixel, int resolutionX, int resolution
lens.setSensorResolutionY(resolutionY);
lens.setSensorHeight(10.0f);
lens.setSensorWidth(10.0f * (resolutionX / (math::real)resolutionY));
lens.configure();
lens.update();

RandomSampler sampler;
Expand Down Expand Up @@ -170,6 +171,10 @@ void manta_demo::blocksDemo(int samplesPerPixel, int resolutionX, int resolution

// Output the results to a scene buffer
ImagePlane sceneBuffer;
GaussianFilter filter;
filter.setExtents(math::Vector2(1.0, 1.0));
filter.configure((math::real)4.0);
sceneBuffer.setFilter(&filter);

// Run the ray tracer
rayTracer.configure(200 * MB, 50 * MB, 12, 100, true);
Expand Down
12 changes: 8 additions & 4 deletions demos/box_city_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ void manta_demo::boxCityDemo(int samplesPerPixel, int resolutionX, int resolutio

// Output the results to a scene buffer
ImagePlane sceneBuffer;
GaussianFilter filter;
filter.setExtents(math::Vector2(1.0, 1.0));
filter.configure((math::real)4.0);
sceneBuffer.setFilter(&filter);

// Initialize and run the ray tracer
rayTracer.configure(200 * MB, 50 * MB, 12, 100, true);
Expand Down Expand Up @@ -242,15 +246,15 @@ void manta_demo::boxCityDemo(int samplesPerPixel, int resolutionX, int resolutio
step.getMainOutput()->setInput(mantaOutput.getMainOutput());
step.evaluate();

MultiplyNode mulNode;
BinaryNode<MUL> mulNode;
mulNode.initialize();
mulNode.getMainOutput()->setInputA(step.getMainOutput());
mulNode.getMainOutput()->setInputB(mantaOutput.getMainOutput());
mulNode.connectInput(step.getMainOutput(), "left", nullptr);
mulNode.connectInput(mantaOutput.getMainOutput(), "right", nullptr);
mulNode.evaluate();

ConvolutionNode convNode;
convNode.initialize();
convNode.setInputs(mulNode.getMainOutput(), fraunNode.getMainOutput());
convNode.setInputs(mulNode.getPrimaryOutput(), fraunNode.getMainOutput());
convNode.setResize(true);
convNode.setClip(true);
convNode.evaluate();
Expand Down
20 changes: 11 additions & 9 deletions demos/complex_room_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol

RayTracer rayTracer;
rayTracer.setMaterialLibrary(new MaterialLibrary);

DielectricMediaInterface glassFresnel;
glassFresnel.setIorIncident(1.0f);
glassFresnel.setIorTransmitted(1.6f);

// Create all materials
LambertianBSDF lambert;
Expand All @@ -51,6 +47,7 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol
SimpleBSDFMaterial *wallMaterial = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
wallMaterial->setName("WallMaterial");
wallMaterial->setBSDF(&wallBSDF);
wallMaterial->setEmission(math::constants::Zero);

// Floor material
PhongDistribution floorCoating;
Expand All @@ -63,6 +60,7 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol
SimpleBSDFMaterial *floorMaterial = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
floorMaterial->setName("FloorMaterial");
floorMaterial->setBSDF(&floorBSDF);
floorMaterial->setEmission(math::constants::Zero);

// Floor material
PhongDistribution carpetCoating;
Expand All @@ -75,6 +73,7 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol
SimpleBSDFMaterial *carpetMaterial = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
carpetMaterial->setName("CarpetMaterial");
carpetMaterial->setBSDF(&carpetBSDF);
carpetMaterial->setEmission(math::constants::Zero);

// Steel material
PhongDistribution tableSteelCoating;
Expand All @@ -87,6 +86,7 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol
SimpleBSDFMaterial *tableSteel = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
tableSteel->setName("TableSteel");
tableSteel->setBSDF(&tableSteelBSDF);
tableSteel->setEmission(math::constants::Zero);

// Table top material
PhongDistribution tableTopCoating;
Expand All @@ -99,6 +99,7 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol
SimpleBSDFMaterial *tableTop = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
tableTop->setName("TableTop");
tableTop->setBSDF(&tableTopBSDF);
tableTop->setEmission(math::constants::Zero);

// Book material
PhongDistribution bookCoating;
Expand All @@ -111,6 +112,7 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol
SimpleBSDFMaterial *book = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
book->setName("Book");
book->setBSDF(&bookBSDF);
book->setEmission(math::constants::Zero);

// Create all scene geometry
Mesh roomGeometry;
Expand Down Expand Up @@ -140,12 +142,8 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol

math::Vector dir = math::normalize(math::sub(target, cameraPos));

LightRay sampleRay;
sampleRay.setDirection(dir);
sampleRay.setSource(cameraPos);

KDTree kdtree;
kdtree.configure(100.0f, math::constants::Zero);
kdtree.configure(1000.0f, math::constants::Zero);
kdtree.analyzeWithProgress(&roomGeometry, 4);

SpherePrimitive outdoorTopLightGeometry;
Expand Down Expand Up @@ -222,6 +220,10 @@ void manta_demo::complexRoomDemo(int samplesPerPixel, int resolutionX, int resol

// Output the results to a scene buffer
ImagePlane sceneBuffer;
GaussianFilter filter;
filter.setExtents(math::Vector2(1.5, 1.5));
filter.configure((math::real)4.0);
sceneBuffer.setFilter(&filter);

if (TRACE_SINGLE_PIXEL) {
rayTracer.tracePixel(616, 1459, &scene, group, &sceneBuffer);
Expand Down
5 changes: 3 additions & 2 deletions demos/demos.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include "../include/microfacet_transmission_bsdf.h"
#include "../include/microfacet_glass_bsdf.h"
#include "../include/material_pointer.h"
#include "../include/power_node.h"
#include "../include/remap_node.h"
#include "../include/square_aperture.h"
#include "../include/polygonal_aperture.h"
Expand All @@ -58,13 +57,15 @@
#include "../include/vector_map_wrapper_node.h"
#include "../include/convolution_node.h"
#include "../include/image_output_node.h"
#include "../include/multiply_node.h"
#include "../include/ramp_node.h"
#include "../include/step_node.h"
#include "../include/material_library.h"
#include "../include/obj_file_node.h"
#include "../include/kd_tree_node.h"
#include "../include/cached_vector_node.h"
#include "../include/binary_node.h"
#include "../include/gaussian_filter.h"
#include "../include/box_filter.h"

namespace manta_demo {

Expand Down
8 changes: 4 additions & 4 deletions demos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ int main() {
createAllDirectories();

// Run a demo
constexpr DEMO demo = DEMO::SDL_DEMO;
constexpr int samples = 10;
constexpr int resolutionX = 1920; // 2048 / 2;
constexpr int resolutionY = 1080; // 1536 / 2;
constexpr DEMO demo = DEMO::SAMSUNG_A8;
constexpr int samples = 100;
constexpr int resolutionX = 1920;
constexpr int resolutionY = 1080;

runDemo(demo, samples, resolutionX, resolutionY);

Expand Down
19 changes: 17 additions & 2 deletions demos/material_visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re
SimpleBSDFMaterial *paintMaterial = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
paintMaterial->setBSDF(&simpleWoodBSDF);
paintMaterial->setName("SimpleDarkWood");
paintMaterial->setEmission(math::constants::Zero);

// Steel
PhongDistribution phongSteel;
Expand All @@ -102,6 +103,7 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re
steelMaterial->setName("Steel");
steelMaterial->setReflectance(getColor(255, 255, 255));
steelMaterial->setBSDF(&steelBSDF);
steelMaterial->setEmission(math::constants::Zero);

// Steel 2
TextureNode fingerprintTexture;
Expand All @@ -114,11 +116,17 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re
metalTexture.initialize();
metalTexture.evaluate();

PowerNode fingerprintPower(4.0f, fingerprintTexture.getMainOutput());
CachedVectorNode constS;
constS.initialize();
constS.setValue(math::loadScalar(4.0f));
PowerNode fingerprintPower;
fingerprintPower.initialize();
fingerprintPower.connectInput(fingerprintTexture.getMainOutput(), "__right", nullptr);
fingerprintPower.connectInput(constS.getPrimaryOutput(), "__left", nullptr);
RemapNode specularPowerFingerprint(
math::loadScalar(0.0f),
math::loadScalar(1.0f),
fingerprintPower.getMainOutput());
fingerprintPower.getPrimaryOutput());

RemapNode invFingerprint(
math::loadScalar(1.0f),
Expand All @@ -141,6 +149,7 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re
SimpleBSDFMaterial *steel2Material = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
steel2Material->setName("Steel2");
steel2Material->setBSDF(&steelBSDF2);
steel2Material->setEmission(math::constants::Zero);

// GGX Test
GgxDistribution ggxTest;
Expand All @@ -155,6 +164,7 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re
SimpleBSDFMaterial *ggxTestMaterial = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
ggxTestMaterial->setName("GGX_Test");
ggxTestMaterial->setBSDF(&ggxTestBDSF);
ggxTestMaterial->setEmission(math::constants::Zero);
ggxTestMaterial->setReflectance(math::constants::One);

// ========================================================================
Expand All @@ -167,6 +177,7 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re
SimpleBSDFMaterial *backdropTexture = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
backdropTexture->setBSDF(&lambert);
backdropTexture->setReflectanceNode(checkerboardTexture.getMainOutput());
backdropTexture->setEmission(math::constants::Zero);
backdropTexture->setName("Backdrop");

SimpleBSDFMaterial *lightMaterial = rayTracer.getMaterialLibrary()->newMaterial<SimpleBSDFMaterial>();
Expand Down Expand Up @@ -237,6 +248,10 @@ void manta_demo::materialVisualizer(int samplesPerPixel, int resolutionX, int re

// Output the results to a scene buffer
ImagePlane sceneBuffer;
GaussianFilter filter;
filter.setExtents(math::Vector2(1.5, 1.5));
filter.configure((math::real)4.0);
sceneBuffer.setFilter(&filter);

if (TRACE_SINGLE_PIXEL) {
rayTracer.tracePixel(369, 462, &scene, group, &sceneBuffer);
Expand Down
4 changes: 4 additions & 0 deletions demos/pen_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ void manta_demo::penDemo(int samplesPerPixel, int resolutionX, int resolutionY)

// Output the results to a scene buffer
ImagePlane sceneBuffer;
GaussianFilter filter;
filter.setExtents(math::Vector2(1.0, 1.0));
filter.configure((math::real)4.0);
sceneBuffer.setFilter(&filter);

if (TRACE_SINGLE_PIXEL) {
rayTracer.tracePixel(179, 1423, &scene, group, &sceneBuffer);
Expand Down
Loading

0 comments on commit 700e002

Please sign in to comment.