mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-01 09:10:18 -06:00
Requested changes for merging. Part II.
This commit is contained in:
@@ -102,7 +102,6 @@ namespace {
|
||||
} // namespace
|
||||
|
||||
namespace openspace {
|
||||
|
||||
AtmosphereDeferredcaster::AtmosphereDeferredcaster()
|
||||
: _transmittanceProgramObject(nullptr)
|
||||
, _irradianceProgramObject(nullptr)
|
||||
@@ -1275,8 +1274,6 @@ namespace openspace {
|
||||
LDEBUG("Ended precalculations for Atmosphere effects...");
|
||||
}
|
||||
|
||||
void AtmosphereDeferredcaster::resetAtmosphereTextures() {}
|
||||
|
||||
void AtmosphereDeferredcaster::createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size) {
|
||||
glGenVertexArrays(1, vao);
|
||||
glGenBuffers(1, vbo);
|
||||
@@ -1404,10 +1401,10 @@ namespace openspace {
|
||||
|
||||
void AtmosphereDeferredcaster::step3DTexture(
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject>& shaderProg,
|
||||
int layer, bool doCalc)
|
||||
int layer, bool doCalculation)
|
||||
{
|
||||
// See OpenGL redbook 8th Edition page 556 for Layered Rendering
|
||||
if (doCalc) {
|
||||
if (doCalculation) {
|
||||
float earth2 = _atmospherePlanetRadius * _atmospherePlanetRadius;
|
||||
float atm2 = _atmosphereRadius * _atmosphereRadius;
|
||||
float diff = atm2 - earth2;
|
||||
|
||||
@@ -100,10 +100,9 @@ private:
|
||||
void deleteUnusedComputationTextures();
|
||||
void executeCalculations(GLuint quadCalcVAO, GLenum drawBuffers[1],
|
||||
GLsizei vertexSize);
|
||||
void resetAtmosphereTextures();
|
||||
void createRenderQuad(GLuint* vao, GLuint* vbo, GLfloat size);
|
||||
void step3DTexture(std::unique_ptr<ghoul::opengl::ProgramObject>& shaderProg,
|
||||
int layer, bool doCalc = true);
|
||||
int layer, bool doCalculation = true);
|
||||
void checkFrameBufferState(const std::string& codePosition) const;
|
||||
void loadAtmosphereDataIntoShaderProgram(
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> & shaderProg
|
||||
|
||||
@@ -699,8 +699,11 @@ bool RenderableStars::readSpeckFile() {
|
||||
} while (!file.eof());
|
||||
|
||||
// Normalize Luminosity:
|
||||
int luminosityVarColumnPos = 4;
|
||||
for (size_t i = 0; i < _fullData.size(); i += _nValuesPerStar) {
|
||||
_fullData[i + 4] = (_fullData[i + 4] - minLumValue) / (maxLumValue - minLumValue);
|
||||
_fullData[i + luminosityVarColumnPos] =
|
||||
(_fullData[i + luminosityVarColumnPos] - minLumValue) /
|
||||
(maxLumValue - minLumValue);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -345,8 +345,7 @@ void OrbitalNavigator::updateCameraStateFromMouseStates(Camera& camera, double d
|
||||
}
|
||||
|
||||
glm::dvec3 OrbitalNavigator::cameraToSurfaceVector(
|
||||
const glm::dvec3& camPos,
|
||||
const glm::dvec3& centerPos,
|
||||
const glm::dvec3& camPos, const glm::dvec3& centerPos,
|
||||
const SurfacePositionHandle& posHandle)
|
||||
{
|
||||
glm::dmat4 modelTransform = _focusNode->modelTransform();
|
||||
@@ -491,16 +490,21 @@ glm::dquat OrbitalNavigator::interpolateLocalRotation(double deltaTime,
|
||||
else {
|
||||
return localCameraRotation;
|
||||
}
|
||||
|
||||
double t = _rotateToFocusNodeInterpolator.value();
|
||||
_rotateToFocusNodeInterpolator.setDeltaTime(static_cast<float>(deltaTime));
|
||||
_rotateToFocusNodeInterpolator.step();
|
||||
|
||||
glm::dquat result = glm::slerp(
|
||||
localCameraRotation,
|
||||
glm::dquat(glm::dvec3(0.0)),
|
||||
glm::min(t * _rotateToFocusNodeInterpolator.deltaTimeScaled(), 1.0));
|
||||
glm::min(t * _rotateToFocusNodeInterpolator.deltaTimeScaled(), 1.0)
|
||||
);
|
||||
|
||||
if (angle(result) < 0.01) {
|
||||
_rotateToFocusNodeInterpolator.end();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -520,7 +524,8 @@ double OrbitalNavigator::interpolateCameraToSurfaceDistance(double deltaTime,
|
||||
double result = glm::exp(glm::mix(
|
||||
glm::log(currentDistance),
|
||||
glm::log(targetDistance),
|
||||
glm::min(t * _cameraToSurfaceDistanceInterpolator.deltaTimeScaled(), 1.0)));
|
||||
glm::min(t * _cameraToSurfaceDistanceInterpolator.deltaTimeScaled(), 1.0))
|
||||
);
|
||||
|
||||
double ratio = currentDistance / targetDistance;
|
||||
if (glm::abs(ratio - 1.0) < 0.000001) {
|
||||
|
||||
Reference in New Issue
Block a user