mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Bring back changes for transparency and added new error protection for big components.
This commit is contained in:
@@ -127,7 +127,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
_blendMode.onChange([&]() {
|
||||
switch (_blendMode) {
|
||||
case BlendModeNormal:
|
||||
setRenderBin(Renderable::RenderBin::Opaque);
|
||||
setRenderBinFromOpacity();
|
||||
break;
|
||||
case BlendModeAdditive:
|
||||
setRenderBin(Renderable::RenderBin::Transparent);
|
||||
@@ -137,6 +137,12 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
});
|
||||
|
||||
_opacity.onChange([&]() {
|
||||
if (_blendMode == BlendModeNormal) {
|
||||
setRenderBinFromOpacity();
|
||||
}
|
||||
});
|
||||
|
||||
if (dictionary.hasKey(BlendModeInfo.identifier)) {
|
||||
const std::string v = dictionary.value<std::string>(BlendModeInfo.identifier);
|
||||
if (v == "Normal") {
|
||||
|
||||
@@ -67,12 +67,14 @@ protected:
|
||||
virtual void bindTexture();
|
||||
virtual void unbindTexture();
|
||||
|
||||
protected:
|
||||
properties::OptionProperty _blendMode;
|
||||
|
||||
private:
|
||||
void createPlane();
|
||||
|
||||
properties::BoolProperty _billboard;
|
||||
properties::FloatProperty _size;
|
||||
properties::OptionProperty _blendMode;
|
||||
|
||||
ghoul::opengl::ProgramObject* _shader = nullptr;
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& di
|
||||
"RenderablePlaneImageLocal"
|
||||
);
|
||||
|
||||
addProperty(_blendMode);
|
||||
|
||||
_texturePath = absPath(dictionary.value<std::string>(TextureInfo.identifier));
|
||||
_textureFile = std::make_unique<ghoul::filesystem::File>(_texturePath);
|
||||
|
||||
|
||||
@@ -178,8 +178,10 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary)
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
{
|
||||
|
||||
setRenderBin(RenderBin::Overlay);
|
||||
addProperty(_opacity);
|
||||
registerUpdateRenderBinFromOpacity();
|
||||
//registerUpdateRenderBinFromOpacity();
|
||||
|
||||
_translation = Translation::createFromDictionary(
|
||||
dictionary.value<ghoul::Dictionary>(KeyTranslation)
|
||||
@@ -289,7 +291,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
if (usingFramebufferRenderer) {
|
||||
glDepthMask(false);
|
||||
//glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
}
|
||||
|
||||
const bool renderLines = (_renderingModes == RenderingModeLines) |
|
||||
|
||||
@@ -100,8 +100,8 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = {
|
||||
"RenderableType",
|
||||
"RenderableType",
|
||||
"This value specifies if the plane should be rendered in the Background,"
|
||||
"Opaque, Transparent, or Overlay rendering step."
|
||||
"This value specifies if the orbit should be rendered in the Background,"
|
||||
"Opaque, Transparent, or Overlay rendering step. Default is Transparent."
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -192,7 +192,7 @@ RenderableTrailOrbit::RenderableTrailOrbit(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
}
|
||||
else {
|
||||
setRenderBin(Renderable::RenderBin::Opaque);
|
||||
setRenderBin(Renderable::RenderBin::Overlay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user