Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
fix build on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
椎名深雪 committed Dec 31, 2019
1 parent 87af518 commit e4a3616
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 29 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.12)
project(MiyukiRenderer)


Expand Down Expand Up @@ -66,21 +66,22 @@ file(GLOB libcoreSource src/core/*.cpp


IF(USE_EMBREE)
add_compile_definitions(MYK_USE_EMBREE)
IF(EMBREE_FROM_SOURCE)
include(ExternalProject)
include(${PROJECT_SOURCE_DIR}/cmake/cmake-embree)
include_directories(${EMBREE_INCLUDE_DIRS})
add_compile_definitions(MYK_USE_EMBREE)
ELSE()
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:/Program Files/Intel/Embree3 x64")
ENDIF()
find_package(embree 3.6 REQUIRED)
find_package(embree 3.6)
IF(NOT embree_FOUND)
message(FATAL_ERROR "Embree 3.6 not found")
message("Embree 3.6 not found; Falling back to custom BVH backend")
ELSE()
add_compile_definitions(MYK_USE_EMBREE)
include_directories(${EMBREE_INCLUDE_DIRS})
ENDIF()
include_directories(${EMBREE_INCLUDE_DIRS})

ENDIF()
ENDIF()

Expand Down
Binary file modified data/living_room/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions data/living_room/scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"integrator": {
"type": "PathTracer",
"props": {
"spp": 1024,
"spp": 8,
"minDepth": 3,
"maxDepth": 5
}
Expand All @@ -51,7 +51,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\apple.jpg"
"imagePath": "./textures/apple.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -392,7 +392,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\book-spines.jpg"
"imagePath": "./textures/book-spines.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -526,7 +526,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\carpet-text3b.jpg"
"imagePath": "./textures/carpet-text3b.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -591,7 +591,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\Shade-paper.jpg"
"imagePath": "./textures/Shade-paper.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -725,7 +725,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\cushion-green-circles.jpg"
"imagePath": "./textures/cushion-green-circles.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -790,7 +790,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\cushion-stripe-purple.jpg"
"imagePath": "./textures/cushion-stripe-purple.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -855,7 +855,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\cushion-purple-yellow-stripe.jpg"
"imagePath": "./textures/cushion-purple-yellow-stripe.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1060,7 +1060,7 @@
"props": {
"expr": [
"image",
"textures\\wood4.jpg"
"./textures/wood4.jpg"
]
},
"type": "ExprShader"
Expand Down Expand Up @@ -1195,7 +1195,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\shade-stripes.jpg"
"imagePath": "./textures/shade-stripes.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1260,7 +1260,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\pic5wide.jpg"
"imagePath": "./textures/pic5wide.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1463,7 +1463,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\magazine.jpg"
"imagePath": "./textures/magazine.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1597,7 +1597,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\picture11-vert.jpg"
"imagePath": "./textures/picture11-vert.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1662,7 +1662,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\photo1.jpg"
"imagePath": "./textures/photo1.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1727,7 +1727,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\photo3.jpg"
"imagePath": "./textures/photo3.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1792,7 +1792,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\photo2.jpg"
"imagePath": "./textures/photo2.jpg"
},
"type": "ImageTextureShader"
}
Expand Down Expand Up @@ -1857,7 +1857,7 @@
"props": {
"color": {
"props": {
"imagePath": "textures\\photo4.jpg"
"imagePath": "./textures/photo4.jpg"
},
"type": "ImageTextureShader"
}
Expand Down
15 changes: 12 additions & 3 deletions src/core/accelerators/embree-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@
#include <miyuki.foundation/log.hpp>
#include <miyuki.renderer/ray.h>
#include <miyuki.renderer/scene.h>
#include <embree3/rtcore.h>

#ifdef MYK_USE_EMBREE
#include <embree3/rtcore.h>
#endif




#define QUERY_PROP(prop) log::log("{}: {}\n", #prop, rtcGetDeviceProperty(device, prop) ? true : false)
namespace miyuki::core {
#ifdef MYK_USE_EMBREE
class EmbreeAccelerator::Impl {
RTCDevice device;
RTCScene rtcScene = nullptr;
Expand Down Expand Up @@ -135,12 +140,16 @@ namespace miyuki::core {
}

#else
EmbreeAccelerator::EmbreeAccelerator(){}
EmbreeAccelerator::~EmbreeAccelerator() {}
bool EmbreeAccelerator::occlude(const struct miyuki::core::Ray &ray) {
MIYUKI_NOT_IMPLEMENTED();
}
void miyuki::core::EmbreeAccelerator::build(miyuki::core::Scene &scene) { MIYUKI_NOT_IMPLEMENTED(); }

bool miyuki::core::EmbreeAccelerator::intersect(const miyuki::core::Ray &ray, miyuki::core::Intersection &isct) {
MIYUKI_NOT_IMPLEMENTED();
return false;
}
return false;

#endif
}
7 changes: 4 additions & 3 deletions src/core/accelerators/embree-backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#include <miyuki.foundation/noncopyable.hpp>
#include <miyuki.renderer/ray.h>

namespace miyuki::core {
namespace miyuki::core{

class EmbreeAccelerator final : public Accelerator, private NonCopyable{
class Impl;
Impl *impl = nullptr;
Expand All @@ -42,9 +43,9 @@ namespace miyuki::core {

bool occlude(const Ray & ray)override;

bool4 intersect4(const Ray4 &ray, Intersection4 &isct) override;
bool4 intersect4(const Ray4 &ray, Intersection4 &isct) override{}

bool8 intersect8(const Ray8 &ray, Intersection8 &isct) override;
bool8 intersect8(const Ray8 &ray, Intersection8 &isct) override{}

~EmbreeAccelerator();

Expand Down

0 comments on commit e4a3616

Please sign in to comment.