Skip to content

Commit

Permalink
remove heterogeneous medium
Browse files Browse the repository at this point in the history
  • Loading branch information
GraphicsEnthusiast committed Jan 12, 2024
1 parent 4f02a8b commit f85f96c
Show file tree
Hide file tree
Showing 14,551 changed files with 2 additions and 3,010,668 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set(CMAKE_CXX_STANDARD 17)

add_subdirectory("common")
add_subdirectory("core")
add_subdirectory("external/openvdb")

add_executable(DreamRender main.cpp)

Expand All @@ -25,7 +24,6 @@ target_include_directories(DreamRender PUBLIC
target_link_libraries(DreamRender PUBLIC
common
core
openvdb
../external/glfw3/lib/glfw3dll
../external/glad/lib/glad
../external/embree/lib/embree3
Expand Down
3 changes: 0 additions & 3 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ add_library(core STATIC
Transform.cpp
Transform.h
Utils.h
DensityGrid.cpp
DensityGrid.h
)

target_include_directories(core PUBLIC
Expand All @@ -60,7 +58,6 @@ target_include_directories(core PUBLIC

target_link_libraries(core PUBLIC
common
openvdb
../external/embree/lib/embree3
../external/embree/lib/tbb
../external/glfw3/lib/glfw3dll
Expand Down
51 changes: 0 additions & 51 deletions core/DensityGrid.cpp

This file was deleted.

31 changes: 0 additions & 31 deletions core/DensityGrid.h

This file was deleted.

20 changes: 1 addition & 19 deletions core/Medium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,4 @@ Spectrum Homogeneous::SampleDistance(const Spectrum& history, float max_distance
}

return transmittance;
}

Heterogeneous::Heterogeneous(std::shared_ptr<PhaseFunction> phase, std::shared_ptr<DensityGrid> grid,
const Spectrum& absorption, const Spectrum& scattering, float densityMulti) : Medium(MediumType::HeterogeneousMedium, phase), densityGrid(grid),
absorptionColor(absorption), scatteringColor(scattering), densityMultiplier(densityMulti) {
// Compute wavelength independent majorant
float max_density = GetMaxDensity();
Spectrum m = absorptionColor * max_density + scatteringColor * max_density;
majorant = std::max(m[0], std::max(m[1], m[2]));
invMajorant = 1.0f / majorant;
}

Spectrum Heterogeneous::EvaluateDistance(const Spectrum& history, bool scattered, float distance, float& trans_pdf) {
return Spectrum();
}

Spectrum Heterogeneous::SampleDistance(const Spectrum& history, float max_distance, float& distance, float& trans_pdf, bool& scattered, std::shared_ptr<Sampler> sampler) {
return Spectrum();
}
}
40 changes: 1 addition & 39 deletions core/Medium.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

#include "Utils.h"
#include "PhaseFunction.h"
#include "DensityGrid.h"

enum MediumType {
HomogeneousMedium,
HeterogeneousMedium
HomogeneousMedium
};

class Medium {
Expand Down Expand Up @@ -45,40 +43,4 @@ class Homogeneous : public Medium {
private:
Spectrum sigma_s;
Spectrum sigma_t;
};

class Heterogeneous : public Medium {
public:
Heterogeneous(std::shared_ptr<PhaseFunction> phase, std::shared_ptr<DensityGrid> grid,
const Spectrum& absorption,
const Spectrum& scattering,
float densityMulti = 1.0f);

inline float GetDensity(const Point3f& p) const {
return densityMultiplier * densityGrid->GetDensity(p);
}

inline float GetMaxDensity() const {
return densityMultiplier * densityGrid->GetMaxDensity();
}

inline Spectrum GetSigma_a(float density) const {
return absorptionColor * density;
}

inline Spectrum GetSigma_s(float density) const {
return scatteringColor * density;
}

virtual Spectrum EvaluateDistance(const Spectrum& history, bool scattered, float distance, float& trans_pdf) override;

virtual Spectrum SampleDistance(const Spectrum& history, float max_distance, float& distance, float& trans_pdf, bool& scattered, std::shared_ptr<Sampler> sampler) override;

private:
std::shared_ptr<DensityGrid> densityGrid;
Spectrum absorptionColor;
Spectrum scatteringColor;
float densityMultiplier;
float majorant;
float invMajorant;
};
6 changes: 0 additions & 6 deletions core/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include <glm/gtx/string_cast.hpp>
#include <embree3/rtcore.h>
#include <embree3/rtcore_ray.h>
#include <openvdb/openvdb.h>
#include <openvdb/tools/Interpolation.h>

template <int nSpectrumSamples>
class CoefficientSpectrum;
Expand Down Expand Up @@ -106,10 +104,6 @@ class HenyeyGreenstein;

class Medium;
class Homogeneous;
class Heterogeneous;

class DensityGrid;
class OpenVDBGrid;

using Vector2u = glm::uvec2;
using Vector2i = glm::ivec2;
Expand Down
2 changes: 0 additions & 2 deletions external/openvdb/.gitattributes

This file was deleted.

30 changes: 0 additions & 30 deletions external/openvdb/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions external/openvdb/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions external/openvdb/boost/include/boost/accumulators/accumulators.hpp

This file was deleted.

Loading

0 comments on commit f85f96c

Please sign in to comment.