lighttransport / nanort

NanoRT, single header only modern ray tracing kernel.
MIT License
1.08k stars 91 forks source link

Fixies and updates to PBR Surface example #41

Closed Ybalrid closed 6 years ago

Ybalrid commented 6 years ago

Hi,

This PR contains fixes to the pbr_surface example:

syoyo commented 6 years ago

There are some compilation errors in Ubuntu 16.04 + gcc 5.4.0.

Please fix such errors.

Also, its better to use clang with -Weverything -Werror option to find more C++ syntax related errors.

/home/syoyo/work/nanort/examples/pbr_surface/pbr_maths.hh:609:36: error: no match for ‘operator/’ (operand types are ‘glm::vec3 {aka glm::vec<3, float, (glm::precision)0u>}’ and ‘double’)
     return (pbrInputs.diffuseColor / M_PI) *
                                    ^
In file included from /home/syoyo/work/nanort/examples/pbr_surface/../common/glm/glm/gtc/../gtc/quaternion.hpp:396:0,
                 from /home/syoyo/work/nanort/examples/pbr_surface/../common/glm/glm/gtc/type_ptr.hpp:36,
                 from /home/syoyo/work/nanort/examples/pbr_surface/main.cc:7:
/home/syoyo/work/nanort/examples/pbr_surface/../common/glm/glm/gtc/../gtc/quaternion.inl:350:33: note: candidate: template<class T, glm::precision P> glm::tquat<T, P> glm::operator/(const glm::tquat<T, P>&, const T&)
  GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s)
                                 ^
...
Ybalrid commented 6 years ago

Oh. I was working on Windows. It builded fine under MSVC... I'm going to fix that!

Ybalrid commented 6 years ago

Can you check with latest commit ?

syoyo commented 6 years ago

Thanks! merged.