summaryrefslogtreecommitdiff
path: root/game/scenary/illuminator.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-03-30 13:04:36 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-31 00:37:24 +0100
commitfb78c88576d9fed90ee69dfa35a9fbd3179ff486 (patch)
tree3666e8c7a7ebf56b5d9e6919093c3a9c7766a750 /game/scenary/illuminator.cpp
parentUse uint32_t for indexes in InstanceVertices (diff)
downloadilt-fb78c88576d9fed90ee69dfa35a9fbd3179ff486.tar.bz2
ilt-fb78c88576d9fed90ee69dfa35a9fbd3179ff486.tar.xz
ilt-fb78c88576d9fed90ee69dfa35a9fbd3179ff486.zip
Use a single buffer for the location/rotation data of all renderable objects
Removes the BufferedLocation and BufferedLocationUpdater mess. Note: appears to break bogie rendering in asset factory test only, same symptom as broken network render test? (out of date buffer data)
Diffstat (limited to 'game/scenary/illuminator.cpp')
-rw-r--r--game/scenary/illuminator.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/game/scenary/illuminator.cpp b/game/scenary/illuminator.cpp
index 4398853..e991baa 100644
--- a/game/scenary/illuminator.cpp
+++ b/game/scenary/illuminator.cpp
@@ -11,8 +11,8 @@ std::weak_ptr<glVertexArray> Illuminator::commonInstanceVAO, Illuminator::common
std::any
Illuminator::createAt(const Location & position) const
{
- return std::make_shared<InstanceVertices<LocationVertex>::InstanceProxy>(
- instances.acquire(position.getRotationTransform(), position.pos));
+ return std::make_shared<InstanceVertices<InstanceVertex>::InstanceProxy>(
+ instances.acquire(locationData->acquire(position)));
}
bool
@@ -46,8 +46,7 @@ Illuminator::postLoad()
glDebugScope _ {0};
if (!(instanceVAO = commonInstanceVAO.lock())) {
commonInstanceVAO = instanceVAO = std::make_shared<glVertexArray>();
- bodyMesh->configureVAO(*instanceVAO, 0)
- .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1);
+ bodyMesh->configureVAO(*instanceVAO, 0).addAttribs<InstanceVertex, &InstanceVertex::location>(1);
}
if (!spotLight.empty()) {
if (!(instancesSpotLightVAO = commonInstancesSpotLightVAO.lock())) {
@@ -55,7 +54,7 @@ Illuminator::postLoad()
instancesSpotLightVAO->configure()
.addAttribs<SpotLightVertex, &SpotLightVertex::position, &SpotLightVertex::direction,
&SpotLightVertex::colour, &SpotLightVertex::kq, &SpotLightVertex::arc>(0)
- .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1);
+ .addAttribs<InstanceVertex, &InstanceVertex::location>(1);
}
std::transform(
spotLight.begin(), spotLight.end(), std::back_inserter(spotLightInstances), [this](const auto & s) {
@@ -68,7 +67,7 @@ Illuminator::postLoad()
instancesPointLightVAO->configure()
.addAttribs<PointLightVertex, &PointLightVertex::position, &PointLightVertex::colour,
&PointLightVertex::kq>(0)
- .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1);
+ .addAttribs<InstanceVertex, &InstanceVertex::location>(1);
}
std::transform(
pointLight.begin(), pointLight.end(), std::back_inserter(pointLightInstances), [this](const auto & s) {