mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-07 03:49:43 -05:00
Code cleanup branch (#618)
* Make height map fallback layer work again * Add documentation to joystick button bindings * Removed grouped property headers * Add new version number constant generated by CMake * Make Joystick deadzone work properly * Change the startup date on Earth to today * Fix key modifier handling * Add debugging indices for TreeNodeDebugging * Fix script schedule for OsirisRex * Do not open Mission schedule automatically * Upload default projection texture automatically * General code cleanup * Fix check_style_guide warnings * Remove .clang-format * MacOS compile fixes * Clang analyzer fixes
This commit is contained in:
@@ -47,7 +47,7 @@ namespace {
|
||||
BlendModeAdditive
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo BillboardInfo = {
|
||||
const openspace::properties::Property::PropertyInfo BillboardInfo = {
|
||||
"Billboard",
|
||||
"Billboard mode",
|
||||
"This value specifies whether the plane is a billboard, which means that it is "
|
||||
@@ -55,13 +55,13 @@ namespace {
|
||||
"transformations."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo SizeInfo = {
|
||||
const openspace::properties::Property::PropertyInfo SizeInfo = {
|
||||
"Size",
|
||||
"Size (in meters)",
|
||||
"This value specifies the size of the plane in meters."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo BlendModeInfo = {
|
||||
const openspace::properties::Property::PropertyInfo BlendModeInfo = {
|
||||
"BlendMode",
|
||||
"Blending Mode",
|
||||
"This determines the blending mode that is applied to this plane."
|
||||
@@ -103,10 +103,6 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
, _billboard(BillboardInfo, false)
|
||||
, _size(SizeInfo, 10.f, 0.f, 1e25f)
|
||||
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _shader(nullptr)
|
||||
, _quad(0)
|
||||
, _vertexPositionBuffer(0)
|
||||
, _planeIsDirty(false)
|
||||
{
|
||||
documentation::testSpecificationAndThrow(
|
||||
Documentation(),
|
||||
@@ -226,19 +222,17 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
_shader->setUniform("texture1", unit);
|
||||
|
||||
bool usingFramebufferRenderer =
|
||||
OsEng.renderEngine().rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::Framebuffer;
|
||||
bool usingFramebufferRenderer = OsEng.renderEngine().rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::Framebuffer;
|
||||
|
||||
bool usingABufferRenderer =
|
||||
OsEng.renderEngine().rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::ABuffer;
|
||||
bool usingABufferRenderer = OsEng.renderEngine().rendererImplementation() ==
|
||||
RenderEngine::RendererImplementation::ABuffer;
|
||||
|
||||
if (usingABufferRenderer) {
|
||||
_shader->setUniform("additiveBlending", _blendMode == BlendModeAdditive);
|
||||
}
|
||||
|
||||
bool additiveBlending = _blendMode == BlendModeAdditive && usingFramebufferRenderer;
|
||||
bool additiveBlending = (_blendMode == BlendModeAdditive) && usingFramebufferRenderer;
|
||||
if (additiveBlending) {
|
||||
glDepthMask(false);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
@@ -259,7 +253,6 @@ void RenderablePlane::bindTexture() {}
|
||||
|
||||
void RenderablePlane::unbindTexture() {}
|
||||
|
||||
|
||||
void RenderablePlane::update(const UpdateData&) {
|
||||
if (_shader->isDirty()) {
|
||||
_shader->rebuildFromFile();
|
||||
@@ -267,7 +260,6 @@ void RenderablePlane::update(const UpdateData&) {
|
||||
|
||||
if (_planeIsDirty) {
|
||||
createPlane();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,14 +279,7 @@ void RenderablePlane::createPlane() {
|
||||
glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertexData), vertexData, GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(0);
|
||||
glVertexAttribPointer(
|
||||
0,
|
||||
4,
|
||||
GL_FLOAT,
|
||||
GL_FALSE,
|
||||
sizeof(GLfloat) * 6,
|
||||
nullptr
|
||||
);
|
||||
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, nullptr);
|
||||
|
||||
glEnableVertexAttribArray(1);
|
||||
glVertexAttribPointer(
|
||||
|
||||
Reference in New Issue
Block a user