Files
cuber/scenes/CMakeLists.txt
T
portersky 6bfde6c6fb feat: add Cornell Box scene with orbit camera
- gfx::pipeline gains bind_vec3/bind_float for passing arbitrary
  uniforms to shaders (used for light position/color)
- scene base gains on_mouse_drag virtual hook; cuber.cpp polls
  left-mouse delta each frame and forwards it to the active scene
- cornell_box scene: 5-wall room (red/green/white), two pre-rotated
  white boxes with proportions from the original paper, an unlit
  ceiling light panel, and a point-light Lambert shader
- left-click drag orbits the camera around the scene origin;
  pitch is clamped to ±80° to prevent gimbal flip
- key 3 / --scene cornell_box selects the scene
2026-05-11 16:35:26 +02:00

25 lines
1.2 KiB
CMake

add_library(scenes_cube STATIC "cube.cpp")
target_include_directories(scenes_cube PRIVATE "." "..")
target_compile_features(scenes_cube PRIVATE cxx_std_23)
target_compile_options(scenes_cube PRIVATE ${BASE_OPTIONS})
target_compile_definitions(scenes_cube PRIVATE ${BASE_DEFINITIONS})
target_link_libraries(scenes_cube PUBLIC cbt_scene glm::glm)
add_library(scenes_sphere STATIC "sphere.cpp")
target_include_directories(scenes_sphere PRIVATE "." "..")
target_compile_features(scenes_sphere PRIVATE cxx_std_23)
target_compile_options(scenes_sphere PRIVATE ${BASE_OPTIONS})
target_compile_definitions(scenes_sphere PRIVATE ${BASE_DEFINITIONS})
target_link_libraries(scenes_sphere PUBLIC cbt_scene glm::glm)
add_library(scenes_cornell_box STATIC "cornell_box.cpp")
target_include_directories(scenes_cornell_box PRIVATE "." "..")
target_compile_features(scenes_cornell_box PRIVATE cxx_std_23)
target_compile_options(scenes_cornell_box PRIVATE ${BASE_OPTIONS})
target_compile_definitions(scenes_cornell_box PRIVATE ${BASE_DEFINITIONS})
target_link_libraries(scenes_cornell_box PUBLIC cbt_scene glm::glm)
# Convenience interface for all scenes
add_library(scenes INTERFACE)
target_link_libraries(scenes INTERFACE scenes_cube scenes_sphere scenes_cornell_box)