mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-07 20:09:58 -05:00
Use opacity instead of transparency in TouchMarker
This commit is contained in:
@@ -58,12 +58,12 @@ private:
|
||||
|
||||
properties::BoolProperty _visible;
|
||||
properties::FloatProperty _radiusSize;
|
||||
properties::FloatProperty _transparency;
|
||||
properties::FloatProperty _opacity;
|
||||
properties::FloatProperty _thickness;
|
||||
properties::Vec3Property _color;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
|
||||
UniformCache(radius, transparency, thickness, color) _uniformCache;
|
||||
UniformCache(radius, opacity, thickness, color) _uniformCache;
|
||||
|
||||
std::vector<GLfloat> _vertexData;
|
||||
GLuint _quad = 0;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
in vec2 out_position;
|
||||
|
||||
uniform float radius;
|
||||
uniform float transparency;
|
||||
uniform float opacity;
|
||||
uniform float thickness;
|
||||
uniform vec3 color;
|
||||
|
||||
@@ -47,7 +47,7 @@ Fragment getFragment() {
|
||||
// calculate lighting
|
||||
vec3 light_dir = vec3(0.0, 0.0, 1.0);
|
||||
float diffuse = max(0.0, dot(light_dir, n));
|
||||
float alpha = min(pow(sqrt(mag), thickness), transparency);
|
||||
float alpha = min(pow(sqrt(mag), thickness), opacity);
|
||||
|
||||
Fragment frag;
|
||||
frag.color = vec4(color * diffuse, alpha);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
namespace {
|
||||
constexpr const std::array<const char*, 4> UniformNames = {
|
||||
"radius", "transparency", "thickness", "color"
|
||||
"radius", "opacity", "thickness", "color"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo VisibilityInfo = {
|
||||
@@ -47,9 +47,9 @@ namespace {
|
||||
"" // @TODO Missing documentation
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = {
|
||||
"Transparency",
|
||||
"Marker transparency",
|
||||
constexpr openspace::properties::Property::PropertyInfo OpacityInfo = {
|
||||
"Opacity",
|
||||
"Marker opacity",
|
||||
"" // @TODO Missing documentation
|
||||
};
|
||||
|
||||
@@ -71,13 +71,13 @@ TouchMarker::TouchMarker()
|
||||
: properties::PropertyOwner({ "TouchMarker" })
|
||||
, _visible(VisibilityInfo, true)
|
||||
, _radiusSize(RadiusInfo, 30.f, 0.f, 100.f)
|
||||
, _transparency(TransparencyInfo, 0.8f, 0.f, 1.f)
|
||||
, _opacity(OpacityInfo, 0.8f, 0.f, 1.f)
|
||||
, _thickness(ThicknessInfo, 2.f, 0.f, 4.f )
|
||||
, _color(ColorInfo, glm::vec3(0.96f, 0.2f, 0.2f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
{
|
||||
addProperty(_visible);
|
||||
addProperty(_radiusSize);
|
||||
addProperty(_transparency);
|
||||
addProperty(_opacity);
|
||||
addProperty(_thickness);
|
||||
_color.setViewOption(properties::Property::ViewOptions::Color);
|
||||
addProperty(_color);
|
||||
@@ -117,7 +117,7 @@ void TouchMarker::render(const std::vector<openspace::TouchInputHolder>& list) {
|
||||
_shader->activate();
|
||||
|
||||
_shader->setUniform(_uniformCache.radius, _radiusSize);
|
||||
_shader->setUniform(_uniformCache.transparency, _transparency);
|
||||
_shader->setUniform(_uniformCache.opacity, _opacity);
|
||||
_shader->setUniform(_uniformCache.thickness, _thickness);
|
||||
_shader->setUniform(_uniformCache.color, _color.value());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user