Merge pull request #357 from agnat/fix/8.3.Tesselation
Fix 8.3. Tesselation on mac os
@@ -179,8 +179,8 @@ set(GUEST_ARTICLES
|
|||||||
8.guest/2021/1.scene/1.scene_graph
|
8.guest/2021/1.scene/1.scene_graph
|
||||||
8.guest/2021/1.scene/2.frustum_culling
|
8.guest/2021/1.scene/2.frustum_culling
|
||||||
8.guest/2021/2.csm
|
8.guest/2021/2.csm
|
||||||
#8.guest/2021/3.tessellation/terrain_gpu_dist
|
8.guest/2021/3.tessellation/terrain_gpu_dist
|
||||||
#8.guest/2021/3.tessellation/terrain_cpu_src
|
8.guest/2021/3.tessellation/terrain_cpu_src
|
||||||
8.guest/2021/4.dsa
|
8.guest/2021/4.dsa
|
||||||
8.guest/2022/5.computeshader_helloworld
|
8.guest/2022/5.computeshader_helloworld
|
||||||
8.guest/2022/6.physically_based_bloom
|
8.guest/2022/6.physically_based_bloom
|
||||||
@@ -208,6 +208,8 @@ function(create_project_from_sources chapter demo)
|
|||||||
"src/${chapter}/${demo}/*.cpp"
|
"src/${chapter}/${demo}/*.cpp"
|
||||||
"src/${chapter}/${demo}/*.vs"
|
"src/${chapter}/${demo}/*.vs"
|
||||||
"src/${chapter}/${demo}/*.fs"
|
"src/${chapter}/${demo}/*.fs"
|
||||||
|
"src/${chapter}/${demo}/*.tcs"
|
||||||
|
"src/${chapter}/${demo}/*.tes"
|
||||||
"src/${chapter}/${demo}/*.gs"
|
"src/${chapter}/${demo}/*.gs"
|
||||||
"src/${chapter}/${demo}/*.cs"
|
"src/${chapter}/${demo}/*.cs"
|
||||||
)
|
)
|
||||||
@@ -239,8 +241,10 @@ function(create_project_from_sources chapter demo)
|
|||||||
"src/${chapter}/${demo}/*.vs"
|
"src/${chapter}/${demo}/*.vs"
|
||||||
# "src/${chapter}/${demo}/*.frag"
|
# "src/${chapter}/${demo}/*.frag"
|
||||||
"src/${chapter}/${demo}/*.fs"
|
"src/${chapter}/${demo}/*.fs"
|
||||||
|
"src/${chapter}/${demo}/*.tcs"
|
||||||
|
"src/${chapter}/${demo}/*.tes"
|
||||||
"src/${chapter}/${demo}/*.gs"
|
"src/${chapter}/${demo}/*.gs"
|
||||||
"src/${chapter}/${demo}/*.cs"
|
"src/${chapter}/${demo}/*.cs"
|
||||||
)
|
)
|
||||||
# copy dlls
|
# copy dlls
|
||||||
file(GLOB DLLS "dlls/*.dll")
|
file(GLOB DLLS "dlls/*.dll")
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ public:
|
|||||||
}
|
}
|
||||||
catch (std::ifstream::failure& e)
|
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* vShaderCode = vertexCode.c_str();
|
||||||
const char * fShaderCode = fragmentCode.c_str();
|
const char * fShaderCode = fragmentCode.c_str();
|
||||||
@@ -232,4 +233,4 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 2.0 MiB |
@@ -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.
|
// 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);
|
stbi_set_flip_vertically_on_load(true);
|
||||||
int width, height, nrChannels;
|
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)
|
if (data)
|
||||||
{
|
{
|
||||||
std::cout << "Loaded heightmap of size " << height << " x " << width << std::endl;
|
std::cout << "Loaded heightmap of size " << height << " x " << width << std::endl;
|
||||||
@@ -293,4 +293,4 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
|
|||||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
|
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
|
||||||
{
|
{
|
||||||
camera.ProcessMouseScroll(yoffset);
|
camera.ProcessMouseScroll(yoffset);
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 2.0 MiB |
@@ -103,7 +103,7 @@ int main()
|
|||||||
// load image, create texture and generate mipmaps
|
// load image, create texture and generate mipmaps
|
||||||
int width, height, nrChannels;
|
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.
|
// 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)
|
if (data)
|
||||||
{
|
{
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||||
|
|||||||