More changes to RenderableStars using the AMNH test target

Removed superfluous properties of RenderableStars
Removed specialized settings file
This commit is contained in:
Alexander Bock
2015-02-22 23:51:26 +01:00
parent a7bd6319db
commit 34ff3c6018
6 changed files with 13 additions and 44 deletions

View File

@@ -73,9 +73,6 @@ private:
properties::OptionProperty _colorOption;
bool _dataIsDirty;
properties::Vec2Property _magnitudeClamp;
properties::FloatProperty _exponentialOffset;
properties::FloatProperty _exponentialDampening;
properties::FloatProperty _scaleFactor;
ghoul::opengl::ProgramObject* _program;

View File

@@ -1,11 +1,7 @@
openspace.printInfo("Setting default values");
openspace.setPropertyValue("Constellation Bounds.renderable.enabled", false);
openspace.setPropertyValue("Stars.renderable.exponentialDampening", 0.400);
openspace.setPropertyValue("Stars.renderable.exponentialOffset", 19.222);
openspace.setPropertyValue("Stars.renderable.scaleFactor", 9.201);
openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.85);
openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.75);
openspace.setPropertyValue("MilkyWay.renderable.segments", 50);
openspace.printInfo("Done setting default values");

View File

@@ -1,12 +0,0 @@
openspace.printInfo("Setting default values");
openspace.setPropertyValue("Constellation Bounds.renderable.enabled", false);
openspace.setPropertyValue("Stars.renderable.magnitudeClamp", {0.941, 3.824});
openspace.setPropertyValue("Stars.renderable.exponentialOffset", 6.180);
openspace.setPropertyValue("Stars.renderable.exponentialDampening", 0.838);
openspace.setPropertyValue("Stars.renderable.scaleFactor", 0.563);
openspace.setPropertyValue("MilkyWay.renderable.transparency", 0.65);
openspace.setPropertyValue("MilkyWay.renderable.segments", 50);
openspace.printInfo("Done setting default values");

View File

@@ -77,7 +77,7 @@ void main() {
// textureColor.a = sqrt(textureColor.a);
vec4 fullColor = vec4(color.rgb, textureColor.a);
const float minPixelSize = 15;
const float minPixelSize = 25;
float normSize = (billboardSize - 1.0) / (minPixelSize - 1.0);
normSize = pow(normSize, 3);

View File

@@ -52,9 +52,6 @@ layout(location = 5) out float billboardSize;
uniform mat4 projection;
uniform vec2 magnitudeClamp;
uniform float exponentialOffset;
uniform float exponentialDampening;
uniform float scaleFactor;
void main() {
@@ -63,7 +60,8 @@ void main() {
ge_speed = vs_speed[0];
float absoluteMagnitude = vs_brightness[0].z;
float modifiedSpriteSize = exp((-exponentialOffset - absoluteMagnitude) * exponentialDampening) * scaleFactor;
// float modifiedSpriteSize = exp((-exponentialOffset - absoluteMagnitude) * exponentialDampening) * scaleFactor * 50;
float modifiedSpriteSize = exp((-30.623 - absoluteMagnitude) * 0.462) * scaleFactor * 2000;
vec4 projPos[4];
for (int i = 0; i < 4; ++i) {
@@ -81,7 +79,7 @@ void main() {
// The billboard is smaller than one pixel, we can discard it
vec2 distance = abs(ll - ur);
float sizeInPixels = length(distance);
if (sizeInPixels < 1)
if (sizeInPixels < 5)
return;
for(int i = 0; i < 4; i++){

View File

@@ -87,16 +87,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
, _colorTextureIsDirty(true)
, _colorOption("colorOption", "Color Option")
, _dataIsDirty(true)
, _magnitudeClamp(
"magnitudeClamp",
"Magnitude Clamping",
glm::vec2(1.f, 4.f),
glm::vec2(-15.f),
glm::vec2(15.f)
)
, _exponentialOffset("exponentialOffset", "Exponential Offset", 5.f, 0.f, 50.f)
, _exponentialDampening("exponentialDampening", "Exponential Dampening", 0.871f, 0.f, 1.f)
, _scaleFactor("scaleFactor", "Scale Factor", 1.f, 0.f, 10.f)
, _scaleFactor("scaleFactor", "Scale Factor", 5.f, 0.f, 10.f)
, _program(nullptr)
, _programIsDirty(false)
, _speckFile("")
@@ -137,9 +128,6 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
_colorTexturePath.onChange([&]{ _colorTextureIsDirty = true; });
_colorTextureFile->setCallback([&](const File&) { _colorTextureIsDirty = true; });
addProperty(_magnitudeClamp);
addProperty(_exponentialOffset);
addProperty(_exponentialDampening);
addProperty(_scaleFactor);
}
@@ -202,9 +190,6 @@ void RenderableStars::render(const RenderData& data) {
_program->setUniform("projection", projectionMatrix);
_program->setUniform("colorOption", _colorOption);
_program->setUniform("magnitudeClamp", _magnitudeClamp);
_program->setUniform("exponentialOffset", _exponentialOffset);
_program->setUniform("exponentialDampening", _exponentialDampening);
_program->setUniform("scaleFactor", _scaleFactor);
setPscUniforms(_program, &data.camera, data.position);
@@ -557,9 +542,14 @@ void RenderableStars::createDataSlice(ColorOption option) {
layout.value.bvColor = _fullData[i + 3];
layout.value.luminance = _fullData[i + 4];
layout.value.absoluteMagnitude = _fullData[i + 5];
//layout.value.absoluteMagnitude = _fullData[i + 6];
_slicedData.insert(_slicedData.end(),
#ifdef USING_STELLAR_TEST_GRID
layout.value.bvColor = _fullData[i + 3];
layout.value.luminance = _fullData[i + 3];
layout.value.absoluteMagnitude = _fullData[i + 3];
#endif
_slicedData.insert(_slicedData.end(),
layout.data.begin(),
layout.data.end());