Merge branch 'plutoViz' of openspace.itn.liu.se:/openspace into plutoViz

Conflicts:
	src/rendering/planets/renderableplanet.cpp
	src/rendering/planets/renderableplanetprojection.cpp
	src/rendering/renderablefov.cpp
This commit is contained in:
Joakim Kilby
2015-02-19 10:07:38 +01:00
11 changed files with 195 additions and 63 deletions
@@ -170,9 +170,6 @@ void RenderablePlanet::render(const RenderData& data)
// setup the data to the shader
// _programObject->setUniform("camdir", camSpaceEye);
/*int shadows = (_target == "SUN") ? 0 : 1;
_programObject->setUniform("shadows", shadows);
_programObject->setUniform("sun_pos", sun_pos.vec3());*/
_programObject->setUniform("ViewProjection", data.camera.viewProjectionMatrix());
_programObject->setUniform("ModelTransform", transform);
setPscUniforms(_programObject, &data.camera, data.position);
@@ -27,6 +27,8 @@
#include <openspace/util/constants.h>
#include <openspace/rendering/planets/planetgeometryprojection.h>
#include <openspace/engine/configurationmanager.h>
#include <ghoul/io/texture/texturereader.h>
//#include <ghoul/opengl/textureunit.h>
#include <ghoul/filesystem/filesystem.h>
@@ -142,8 +144,8 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
bool loaded = openspace::ImageSequencer::ref().loadSequence(_sequenceDir);
if (!loaded) LDEBUG(name + " did not load sequence " + _sequenceDir + " check mod file path");
*/
//openspace::ImageSequencer::ref().parsePlaybook("C:/Users/michal/playbook", "txt");
openspace::ImageSequencer::ref().parsePlaybook("C:/Users/joaki56/Desktop/ProjectionsOfInterest/playbook", "txt");
openspace::ImageSequencer::ref().parsePlaybook("C:/Users/michal/playbook", "txt");
//openspace::ImageSequencer::ref().parsePlaybook("C:/Users/joaki56/Desktop/ProjectionsOfInterest/playbook", "txt");
}
}
@@ -160,7 +162,7 @@ bool RenderablePlanetProjection::initialize(){
if (_fboProgramObject == nullptr)
completeSuccess
&= OsEng.ref().configurationManager()->getValue("fboPassProgram", _fboProgramObject);
&= OsEng.ref().configurationManager()->getValue("fboPassProgram", _fboProgramObject);
loadTexture();
loadProjectionTexture();
+1
View File
@@ -122,6 +122,7 @@ RenderableFov::~RenderableFov(){
bool RenderableFov::initialize(){
bool completeSuccess = true;
if (_programObject == nullptr)
completeSuccess &= OsEng.ref().configurationManager()->getValue("FovProgram", _programObject);
completeSuccess &= OsEng.ref().configurationManager()->getValue("EphemerisProgram", _programObject);
allocateData();
+32 -9
View File
@@ -438,16 +438,39 @@ namespace openspace {
#define PrintText(i, format, ...) Freetype::print(font, 10.f, static_cast<float>(startY - font_size_mono * i * 2), format, __VA_ARGS__);
#define PrintColorText(i, format, size, color, ...) Freetype::print(font, size, static_cast<float>(startY - font_size_mono * i * 2), color, format, __VA_ARGS__);
int i = 0;
PrintText(i++, "Date: %s", Time::ref().currentTimeUTC().c_str());
PrintText(i++, "Avg. Frametime: %.5f", sgct::Engine::instance()->getAvgDt());
PrintText(i++, "Drawtime: %.5f", sgct::Engine::instance()->getDrawTime());
PrintText(i++, "Frametime: %.5f", sgct::Engine::instance()->getDt());
PrintText(i++, "Origin: (% .5f, % .5f, % .5f, % .5f)", origin[0], origin[1], origin[2], origin[3]);
PrintText(i++, "Cam pos: (% .5f, % .5f, % .5f, % .5f)", position[0], position[1], position[2], position[3]);
PrintText(i++, "View dir: (% .5f, % .5f, % .5f)", viewdirection[0], viewdirection[1], viewdirection[2]);
PrintText(i++, "Cam->origin: (% .15f, % .4f)", pssl[0], pssl[1]);
PrintText(i++, "Scaling: (% .5f, % .5f)", scaling[0], scaling[1]);
PrintText(i++, "Date: %s", 20, Time::ref().currentTimeUTC().c_str());
PrintText(i++, "Avg. Frametime: %.5f", 10, sgct::Engine::instance()->getAvgDt());
PrintText(i++, "Drawtime: %.5f", 10, sgct::Engine::instance()->getDrawTime());
PrintText(i++, "Frametime: %.5f", 10, sgct::Engine::instance()->getDt());
PrintText(i++, "Origin: (% .5f, % .5f, % .5f, % .5f)", 10, origin[0], origin[1], origin[2], origin[3]);
PrintText(i++, "Cam pos: (% .5f, % .5f, % .5f, % .5f)", 10, position[0], position[1], position[2], position[3]);
PrintText(i++, "View dir: (% .5f, % .5f, % .5f)", 10, viewdirection[0], viewdirection[1], viewdirection[2]);
PrintText(i++, "Cam->origin: (% .15f, % .4f)", 10, pssl[0], pssl[1]);
PrintText(i++, "Scaling: (% .5f, % .5f)", 10, scaling[0], scaling[1]);
double remaining = openspace::ImageSequencer::ref().getNextCaptureTime() - Time::ref().currentTime();
double t = 0.0;
t = 1.f - remaining / openspace::ImageSequencer::ref().getIntervalLength();
std::string progress = "|";
int g = ((t)* 20) + 1;
for (int i = 0; i < g; i++) progress.append("-"); progress.append(">");
for (int i = 0; i < 21 - g; i++) progress.append(" ");
std::string str = "";
openspace::SpiceManager::ref().getDateFromET(openspace::ImageSequencer::ref().getNextCaptureTime(), str);
progress.append("|");
if (remaining > 0){
glm::vec4 g1(0, t, 0, 1);
glm::vec4 g2(1 - t);
PrintColorText(i++, "Next projection in | %.0f seconds", 10, g1 + g2, remaining);
PrintColorText(i++, "%s %.1f %%", 10, g1 + g2, progress.c_str(), t * 100);
}
glm::vec4 w(1);
PrintColorText(i++, "Ucoming : %s", 10, w, str.c_str());
#undef PrintText
}
+9
View File
@@ -193,6 +193,15 @@ bool SceneGraph::initialize()
_programs.push_back(tmpProgram);
OsEng.ref().configurationManager()->setValue("pscShader", tmpProgram);
// pscstandard
tmpProgram = ProgramObject::Build("FovProgram",
"${SHADERS}/fov_vs.glsl",
"${SHADERS}/fov_fs.glsl");
if (!tmpProgram) return false;
tmpProgram->setProgramObjectCallback(cb);
_programs.push_back(tmpProgram);
OsEng.ref().configurationManager()->setValue("FovProgram", tmpProgram);
// RaycastProgram
tmpProgram = ProgramObject::Build("RaycastProgram",
"${SHADERS}/exitpoints.vert",