Home Forums Games202-高质量实时渲染 作业资料 & 代码勘误 Reply To: 作业资料 & 代码勘误

#8772 Score: 2
YunHsiao
Participant
19 pts

作业 4 离线预计算部分代码没有适配 MSVC,需要做以下调整:

CMake 文件加入以下段落:

if(MSVC)
target_compile_definitions(lut-Emu-MC PUBLIC _USE_MATH_DEFINES)
target_compile_definitions(lut-Eavg-MC PUBLIC _USE_MATH_DEFINES)
target_compile_definitions(lut-Emu-IS PUBLIC _USE_MATH_DEFINES)
target_compile_definitions(lut-Eavg-IS PUBLIC _USE_MATH_DEFINES)
endif()

C++ 标准并未支持 VLA,需要替换两个 Eavg 实验代码中的

uint8_t data[resolution * resolution * 3];

std::vector<uint8_t> buffer(resolution * resolution * 3);
uint8_t* data = buffer.data();

This post has received 2 votes up.
  • This reply was modified 3 years, 5 months ago by YunHsiao.
  • This reply was modified 3 years, 5 months ago by YunHsiao.
  • This reply was modified 3 years, 5 months ago by YunHsiao.