Home Technical Talk

How to optimize big repetitive object - like rails

ArYeS
polycounter lvl 8
Offline / Send Message
ArYeS polycounter lvl 8
I'm making a model of real world track and I'm having problem with modeling railing. I made one segment of railing, like this:
railwip1.jpg

Model by itself is great and could be bended at several angles to create modular set.

But this track that I'm making is not flat and straight at all and making railing using modular set is just not good enough.
I have tried in Maya doing array of these segments and bending them on curve.

Works perfect, but now I'm stuck with long 50-100k triangle object, which looks great, but preformance wise is probably not good.

I'm using UDK and trying to achive best level od details possible for modern race track model.

Is there any way I could segment this mesh so LOD would work separatly for each segment and I will not have to position 300 different railing models by hand?

Is there any smarter way of doing this whole process?

Replies

  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    Spline loft actors are what you want. This deforms a straight mesh into a bent one in the editor.

    http://udn.epicgames.com/Three/UsingSplineLoftActors.html

    The downside to spline loft actors is that they don't come with collision. You'll have to put some blocking volumes around them if you want collision.
  • gsokol
    Offline / Send Message
    gsokol polycounter lvl 14
    You could cut the larger object into a few smaller pieces...so Instead of having 300 sections have maybe 15-20 larger sections, that way they can still lod, but you aren't trying to instance 300 times, and its less objects that you have to place.


    You could see if there is a way to deform a mesh along a spline in UDK...I'm unsure if thats possible right out of the box, but a lot of times roads and rails are handled by having them follow a spline. I searched quickly, but couldn't find a definite answer here. I wonder if anybody else has an answer to this?


    Edit: sprunghunt came from the future to answer this question already :P
  • Computron
    Offline / Send Message
    Computron polycounter lvl 7
    Learn something new in UDK everyday. Are there any other cool actors like this? Anything similar to spline decals in cryengine?
  • ArYeS
    Offline / Send Message
    ArYeS polycounter lvl 8
    @sprunghunt Thats amazing, I have to test it out a bit. But from what I read you can deform only 1 mesh per spline. I will probably have to make one bigger segment (maybe 10x current one) and manually place one by one, but since I have just like 800m of road that won't be such a problem. I will also have to model railing collision mesh, but that shouldn't be a problem, it's just polygon strip.

    Thanks! I will report how this worked out.

    @gsokol Thanks, bigger segments will be needed indeed :)
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    ArYeS wrote: »
    @sprunghunt Thats amazing, I have to test it out a bit. But from what I read you can deform only 1 mesh per spline.

    it's 1 mesh per spline loft actor.

    But if you connect multiple spline loft actors together it stitches them together to make a continuous surface. Think of each actor as being a single control point on a spline.

    For example; to make a half circle you'd need 3 spline loft actors. This would make two copies of the assigned mesh.
  • ArYeS
    Offline / Send Message
    ArYeS polycounter lvl 8
    Again thanks :) Will try today and post test results here.
  • ArYeS
    Offline / Send Message
    ArYeS polycounter lvl 8
    Here is a test from today:
    splineloftactortest.jpg

    Some things to note:
    -avoid angles over 90°, meshes tend to explode
    -avoid up-and-down S splines, mesh bends inside and outside when changing height and angle. When you change angle and height at same time you have to fix "roll" manually in actor settings.
    -Be patient, things tend to explode if you don't watch your spline carefully :)
  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    ArYeS wrote: »
    -Be patient, things tend to explode if you don't watch your spline carefully :)

    A lot of this has to do with the "world xDir" value. It can take a bit of fiddling to get the right one. And in many cases it's better to just alter your mesh direction instead of trying to adjust the xDir to fit the mesh.
  • Akai
    Offline / Send Message
    Akai polycounter lvl 10
    I was doing the same type of model ArYeS, and wow i will try Spline loft actors. Thank you!
  • Butthair
    Offline / Send Message
    Butthair polycounter lvl 11
    You may not need that amount of polygons for many static objects as you would be passing by them pretty fast I'm assuming. It might be worth it to also further optimize the meshes and rely more on stronger normals to push the features. They player would be seeing it a rate of a blur and also be more focused on staying on the road or getting by another racer.

    For instance GTA4 which has a great amount a detail from previous, but if you stare long enough, only areas that the player is intended to go slow or stop in would be more detailed. Otherwise polygons were largely devoted to vehicles and people.
Sign In or Register to comment.