Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/sys/barrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace embree
__forceinline void wait()
{
mutex.lock();
count++;
count = count + 1;

if (count == barrierSize) {
count = 0;
Expand Down
6 changes: 3 additions & 3 deletions tutorials/common/imgui/imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3331,7 +3331,7 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
DataTypeFormatString(data_buf, IM_ARRAYSIZE(data_buf), data_type, p_data, format);
ImStrTrimBlanks(data_buf);

ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited;
ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | (ImGuiInputTextFlags)ImGuiInputTextFlags_NoMarkEdited;
flags |= InputScalar_DefaultCharsFilter(data_type, format);

bool value_changed = false;
Expand Down Expand Up @@ -3379,7 +3379,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
// Testing ActiveId as a minor optimization as filtering is not needed until active
if (g.ActiveId == 0 && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
flags |= InputScalar_DefaultCharsFilter(data_type, format);
flags |= ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselves by comparing the actual data rather than the string.
flags |= ImGuiInputTextFlags_AutoSelectAll | (ImGuiInputTextFlags)ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselves by comparing the actual data rather than the string.

bool value_changed = false;
if (p_step != NULL)
Expand Down Expand Up @@ -6218,7 +6218,7 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
ImGuiID id = window->GetID(label);
flags |= ImGuiTreeNodeFlags_CollapsingHeader;
if (p_visible)
flags |= ImGuiTreeNodeFlags_AllowItemOverlap | ImGuiTreeNodeFlags_ClipLabelForTrailingButton;
flags |= ImGuiTreeNodeFlags_AllowItemOverlap | (ImGuiTreeNodeFlags)ImGuiTreeNodeFlags_ClipLabelForTrailingButton;
bool is_open = TreeNodeBehavior(id, flags, label);
if (p_visible != NULL)
{
Expand Down
42 changes: 21 additions & 21 deletions tutorials/common/tutorial/tutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,28 +431,28 @@ namespace embree

registerOption("ambientlight", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f L = cin->getVec3f();
futures.push_back([=]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::AmbientLight>(SceneGraph::AmbientLight(L))); });
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::AmbientLight>(SceneGraph::AmbientLight(L))); });
}, "--ambientlight r g b: adds an ambient light with intensity rgb");
registerOptionAlias("ambientlight","ambient");

registerOption("pointlight", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f P = cin->getVec3f();
const Vec3f I = cin->getVec3f();
futures.push_back([=]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::PointLight>(SceneGraph::PointLight(P,I))); });
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::PointLight>(SceneGraph::PointLight(P,I))); });
}, "--pointlight x y z r g b: adds a point light at position xyz with intensity rgb");

registerOption("directionallight", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f D = cin->getVec3f();
const Vec3f E = cin->getVec3f();
futures.push_back([=]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DirectionalLight>(SceneGraph::DirectionalLight(D,E))); });
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DirectionalLight>(SceneGraph::DirectionalLight(D,E))); });
}, "--directionallight x y z r g b: adds a directional light with direction xyz and intensity rgb");
registerOptionAlias("directionallight","dirlight");

registerOption("distantlight", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f D = cin->getVec3f();
const Vec3f L = cin->getVec3f();
const float halfAngle = cin->getFloat();
futures.push_back([=]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DistantLight>(SceneGraph::DistantLight(D,L,halfAngle))); });
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DistantLight>(SceneGraph::DistantLight(D,L,halfAngle))); });
}, "--distantlight x y z r g b a: adds a distant light with direction xyz, intensity rgb, and opening angle a");

registerOption("triangle-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -461,7 +461,7 @@ namespace embree
const Vec3f dy = cin->getVec3f();
const size_t width = cin->getInt();
const size_t height = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createTrianglePlane(p0,dx,dy,width,height,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createTrianglePlane(p0,dx,dy,width,height,new OBJMaterial)); });
}, "--triangle-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height: adds a plane build of triangles originated at p0 and spanned by the vectors dx and dy with a tessellation width/height.");

registerOption("quad-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -470,7 +470,7 @@ namespace embree
const Vec3f dy = cin->getVec3f();
const size_t width = cin->getInt();
const size_t height = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createQuadPlane(p0,dx,dy,width,height,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createQuadPlane(p0,dx,dy,width,height,new OBJMaterial)); });
}, "--quad-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height: adds a plane build of quadrilaterals originated at p0 and spanned by the vectors dx and dy with a tessellation width/height.");

registerOption("grid-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -479,7 +479,7 @@ namespace embree
const Vec3f dy = cin->getVec3f();
const size_t width = cin->getInt();
const size_t height = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createGridPlane(p0,dx,dy,width,height,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createGridPlane(p0,dx,dy,width,height,new OBJMaterial)); });
}, "--grid-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height: adds a plane using a grid mesh build. The plane is originated at p0 and spanned by the vectors dx and dy with a tessellation width/height.");

registerOption("subdiv-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -489,7 +489,7 @@ namespace embree
const size_t width = cin->getInt();
const size_t height = cin->getInt();
const float tessellationRate = cin->getFloat();
futures.push_back([=]() { scene->add(SceneGraph::createSubdivPlane(p0,dx,dy,width,height,tessellationRate,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createSubdivPlane(p0,dx,dy,width,height,tessellationRate,new OBJMaterial)); });
}, "--subdiv-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height tessellationRate: adds a plane build as a Catmull Clark subdivision surface originated at p0 and spanned by the vectors dx and dy. The plane consists of widt x height many patches, and each patch has the specified tessellation rate.");

