Merge branch 'master' into feature/model-opacity

* Solve conflicts in renderablemodel.cpp and renderabletrail.cpp
This commit is contained in:
Malin E
2023-04-12 17:03:40 +02:00
110 changed files with 1679 additions and 662 deletions

View File

@@ -92,7 +92,6 @@ RenderableBoxGrid::RenderableBoxGrid(const ghoul::Dictionary& dictionary)
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_color = p.color.value_or(_color);
_color.setViewOption(properties::Property::ViewOptions::Color);

View File

@@ -135,7 +135,6 @@ RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_color = p.color.value_or(_color);
_color.setViewOption(properties::Property::ViewOptions::Color);

View File

@@ -117,7 +117,6 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_color = p.color.value_or(_color);
_color.setViewOption(properties::Property::ViewOptions::Color);

View File

@@ -94,7 +94,6 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_color = p.color.value_or(_color);
_color.setViewOption(properties::Property::ViewOptions::Color);

View File

@@ -238,7 +238,7 @@ documentation::Documentation RenderableLabel::Documentation() {
}
RenderableLabel::RenderableLabel(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
: Renderable(dictionary, { .automaticallyUpdateRenderBin = false })
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _color(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
, _fontSize(FontSizeInfo, 50.f, 1.f, 100.f)
@@ -260,11 +260,10 @@ RenderableLabel::RenderableLabel(const ghoul::Dictionary& dictionary)
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_blendMode.addOptions({
{ BlendMode::Normal, "Normal" },
{ BlendMode::Additive, "Additive"}
{ BlendMode::Additive, "Additive" }
});
_blendMode.onChange([&]() {
switch (_blendMode) {

View File

@@ -297,7 +297,6 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary)
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
if (p.forceRenderInvisible.has_value()) {
_forceRenderInvisible = *p.forceRenderInvisible;
@@ -634,7 +633,7 @@ void RenderableModel::initializeGL() {
setBoundingSphere(_geometry->boundingRadius() * _modelScale);
// Set Interaction sphere size to be 10% of the bounding sphere
setInteractionSphere(_boundingSphere * 0.1);
setInteractionSphere(boundingSphere() * 0.1);
}
void RenderableModel::deinitializeGL() {

View File

@@ -181,7 +181,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
"Trying to use relative offsets for start node '{}' that has no "
"bounding sphere. This will result in no offset. Use direct "
"values by setting UseRelativeOffsets to false",
_parent->identifier(), _start
parent()->identifier(), _start
));
}
});
@@ -199,7 +199,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
"Trying to use relative offsets for end node '{}' that has no "
"bounding sphere. This will result in no offset. Use direct "
"values by setting UseRelativeOffsets to false",
_parent->identifier(), _end
parent()->identifier(), _end
));
}
});
@@ -212,7 +212,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
if (!startNode) {
LERROR(fmt::format(
"Error when recomputing node line offsets for scene graph node '{}'. "
"Could not find start node '{}'", _parent->identifier(), _start.value()
"Could not find start node '{}'", parent()->identifier(), _start.value()
));
return;
}
@@ -220,7 +220,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
if (!endNode) {
LERROR(fmt::format(
"Error when recomputing node line offsets for scene graph node '{}'. "
"Could not find end node '{}'", _parent->identifier(), _end.value()
"Could not find end node '{}'", parent()->identifier(), _end.value()
));
return;
}
@@ -229,8 +229,10 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
// Recompute previous offsets to relative values
double startBs = startNode->boundingSphere();
double endBs = endNode->boundingSphere();
_startOffset = startBs > 0.0 ? _startOffset / startBs : 0.0;
_endOffset = endBs > 0.0 ? _endOffset / startBs : 0.0;
_startOffset =
static_cast<float>(startBs > 0.0 ? _startOffset / startBs : 0.0);
_endOffset =
static_cast<float>(endBs > 0.0 ? _endOffset / startBs : 0.0);
}
else {
// Recompute relative values to meters

View File

@@ -113,7 +113,7 @@ documentation::Documentation RenderablePlane::Documentation() {
}
RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
: Renderable(dictionary, { .automaticallyUpdateRenderBin = false })
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
, _billboard(BillboardInfo, false)
, _mirrorBackside(MirrorBacksideInfo, false)
@@ -123,7 +123,6 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_size = p.size;
_billboard = p.billboard.value_or(_billboard);

View File

@@ -162,7 +162,6 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_size = p.size;
_segments = p.segments;
@@ -208,7 +207,6 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
addProperty(_disableFadeInDistance);
setBoundingSphere(_size);
setRenderBinFromOpacity();
}
bool RenderableSphere::isReady() const {

View File

@@ -164,7 +164,6 @@ RenderableTimeVaryingSphere::RenderableTimeVaryingSphere(
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(_opacity);
registerUpdateRenderBinFromOpacity();
_size = p.size;
_segments = p.segments;
@@ -208,7 +207,6 @@ RenderableTimeVaryingSphere::RenderableTimeVaryingSphere(
}
setBoundingSphere(_size);
setRenderBinFromOpacity();
}
bool RenderableTimeVaryingSphere::isReady() const {

View File

@@ -433,7 +433,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
);
const double distance = glm::distance(trailPosWorld, data.camera.eyePositionVec3());
if (distance > _boundingSphere * DISTANCE_CULLING_RADII) {
if (distance > boundingSphere() * DISTANCE_CULLING_RADII) {
// Reset
global::renderEngine->openglStateCache().resetBlendState();
global::renderEngine->openglStateCache().resetDepthState();