Compare commits

..

No commits in common. "modules" and "main" have entirely different histories.

3 changed files with 23 additions and 32 deletions

View file

@ -1,32 +1,30 @@
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
cmake_minimum_required(VERSION 3.22)
project(perlin-shadows)
set(CMAKE_CXX_STANDARD 23)
include_directories(src)
link_libraries(-lGL -lglut -lGLEW -lGLU)
add_executable(${CMAKE_PROJECT_NAME})
target_sources(${CMAKE_PROJECT_NAME}
PRIVATE
src/constants.h
src/final.cpp
src/geography.cpp
src/geography.h
src/grid.cpp
src/grid.h
src/renderer.cpp
src/renderer.h
src/camera.cpp
src/camera.h
src/shader.cpp
src/shader.h
src/point_light.cpp
src/point_light.h
src/renderable.cpp
src/renderable.h
PRIVATE
FILE_SET modules TYPE CXX_MODULES FILES
src/noise.cppm
add_executable(perlin-shadows
src/constants.h
src/final.cpp
src/geography.cpp
src/geography.h
src/grid.cpp
src/grid.h
src/noise_math.h
src/renderer.cpp
src/renderer.h
src/camera.cpp
src/camera.h
src/shader.cpp
src/shader.h
src/point_light.cpp
src/point_light.h
src/renderable.cpp
src/renderable.h
)
file(READ src/shader/phong.vert PHONG_VERT)
@ -38,5 +36,4 @@ file(READ src/shader/shadow.frag SHADOW_FRAG)
file(READ src/shader/shadow.geom SHADOW_GEOM)
configure_file(src/point_light.in.h src/point_light.h @ONLY)
include_directories(src)
target_include_directories(perlin-shadows PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/src")

View file

@ -4,11 +4,9 @@
#include <vector>
#include "constants.h"
import noise;
#include "noise_math.h"
using namespace std;
using namespace noise;
random_device Grid::device_;
default_random_engine::result_type Grid::base_random_{0};

View file

@ -1,6 +1,4 @@
export module noise;
export namespace noise {
#pragma once
// Based on Ken Perlin's smoother step function:
// https://en.wikipedia.org/wiki/Smoothstep#Variations Returns value in range
@ -23,5 +21,3 @@ export namespace noise {
const float bound_1) {
return bound_0 + SmootherStep(x) * (bound_1 - bound_0);
}
} // namespace noise