diff --git a/src/common/rendering/hwrenderer/data/hw_levelmesh.h b/src/common/rendering/hwrenderer/data/hw_levelmesh.h index 21f6cb52d..6959d8cbf 100644 --- a/src/common/rendering/hwrenderer/data/hw_levelmesh.h +++ b/src/common/rendering/hwrenderer/data/hw_levelmesh.h @@ -22,7 +22,7 @@ struct SurfaceInfo // This is the structure of the buffer inside the shader struct PortalInfo // This is the structure of the buffer inside the shader { - float transformation[16]; // mat4 + float transformation[16]; // mat4 }; namespace hwrenderer diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index eb02f6268..3d1d258dd 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -491,6 +491,20 @@ int DoomLevelMesh::SetupLightmapUvs(int lightmapSize) sortedSurfaces.push_back(&surface); } + { + this->portalInfo.Clear(); // TODO portals + + PortalInfo portalInfo; + hwrenderer::Portal portal; + + for (int i = 0; i < 16; ++i) + { + portalInfo.transformation[i] = (&portal.transformation[0][0])[i]; + } + + this->portalInfo.Push(portalInfo); + } + for (const auto& surface : Surfaces) { auto hwSurface = std::make_unique(); @@ -517,6 +531,14 @@ int DoomLevelMesh::SetupLightmapUvs(int lightmapSize) // TODO push surfaces.push_back(std::move(hwSurface)); + + SurfaceInfo info; + info.Normal = FVector3(surface.plane.Normal()); + info.PortalIndex = 0; + info.SamplingDistance = surface.sampleDimension; + info.Sky = surface.bSky; + + surfaceInfo.Push(info); } std::sort(sortedSurfaces.begin(), sortedSurfaces.end(), [](Surface* a, Surface* b) { return a->texHeight != b->texHeight ? a->texHeight > b->texHeight : a->texWidth > b->texWidth; });