diff --git a/data/assets/examples/animation.asset b/data/assets/examples/animation.asset index 69a3b14451..55af363650 100644 --- a/data/assets/examples/animation.asset +++ b/data/assets/examples/animation.asset @@ -30,7 +30,7 @@ local animationLoop = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Animated Model example (LoopFromStart)", @@ -59,7 +59,7 @@ local animationLoopInf = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Animated Model example (LoopInfinitely)", @@ -88,7 +88,7 @@ local animationOnce = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Animated Model example (Once)", @@ -117,7 +117,7 @@ local animationBounceInf = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Animated Model example (BounceInfinitely)", @@ -146,7 +146,7 @@ local animationBounce = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Animated Model example (BounceFromStart)", diff --git a/data/assets/examples/approachevents.asset b/data/assets/examples/approachevents.asset index ceac006790..248bc10875 100644 --- a/data/assets/examples/approachevents.asset +++ b/data/assets/examples/approachevents.asset @@ -37,7 +37,7 @@ local obj = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, InteractionSphere = 1000.0, OnApproach = { "os.example.generic" }, diff --git a/data/assets/examples/modelshader/modelshader.asset b/data/assets/examples/modelshader/modelshader.asset index 969d3521cb..ab747c8917 100644 --- a/data/assets/examples/modelshader/modelshader.asset +++ b/data/assets/examples/modelshader/modelshader.asset @@ -25,7 +25,7 @@ local model = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true, + EnableFaceCulling = true, VertexShader = asset.localResource("model_vs.glsl"), FragmentShader = asset.localResource("model_fs.glsl"), }, @@ -39,9 +39,9 @@ local model = { asset.onInitialize(function() openspace.addSceneGraphNode(model) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(model) end) - + asset.export(model) diff --git a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset index 43fe0fcec8..de8aae2960 100644 --- a/data/assets/scene/milkyway/objects/orionnebula/nebula.asset +++ b/data/assets/scene/milkyway/objects/orionnebula/nebula.asset @@ -58,7 +58,7 @@ local OrionNebulaModel = { Type = "RenderableModel", GeometryFile = sync .. "orion_nebula.obj", Opacity = 1.0, - DisableFaceCulling = false, + EnableFaceCulling = true, SpecularIntensity = 0.0, AmbientIntensity = 0.0, DiffuseIntensity = 1.0, @@ -93,7 +93,7 @@ local OrionNebulaShocksModel = { Type = "RenderableModel", GeometryFile = sync .. "orishocks.obj", Opacity = 1.0, - DisableFaceCulling = false, + EnableFaceCulling = true, SpecularIntensity = 0.0, AmbientIntensity = 0.0, DiffuseIntensity = 1.0, @@ -129,7 +129,7 @@ local OrionNebulaProplydsModel = { Type = "RenderableModel", GeometryFile = sync .. "proplyds.obj", Opacity = 1.0, - DisableFaceCulling = false, + EnableFaceCulling = true, SpecularIntensity = 0.0, AmbientIntensity = 0.0, DiffuseIntensity = 1.0, @@ -158,14 +158,14 @@ asset.onInitialize(function() openspace.addSceneGraphNode(OrionNebulaShocksModel) openspace.addSceneGraphNode(OrionNebulaProplydsModel) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(OrionNebulaProplydsModel) openspace.removeSceneGraphNode(OrionNebulaShocksModel) openspace.removeSceneGraphNode(OrionNebulaModel) openspace.removeSceneGraphNode(NebulaHolder) end) - + asset.export(NebulaHolder) asset.export(OrionNebulaModel) asset.export(OrionNebulaShocksModel) diff --git a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset index 4623d140ce..53614c802d 100644 --- a/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset +++ b/data/assets/scene/solarsystem/missions/apollo/15/apollo15.asset @@ -44,7 +44,7 @@ local Apollo15 = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, TimeFrame = { Type = "TimeFrameInterval", @@ -84,11 +84,11 @@ asset.onInitialize(function() openspace.addSceneGraphNode(Apollo15) openspace.addSceneGraphNode(Apollo15Trail) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(Apollo15Trail) openspace.removeSceneGraphNode(Apollo15) end) - + asset.export(Apollo15) asset.export(Apollo15Trail) diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset index ea4b2e8cb4..27b9134e5d 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation2.asset @@ -49,7 +49,7 @@ local Station2Boulder1Model = { } }, PerformShading = false, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Station 2 Boulder 1 Model", @@ -98,7 +98,7 @@ local Station2Boulder2Model = { } }, PerformShading = false, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Station 2 Boulder 2 Model", @@ -147,7 +147,7 @@ local Station2Boulder3Model = { } }, PerformShading = false, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Station 2 Boulder 3 Model", @@ -166,7 +166,7 @@ asset.onInitialize(function() openspace.addSceneGraphNode(node) end end) - + asset.onDeinitialize(function() for i = #nodes, 1, -1 do local node = nodes[i] diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset index 65683ec844..310b4aca4b 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation6.asset @@ -60,7 +60,7 @@ local Station6Frag1Model = { } }, PerformShading = false, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Station 6 Fragment 1 Model", @@ -110,7 +110,7 @@ local Station6Frag2Model = { } }, PerformShading = false, - DisableFaceCulling = true, + EnableFaceCulling = true, }, GUI = { Name = "Station 6 Fragment 2 Model", @@ -148,7 +148,7 @@ local Station6Frag3Model = { } }, PerformShading = false, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Station 6 Fragment 3 Model", @@ -166,7 +166,7 @@ asset.onInitialize(function() openspace.addSceneGraphNode(node) end end) - + asset.onDeinitialize(function() for i = #nodes, 1, -1 do local node = nodes[i] diff --git a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset index f9016a794c..62bcfe0030 100644 --- a/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset +++ b/data/assets/scene/solarsystem/missions/apollo/17/bouldersstation7.asset @@ -49,7 +49,7 @@ local Station7BoulderModel = { } }, PerformShading = false, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "Station 7 Boulder Model", @@ -61,11 +61,11 @@ asset.onInitialize(function() openspace.addSceneGraphNode(Station7BoulderHolder) openspace.addSceneGraphNode(Station7BoulderModel) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(Station7BoulderModel) openspace.removeSceneGraphNode(Station7BoulderHolder) end) - + asset.export(Station7BoulderHolder) asset.export(Station7BoulderModel) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset index c66dfd8dc4..946b72ad4f 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/launch_model.asset @@ -56,7 +56,7 @@ local Apollo8LaunchModel = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Hidden = true, @@ -69,11 +69,11 @@ asset.onInitialize(function() openspace.addSceneGraphNode(Apollo8Launch) openspace.addSceneGraphNode(Apollo8LaunchModel) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(Apollo8LaunchModel) openspace.removeSceneGraphNode(Apollo8Launch) end) - + asset.export(Apollo8Launch) asset.export(Apollo8LaunchModel) diff --git a/data/assets/scene/solarsystem/missions/apollo/8/model.asset b/data/assets/scene/solarsystem/missions/apollo/8/model.asset index c3ada29c00..3f941633c7 100644 --- a/data/assets/scene/solarsystem/missions/apollo/8/model.asset +++ b/data/assets/scene/solarsystem/missions/apollo/8/model.asset @@ -68,7 +68,7 @@ local Apollo8Model = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Hidden = true, @@ -98,13 +98,13 @@ asset.onInitialize(function() openspace.addSceneGraphNode(Apollo8Model) openspace.addSceneGraphNode(Apollo8Pivot) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(Apollo8Pivot) openspace.removeSceneGraphNode(Apollo8Model) openspace.removeSceneGraphNode(Apollo8) end) - + asset.export(Apollo8) asset.export(Apollo8Model) asset.export(Apollo8Pivot) diff --git a/data/assets/scene/solarsystem/missions/jwst/jwst.asset b/data/assets/scene/solarsystem/missions/jwst/jwst.asset index cefeb1e481..77ae6df0d6 100644 --- a/data/assets/scene/solarsystem/missions/jwst/jwst.asset +++ b/data/assets/scene/solarsystem/missions/jwst/jwst.asset @@ -77,7 +77,7 @@ local JWSTModel = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Name = "James Webb Space Telescope Model", diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset index dfaece1cf8..e8fc60e900 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset @@ -61,7 +61,7 @@ local issModel = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, Tag = { "earth_satellite", "ISS" }, GUI = { diff --git a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset index 031336a8b3..fae852e832 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/deimos.asset @@ -44,7 +44,7 @@ local Deimos = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, Tag = { "moon_solarSystem", "moon_terrestrial", "moon_mars" }, GUI = { @@ -80,12 +80,12 @@ asset.onInitialize(function() openspace.addSceneGraphNode(Deimos) openspace.addSceneGraphNode(DeimosTrail) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(DeimosTrail) openspace.removeSceneGraphNode(Deimos) end) - + asset.export(Deimos) asset.export(DeimosTrail) diff --git a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset index 2749acc643..3e874ed09a 100644 --- a/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset +++ b/data/assets/scene/solarsystem/planets/mars/moons/phobos.asset @@ -45,7 +45,7 @@ local Phobos = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true + EnableFaceCulling = true }, Tag = { "moon_solarSystem", "moon_terrestrial", "moon_mars" }, GUI = { @@ -82,12 +82,12 @@ asset.onInitialize(function() openspace.addSceneGraphNode(Phobos) openspace.addSceneGraphNode(PhobosTrail) end) - + asset.onDeinitialize(function() openspace.removeSceneGraphNode(PhobosTrail) openspace.removeSceneGraphNode(Phobos) end) - + asset.export(Phobos) asset.export(PhobosTrail) diff --git a/data/assets/scene/solarsystem/sssb/itokawa.asset b/data/assets/scene/solarsystem/sssb/itokawa.asset index e53c6466b1..f7e59f18c0 100644 --- a/data/assets/scene/solarsystem/sssb/itokawa.asset +++ b/data/assets/scene/solarsystem/sssb/itokawa.asset @@ -68,7 +68,7 @@ local ItokawaModel = { sun.LightSource }, PerformShading = true, - DisableFaceCulling = true, + EnableFaceCulling = true, SpecularIntensity = 0.0 }, GUI = { diff --git a/data/assets/util/asset_helper.asset b/data/assets/util/asset_helper.asset index 20ada1e52a..e905aea16c 100644 --- a/data/assets/util/asset_helper.asset +++ b/data/assets/util/asset_helper.asset @@ -170,7 +170,7 @@ local createModelPart = function (parent, sunLightSourceNode, models, geometry, GeometryFile = models .. "/" .. geometry .. ".obj", LightSources = lightSources, PerformShading = performShading, - DisableFaceCulling = true + EnableFaceCulling = true }, GUI = { Hidden = true diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 7873386ab0..bc1afd2ce7 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -114,10 +114,10 @@ namespace { "of the Sun" }; - constexpr openspace::properties::Property::PropertyInfo DisableFaceCullingInfo = { - "DisableFaceCulling", - "Disable Face Culling", - "Disable OpenGL automatic face culling optimization" + constexpr openspace::properties::Property::PropertyInfo EnableFaceCullingInfo = { + "EnableFaceCulling", + "Enable Face Culling", + "Enable OpenGL automatic face culling optimization" }; constexpr openspace::properties::Property::PropertyInfo ModelTransformInfo = { @@ -139,10 +139,10 @@ namespace { "A list of light sources that this model should accept light from" }; - constexpr openspace::properties::Property::PropertyInfo DisableDepthTestInfo = { - "DisableDepthTest", - "Disable Depth Test", - "Disable Depth Testing for the Model" + constexpr openspace::properties::Property::PropertyInfo EnableDepthTestInfo = { + "EnableDepthTest", + "Enable Depth Test", + "Enable Depth Testing for the Model" }; constexpr openspace::properties::Property::PropertyInfo BlendingOptionInfo = { @@ -236,8 +236,8 @@ namespace { // [[codegen::verbatim(ShadingInfo.description)]] std::optional performShading; - // [[codegen::verbatim(DisableFaceCullingInfo.description)]] - std::optional disableFaceCulling; + // [[codegen::verbatim(EnableFaceCullingInfo.description)]] + std::optional enableFaceCulling; // [[codegen::verbatim(ModelTransformInfo.description)]] std::optional modelTransform; @@ -249,8 +249,8 @@ namespace { std::optional> lightSources [[codegen::reference("core_light_source")]]; - // [[codegen::verbatim(DisableDepthTestInfo.description)]] - std::optional disableDepthTest; + // [[codegen::verbatim(EnableDepthTestInfo.description)]] + std::optional enableDepthTest; // [[codegen::verbatim(BlendingOptionInfo.description)]] std::optional blendingOption; @@ -279,7 +279,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) , _diffuseIntensity(DiffuseIntensityInfo, 1.f, 0.f, 1.f) , _specularIntensity(SpecularIntensityInfo, 1.f, 0.f, 1.f) , _performShading(ShadingInfo, true) - , _disableFaceCulling(DisableFaceCullingInfo, false) + , _enableFaceCulling(EnableFaceCullingInfo, true) , _modelTransform( ModelTransformInfo, glm::dmat3(1.0), @@ -287,7 +287,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) glm::dmat3(1.0) ) , _rotationVec(RotationVecInfo, glm::dvec3(0.0), glm::dvec3(0.0), glm::dvec3(360.0)) - , _disableDepthTest(DisableDepthTestInfo, false) + , _enableDepthTest(EnableDepthTestInfo, true) , _blendingFuncOption( BlendingOptionInfo, properties::OptionProperty::DisplayType::Dropdown @@ -415,8 +415,8 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) _diffuseIntensity = p.diffuseIntensity.value_or(_diffuseIntensity); _specularIntensity = p.specularIntensity.value_or(_specularIntensity); _performShading = p.performShading.value_or(_performShading); - _disableDepthTest = p.disableDepthTest.value_or(_disableDepthTest); - _disableFaceCulling = p.disableFaceCulling.value_or(_disableFaceCulling); + _enableDepthTest = p.enableDepthTest.value_or(_enableDepthTest); + _enableFaceCulling = p.enableFaceCulling.value_or(_enableFaceCulling); if (p.vertexShader.has_value()) { _vertexShaderPath = p.vertexShader->string(); @@ -445,8 +445,8 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) addProperty(_diffuseIntensity); addProperty(_specularIntensity); addProperty(_performShading); - addProperty(_disableFaceCulling); - addProperty(_disableDepthTest); + addProperty(_enableFaceCulling); + addProperty(_enableDepthTest); addProperty(_modelTransform); addProperty(_rotationVec); @@ -760,11 +760,11 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { break; }; - if (_disableDepthTest) { + if (!_enableDepthTest) { glDisable(GL_DEPTH_TEST); } - if (_disableFaceCulling) { + if (!_enableFaceCulling) { glDisable(GL_CULL_FACE); } @@ -778,14 +778,14 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { // Render Pass 1 // Render all parts of the model into the new framebuffer without opacity const float o = opacity(); - if ((o >= 0.f && o < 1.f) || _disableDepthTest) { + if ((o >= 0.f && o < 1.f) || !_enableDepthTest) { setRenderBin(Renderable::RenderBin::PostDeferredTransparent); } else { setRenderBin(_originalRenderBin); } - bool shouldRenderTwice = !_disableFaceCulling && _geometry->isTransparent(); + bool shouldRenderTwice = _enableFaceCulling && _geometry->isTransparent(); int nPasses = shouldRenderTwice ? 2 : 1; for (int i = 0; i < nPasses; ++i) { if (shouldRenderTwice) { @@ -804,7 +804,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { _geometry->render(*_program); } - if (_disableFaceCulling) { + if (!_enableFaceCulling) { glEnable(GL_CULL_FACE); } _program->deactivate(); diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index ca84a6b61c..dae6d9709e 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -93,11 +93,11 @@ private: properties::FloatProperty _specularIntensity; properties::BoolProperty _performShading; - properties::BoolProperty _disableFaceCulling; + properties::BoolProperty _enableFaceCulling; properties::DMat4Property _modelTransform; properties::Vec3Property _rotationVec; - properties::BoolProperty _disableDepthTest; + properties::BoolProperty _enableDepthTest; properties::OptionProperty _blendingFuncOption; std::string _vertexShaderPath;