diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-20 20:10:12 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-20 20:10:12 +0000 |
commit | a19011b730ac6d770e3b42cde3a10961495a417d (patch) | |
tree | a3d1e4de3c709167d226725ddd768a9ecd662ff5 /game/network/rail.cpp | |
parent | Common code between straight/curve network geometry shaders (diff) | |
download | ilt-a19011b730ac6d770e3b42cde3a10961495a417d.tar.bz2 ilt-a19011b730ac6d770e3b42cde3a10961495a417d.tar.xz ilt-a19011b730ac6d770e3b42cde3a10961495a417d.zip |
Implement basic network curve part shader
Diffstat (limited to 'game/network/rail.cpp')
-rw-r--r-- | game/network/rail.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp index efe4e2d..46c129b 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -155,8 +155,8 @@ RailLinkCurve::RailLinkCurve(NetworkLinkHolder<RailLinkCurve> & instances, const Link({a, normalize(arc.first + half_pi)}, {b, normalize(arc.second - half_pi)}, glm::length(RelativePosition3D(a->pos - c)) * arc_length(arc)), LinkCurve {c, glm::length(RelativePosition3D(ends[0].node->pos - c)), arc}, - instance {instances.vertices.acquire(ends[0].node->pos, ends[1].node->pos, c, round_sleepers(length / 2000.F))} - + instance {instances.vertices.acquire(ends[0].node->pos, ends[1].node->pos, c, round_sleepers(length / 2000.F), + half_pi - arc.first, half_pi - arc.second)} { if (glGenVertexArrays) { const auto & e0p {ends[0].node->pos}; @@ -198,7 +198,8 @@ template<> NetworkLinkHolder<RailLinkCurve>::NetworkLinkHolder() { VertexArrayObject {vao} .addAttribs<RailLinkCurve::Vertex, &RailLinkCurve::Vertex::a, &RailLinkCurve::Vertex::b, - &RailLinkCurve::Vertex::c, &RailLinkCurve::Vertex::textureRepeats>(vertices.bufferName()); + &RailLinkCurve::Vertex::c, &RailLinkCurve::Vertex::textureRepeats, &RailLinkCurve::Vertex::aangle, + &RailLinkCurve::Vertex::bangle>(vertices.bufferName()); } namespace { |