registerOption("hair-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -499,7 +499,7 @@ namespace embree
const float len = cin->getFloat();
const float r = cin->getFloat();
const size_t N = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::FLAT_CURVE,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::FLAT_CURVE,new OBJMaterial)); });
}, "--hair-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z length radius num: adds a hair plane originated at p0 and spanned by the vectors dx and dy. num hairs are generated with specified length and radius.");

registerOption("curve-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -509,42 +509,42 @@ namespace embree
const float len = cin->getFloat();
const float r = cin->getFloat();
const size_t N = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::ROUND_CURVE,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::ROUND_CURVE,new OBJMaterial)); });
}, "--curve-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z length radius: adds a plane build of bezier curves originated at p0 and spanned by the vectors dx and dy. num curves are generated with specified length and radius.");

registerOption("sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
futures.push_back([=]() { scene->add(SceneGraph::createSphere(p, r, new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createSphere(p, r, new OBJMaterial)); });
}, "--sphere p.x p.y p.z r: adds a sphere at position p with radius r");

registerOption("triangle-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createTriangleSphere(p,r,numPhi,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createTriangleSphere(p,r,numPhi,new OBJMaterial)); });
}, "--triangle-sphere p.x p.y p.z r numPhi: adds a sphere at position p with radius r and tessellation numPhi build of triangles.");

registerOption("quad-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createQuadSphere(p,r,numPhi,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createQuadSphere(p,r,numPhi,new OBJMaterial)); });
}, "--quad-sphere p.x p.y p.z r numPhi: adds a sphere at position p with radius r and tessellation numPhi build of quadrilaterals.");

registerOption("grid-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
const size_t N = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createGridSphere(p,r,N,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createGridSphere(p,r,N,new OBJMaterial)); });
}, "--grid-sphere p.x p.y p.z r N: adds a grid sphere at position p with radius r using a cube topology and N*N quads at each face.");

registerOption("triangle-sphere-mblur", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const Vec3f dp = cin->getVec3f();
const float r = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() {
futures.push_back([=, this]() {
Ref<SceneGraph::Node> mesh = SceneGraph::createTriangleSphere(p,r,numPhi,new OBJMaterial);
mesh->set_motion_vector(dp);
scene->add(mesh);
Expand All @@ -556,7 +556,7 @@ namespace embree
const Vec3f dp = cin->getVec3f();
const float r = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() {
futures.push_back([=, this]() {
Ref<SceneGraph::Node> mesh = SceneGraph::createQuadSphere(p,r,numPhi,new OBJMaterial);
mesh->set_motion_vector(dp);
scene->add(mesh);
Expand All @@ -568,15 +568,15 @@ namespace embree
const float r = cin->getFloat();
const size_t numPhi = cin->getInt();
const float tessellationRate = cin->getFloat();
futures.push_back([=]() { scene->add(SceneGraph::createSubdivSphere(p,r,numPhi,tessellationRate,new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createSubdivSphere(p,r,numPhi,tessellationRate,new OBJMaterial)); });
}, "--subdiv-sphere p.x p.y p.z r numPhi: adds a sphere at position p with radius r build of Catmull Clark subdivision surfaces. The sphere consists of numPhi x numPhi many patches and each path has the specified tessellation rate.");

registerOption("point-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
const float pointR = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)); });
}, "--point-sphere p.x p.y p.z r pointR numPhi: adds a sphere at position p with radius r and tessellation numPhi build of spheres.");

registerOption("point-sphere-mblur", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand All @@ -585,23 +585,23 @@ namespace embree
const float r = cin->getFloat();
const float pointR = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)->set_motion_vector(dp)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)->set_motion_vector(dp)); });
}, "--point-sphere p.x p.y p.z d.x d.y d.z r pointR numPhi: adds a sphere at position p, motion vector d, with radius r and tessellation numPhi build of spheres.");

registerOption("disc-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
const float pointR = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::DISC, new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::DISC, new OBJMaterial)); });
}, "--disc-sphere p.x p.y p.z r pointR numPhi: adds a sphere at position p with radius r and tessellation numPhi build of discs.");

registerOption("oriented-disc-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
const Vec3f p = cin->getVec3f();
const float r = cin->getFloat();
const float pointR = cin->getFloat();
const size_t numPhi = cin->getInt();
futures.push_back([=]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::ORIENTED_DISC, new OBJMaterial)); });
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::ORIENTED_DISC, new OBJMaterial)); });
}, "--oriented-disc-sphere p.x p.y p.z r pointR numPhi: adds a sphere at position p with radius r and tessellation numPhi build of oriented discs.");

registerOption("print-cameras", [this] (Ref<ParseStream> cin, const FileName& path) {
Expand Down
2 changes: 1 addition & 1 deletion tutorials/verify/verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5719,7 +5719,7 @@ namespace embree
float benchmark(VerifyApplication* state)
{
double t0 = getSeconds();
for (volatile size_t i=0; i<10000000; i++);
for (volatile size_t i=0; i<10000000; i = i + 1);
double t1 = getSeconds();
return 1.0f/float(t1-t0);
}
Expand Down