Merged master.

This commit is contained in:
Jonathas Costa
2019-08-23 16:29:32 -04:00
56 changed files with 1142 additions and 749 deletions
@@ -137,7 +137,12 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
if (dictionary.hasKey(SegmentsInfo.identifier)) {
_segments = static_cast<int>(dictionary.value<double>(SegmentsInfo.identifier));
}
_segments.onChange([&]() { _gridIsDirty = true; });
_segments.onChange([&]() {
if (_segments.value() % 2 == 1) {
_segments = _segments - 1;
}
_gridIsDirty = true;
});
addProperty(_segments);
if (dictionary.hasKey(LineWidthInfo.identifier)) {
@@ -259,7 +264,10 @@ void RenderableSphericalGrid::update(const UpdateData&) {
_isize = 6 * _segments * _segments;
_vsize = (_segments + 1) * (_segments + 1);
_varray.resize(_vsize);
Vertex v = { 0.f, 0.f, 0.f };
std::fill(_varray.begin(), _varray.end(), v);
_iarray.resize(_isize);
std::fill(_iarray.begin(), _iarray.end(), 0);
int nr = 0;
const float fsegments = static_cast<float>(_segments);
+8 -15
View File
@@ -202,7 +202,6 @@ RenderableTrail::Appearance::Appearance()
RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
{
setRenderBin(RenderBin::Overlay);
addProperty(_opacity);
@@ -212,35 +211,28 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
addPropertySubOwner(_translation.get());
_appearance.lineColor = dictionary.value<glm::vec3>(LineColorInfo.identifier);
addProperty(_appearance.lineColor);
if (dictionary.hasKeyAndValue<bool>(EnableFadeInfo.identifier)) {
_appearance.useLineFade = dictionary.value<bool>(EnableFadeInfo.identifier);
}
addProperty(_appearance.useLineFade);
if (dictionary.hasKeyAndValue<double>(FadeInfo.identifier)) {
_appearance.lineFade = static_cast<float>(dictionary.value<double>(FadeInfo.identifier));
_appearance.lineFade = static_cast<float>(
dictionary.value<double>(FadeInfo.identifier)
);
}
addProperty(_appearance.lineFade);
if (dictionary.hasKeyAndValue<double>(LineWidthInfo.identifier)) {
_appearance.lineWidth = static_cast<float>(dictionary.value<double>(
LineWidthInfo.identifier
));
}
addProperty(_appearance.lineWidth);
if (dictionary.hasKeyAndValue<double>(PointSizeInfo.identifier)) {
_appearance.pointSize = static_cast<int>(dictionary.value<double>(PointSizeInfo.identifier));
_appearance.pointSize = static_cast<int>(
dictionary.value<double>(PointSizeInfo.identifier)
);
}
addProperty(_appearance.pointSize);
_appearance.renderingModes.addOptions({
{ RenderingModeLines, "Lines" },
{ RenderingModePoints, "Points" },
{ RenderingModeLinesPoints, "Lines+Points" }
});
// This map is not accessed out of order as long as the Documentation is adapted
// whenever the map changes. The documentation will check for valid values
@@ -252,7 +244,8 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
else {
_appearance.renderingModes = RenderingModeLines;
}
addProperty(_appearance.renderingModes);
addPropertySubOwner(_appearance);
}
void RenderableTrail::initializeGL() {
+5 -4
View File
@@ -84,10 +84,11 @@ Fragment getFragment() {
frag.color.rgb = diffuseAlbedo;
}
frag.color.a = opacity;
frag.depth = vs_screenSpaceDepth;
frag.gPosition = vs_positionCameraSpace;
frag.gNormal = vec4(vs_normalViewSpace, 1.0);
frag.color.a = opacity;
frag.depth = vs_screenSpaceDepth;
frag.gPosition = vs_positionCameraSpace;
frag.gNormal = vec4(vs_normalViewSpace, 0.0);
frag.disableLDR2HDR = true;
return frag;