Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while building in Assets/Core/Shaders/Util/Specular.h #7

Closed
marek-cel opened this issue Dec 20, 2021 · 1 comment
Closed

Error while building in Assets/Core/Shaders/Util/Specular.h #7

marek-cel opened this issue Dec 20, 2021 · 1 comment

Comments

@marek-cel
Copy link

When building the project on LinuxMint 20.1 (Ubuntu 20.04) I got this error:
Building CXX object src/Skybolt/SkyboltVisTests/CMakeFiles/SkyboltVisTests.dir/QuadTreeTileLoaderTests.cpp.o
In file included from /home/cel/Projekty/var/Skybolt/master/Skybolt-master/src/Skybolt/SkyboltVisTests/../../../Assets/Core/Shaders/Brdfs/PrincipledBrdfDirectionalLight.h:13,
from /home/cel/Projekty/var/Skybolt/master/Skybolt-master/src/Skybolt/SkyboltVisTests/PrincipledBrdfTests.cpp:26:
/home/cel/Projekty/var/Skybolt/master/Skybolt-master/src/Skybolt/SkyboltVisTests/../../../Assets/Core/Shaders/Util/Specular.h: In function ‘glm::vec3 fresnelSchlickRoughness(float, glm::vec3, float)’:
/home/cel/Projekty/var/Skybolt/master/Skybolt-master/src/Skybolt/SkyboltVisTests/../../../Assets/Core/Shaders/Util/Specular.h:57:58: error: cannot convert ‘glm::vec<3, float, glm::packed_highp>::rgb’ from type ‘glm::vec<3, float, glm::packed_highp> (glm::vec<3, float, glm::packed_highp>::)() const’ to type ‘glm::vec3’ {aka ‘glm::vec<3, float, glm::packed_highp>’}
57 | return clamp( a0 + F0 * ( a1 - a0 ), vec3(0), vec3(1) ).rgb;

I was able to go around this by simply adding round parentheses:
return clamp( a0 + F0 * ( a1 - a0 ), vec3(0), vec3(1) ).rgb();

But I'm not sure if this is the right way.

@matthew-reid
Copy link
Contributor

This issue is now fixed on the master branch. Visual Studio allows usage of .rgb as a member, but other compilers do not. I added a macro definition to change rgb to rgb() when the shader is compiled with C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants