Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have shelves "made of" steel rods as a 3D-file. So a lot of virtual metal rods make up a cage. When cloning this in unity a few times even my fast computer can only show this in a choppy way. But using an opacity map yields a flat result, which I don't want. For realism purposes there should be cylinders or similar, i.e. real 3D objects or the impression of real 3D objects, at least in close range.

How could I do that with more shelves without making the frame rate drop considerately?

I found that even though I am using opacity maps(128 x 128) just ten shelves and even 3dsmax begins stuttering.

EDIT: I uploaded a demo, it's for Win, X86 and X64. Get it here: http://www.sockshare.com/file/08BD739BDF94601C You need the opensource 7zip to extract.

share|improve this question
6  
Almost all games make "realism" sacrifices for performance. –  Tetrad Apr 5 '13 at 13:15
add comment

4 Answers

You could use a combination of a opacity map with a normal map that gives the effect of round bars...

...or you could use the above with the combination of cylinders with far less geometry, say 6 sided or 8 sided.

share|improve this answer
    
I found that even though I am using opacity maps(128 x 128) just ten trolleys and even 3dsmax begins stuttering. –  Zurechtweiser Apr 6 '13 at 4:29
    
Main post updated. –  Zurechtweiser Apr 6 '13 at 18:39
add comment

This seems like a perfect time for LOD swapping. As in use a low resolution model with opacity maps when seen at a distance, and then swap in a more detailed cart when the camera gets close.

I mean, I'm assuming here that the shopping cart is somehow really important to the scene, because needing the metal rods to look super realistic seems pretty odd to me.

share|improve this answer
    
I found that even though I am using opacity maps(128 x 128) just ten trolleys and even 3dsmax begins stuttering. –  Zurechtweiser Apr 6 '13 at 4:29
    
Main post updated. –  Zurechtweiser Apr 6 '13 at 18:44
add comment

If you're going to have lots of individual metal rods, then you should be making them incredibly simple - they should be 6-sided cylinders at the absolute maximum (perhaps even 4). That is, of course, unless the camera is going to be super-zoomed-in on these trolley bars, but I can't think why.

LOD'ing (level-of-detail) is a good way to get around this problem. I'm not sure exactly how to implement this in unity, but it basically involves the concept of having two (or more) versions of the asset - basic and detailed versions. Ideally you should swap to the basic versions when the camera is a certain distance away from it, and then back to the high-quality version when the camera gets closer.

I would also be concerned with the effect this has on light-mapping. You might find performance increase if you have the metal bars not cast any shadows. That is of course, just a further suggestion.

Edit: You said your polycount was over 200,000 - which is extremely high. You'll need to simplify your geometry to make it run smoother. Try and look at the model at how the player will be looking at it - eg, put the detail only where the player will notice it. Try and bring the polycount down as much as possible.

share|improve this answer
    
It is already implemented, only inside the paid version, just LOD you have 3 stages, and 3 different models with an adjustable distance for each LOD stage –  Mikolaj Marcisz Apr 5 '13 at 21:11
    
I found that even though I am using opacity maps(128 x 128) just ten trolleys and even 3dsmax begins stuttering. –  Zurechtweiser Apr 6 '13 at 4:29
    
Could you provide a polycount? –  Teifi Apr 6 '13 at 8:16
    
How do I determine the polycount? PS: Main post updated. –  Zurechtweiser Apr 6 '13 at 18:44
    
@Zurechtweiser Is it a model imported from a 3d package? Or is it raw geometry in unity? If its an imported model then you should be able to find out in the whatever package you used to model it. If its a geometry object in unity, then... I can't remember off the top of my head without reinstalling it! –  Teifi Apr 6 '13 at 19:18
show 9 more comments

Do you really need a high resolution mesh of your shopping cart?

You could also use a model looking more or less like a simple box and apply textures which are transparent at positions where no rods are. Which technique to use depends on how detailed the model should be. But if the player don't take too close looks on the model, I advice you to use the latter approach since it is much faster.

Otherwise you could only minify the vertices of your mesh to increase performance, I guess. You could also combine both approaches by providing one of them depending on how far the camera is away from the shopping cart. This is called level of detail.

share|improve this answer
    
Exactly, I'll also note that the level of detail in unity stands for the LOD and it is supported by Unity Pro –  Mikolaj Marcisz Apr 5 '13 at 21:09
    
I found that even though I am using opacity maps(128 x 128) just ten trolleys and even 3dsmax begins stuttering. –  Zurechtweiser Apr 6 '13 at 4:36
    
Main post updated. –  Zurechtweiser Apr 6 '13 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.