Added geometry shader to renderablepointscloud. An added bonus is that you can now scale the points non-uniformly using the SizeOption property in the GUI, i.e so the points aren't the same size on screen regardless of distance from camera (default is still uniform size)

This commit is contained in:
Victor Lindquist
2022-05-05 09:56:20 -06:00
parent b5e819c3fe
commit f1b14356e0
6 changed files with 206 additions and 88 deletions

View File

@@ -30,6 +30,7 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <openspace/properties/vector/vec3property.h>
#include <openspace/properties/optionproperty.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
#include <optional>
@@ -64,24 +65,28 @@ protected:
bool _isDirty = true;
std::unique_ptr<ghoul::opengl::ProgramObject> _shaderProgram = nullptr;
UniformCache(modelViewTransform, modelViewProjectionTransform,
color, opacity, size) _uniformCache;
UniformCache(color, opacity, size, modelMatrix, cameraUp,
cameraViewProjectionMatrix, eyePosition, sizeOption) _uniformCache;
properties::BoolProperty _isVisible;
properties::FloatProperty _size;
properties::Vec3Property _color;
std::vector<glm::vec3> _pointData;
properties::OptionProperty _sizeOption;
std::vector<float> _fullData;
std::vector<float> _slicedData;
std::optional<std::string> _dataStorageKey = std::nullopt;
int _nPoints = 0; // TODO: CHANGE TO size_t?
int _nValuesPerPoint = 0;
GLuint _vertexArrayObjectID = 0;
GLuint _vertexBufferObjectID = 0;
enum SizeOption {
Uniform = 0,
NonUniform = 1
};
};
}// namespace openspace