-
Notifications
You must be signed in to change notification settings - Fork 5
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
Optimize Pipeline & Add Texture Mapping #13
Conversation
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
…arycentricCoord() Signed-off-by: ZhuohaoHe <[email protected]>
…_show with std::max(0.0f, ) Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
…d a uniform buffer, and modularized the pipeline to align more closely with OpenGL's structure and improve clarity and programmability. Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
Signed-off-by: ZhuohaoHe <[email protected]>
CMakeLists.txt
Outdated
@@ -45,6 +45,8 @@ set(LOG_FILE_PATH "${EXECUTABLE_OUTPUT_PATH}/logs/SimpleRendererLog.log") | |||
set(LOG_FILE_MAX_SIZE 1024*1024*4) | |||
# 日志文件数量 | |||
set(LOG_FILE_MAX_COUNT 8) | |||
#Debug Type (for cmake debug) | |||
set(CMAKE_BUILD_TYPE "Debug") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个改到 CMakePresets.json 吧
size_t height_; | ||
size_t size_; | ||
std::unique_ptr<uint32_t[]> framebuffer_1_; | ||
std::unique_ptr<uint32_t[]> framebuffer_2_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个能不能写成 vector 或者 array 的形式,方便拓展
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是要把uint32_t[]替换为vector吗?因为我感觉uint32_t[]更加直观用起来也简单
|
||
glm::mat4 GetProjectionMatrix(float fov, float aspectRatio, float nearPlane, | ||
float farPlane) const { | ||
return glm::perspective(glm::radians(fov), aspectRatio, nearPlane, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个和 lookAt 我们把算法暴露出来吧,这也算是个知识点
test/system_test/camera.h
Outdated
glm::vec3 newFront; | ||
newFront.x = cos(glm::radians(yaw)) * cos(glm::radians(pitch)); | ||
newFront.y = sin(glm::radians(pitch)); | ||
newFront.z = sin(glm::radians(yaw)) * cos(glm::radians(pitch)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sin cos 加上 std::
#include "stb_image.h" | ||
|
||
namespace simple_renderer { | ||
Texture Texture::LoadTextureFromFile(const std::string& path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是有构造析构吗,为啥还要专门实现一个方法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为这个函数是个static函数,直接从文件中加载材质,然后返回一个材质。到处都可以直接用,不需要专门创建一个Texture对象。
Signed-off-by: ZhuohaoHe <[email protected]>
Description
This pull request includes several key enhancements:
Test Platform
macOS 14.5
Linux (Ubuntu 20.04)
TODO: