Skip to content

Commit

Permalink
Merge pull request #357 from agnat/fix/8.3.Tesselation
Browse files Browse the repository at this point in the history
Fix 8.3. Tesselation on mac os
  • Loading branch information
JoeyDeVries authored May 18, 2023
2 parents 8d0becc + 90737bb commit 7291ee8
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ set(GUEST_ARTICLES
8.guest/2021/1.scene/1.scene_graph
8.guest/2021/1.scene/2.frustum_culling
8.guest/2021/2.csm
#8.guest/2021/3.tessellation/terrain_gpu_dist
#8.guest/2021/3.tessellation/terrain_cpu_src
8.guest/2021/3.tessellation/terrain_gpu_dist
8.guest/2021/3.tessellation/terrain_cpu_src
8.guest/2021/4.dsa
8.guest/2022/5.computeshader_helloworld
8.guest/2022/6.physically_based_bloom
Expand Down Expand Up @@ -208,6 +208,8 @@ function(create_project_from_sources chapter demo)
"src/${chapter}/${demo}/*.cpp"
"src/${chapter}/${demo}/*.vs"
"src/${chapter}/${demo}/*.fs"
"src/${chapter}/${demo}/*.tcs"
"src/${chapter}/${demo}/*.tes"
"src/${chapter}/${demo}/*.gs"
"src/${chapter}/${demo}/*.cs"
)
Expand Down Expand Up @@ -239,8 +241,10 @@ function(create_project_from_sources chapter demo)
"src/${chapter}/${demo}/*.vs"
# "src/${chapter}/${demo}/*.frag"
"src/${chapter}/${demo}/*.fs"
"src/${chapter}/${demo}/*.tcs"
"src/${chapter}/${demo}/*.tes"
"src/${chapter}/${demo}/*.gs"
"src/${chapter}/${demo}/*.cs"
"src/${chapter}/${demo}/*.cs"
)
# copy dlls
file(GLOB DLLS "dlls/*.dll")
Expand Down
5 changes: 3 additions & 2 deletions includes/learnopengl/shader_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class Shader
}
catch (std::ifstream::failure& e)
{
std::cout << "ERROR::SHADER::FILE_NOT_SUCCESSFULLY_READ" << std::endl;
std::cout << "ERROR::SHADER::FILE_NOT_SUCCESSFULLY_READ: "
<< e.what() << std::endl;
}
const char* vShaderCode = vertexCode.c_str();
const char * fShaderCode = fragmentCode.c_str();
Expand Down Expand Up @@ -232,4 +233,4 @@ class Shader
}
}
};
#endif
#endif
4 changes: 2 additions & 2 deletions src/8.guest/2021/3.tessellation/terrain_cpu_src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main()
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
stbi_set_flip_vertically_on_load(true);
int width, height, nrChannels;
unsigned char *data = stbi_load("resources/heightmaps/iceland_heightmap.png", &width, &height, &nrChannels, 0);
unsigned char *data = stbi_load("heightmaps/iceland_heightmap.png", &width, &height, &nrChannels, 0);
if (data)
{
std::cout << "Loaded heightmap of size " << height << " x " << width << std::endl;
Expand Down Expand Up @@ -293,4 +293,4 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
}
}
2 changes: 1 addition & 1 deletion src/8.guest/2021/3.tessellation/terrain_gpu_dist/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main()
// load image, create texture and generate mipmaps
int width, height, nrChannels;
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
unsigned char *data = stbi_load("resources/heightmaps/iceland_heightmap.png", &width, &height, &nrChannels, 0);
unsigned char *data = stbi_load("heightmaps/iceland_heightmap.png", &width, &height, &nrChannels, 0);
if (data)
{
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
Expand Down

0 comments on commit 7291ee8

Please sign in to comment.