Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Tseng · Sep 27, 2011 at 09:12 PM · linerendererbatchingtrailrendererdynamic batching

Alternative to LineRenderer/TrailRenderer

Hello,

I'm trying to make some lasershots/projectiles for a top downshooter and I've found LineRenderer to be pretty nice for lasers/laser shots, however each LineRenderer will cause a drawcall, which is deadly in a top down shooter with high number of shots on the scene, so this will definitely kill performance on Smartphones.

So I need some replacement to the LineRenderer which will allow dynamical batching? Or a wait to make the LineRenderer work with dynamic batching.

I setup a multi laser shot (5 shots at once) but it's causing 5 draw calls, even though they all use the same material. Any ideas?

Regards Tseng

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image syclamoth · Sep 28, 2011 at 12:19 AM 0
Share

'A' drawcall? Out of thousands? Well, you could always write your own line renderer that works in a similar way, but with systems to make sure you only use one mesh per material...

avatar image Tseng · Sep 28, 2011 at 12:26 AM 1
Share

Yea well... if you run a Unity Game on a smartphone, you have to $$anonymous$$imize the draw calls drastically! In my other game I increased performance by around 100% by reducing the draw calls from ~90-120-ish to less than 40. With 120 draw calls I had around 20 fps. Now the game runs with 40-50 fps.

I just did the error to first build and test it as a webplayer, everything was working fine there because PC had powerful CPU and GPU, but on a Smartphone its different. It took me like 4 weeks to change half of the game assets to dynamically batch which was great performance boost on Smartphones.

So I see this beco$$anonymous$$g a problem, if I have my space ship shooting 5 lasers at once and doing like 10-15 shots (on "autofire), that quickly sums up to 50+ calls only for the lasers not even considering the other enemies, their shots and environment

avatar image syclamoth · Sep 28, 2011 at 12:36 AM 0
Share

Well, that's pretty serious. I would recommend using just mesh renderers and coding them so they stretch like a line renderer would! If your game is top-down only, you don't even have to worry about facing the camera.

avatar image Ludus · Oct 26, 2011 at 12:03 AM 0
Share

I'm running into a similar problem, did you ever find a solution Tseng?

avatar image Tseng · Oct 26, 2011 at 12:14 AM 0
Share

No, not really. I just went and made the laser projectiles as sprites and use 2D Toolkit to generate the atlas for it. However, this doesn't solve the trail problem

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by ErikKalkoken · Dec 15, 2014 at 11:20 AM

The performance of the LineRenderer is terrible. I have about 15.000 lines in my oculus rift app that are generated by script and it was impossible to keep the needed 75 FPS. But I found a better solution and now create them by myself with meshes and its lightning fast.

See this link to a great article to learn how it works: 3 ways to draw 3D lines in Unity3D

Two remarks to the article:

  1. In spite of what the article saysyou can indeed use the graphics class with unity free (Tested with 4.6)

  2. Instead of using DrawMesh calls in Update() I attached the meshes to game objects instead (with MeshFilter). That gives you more flexibility and seams to be just as fast.

Hope this helps.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jjxtra · May 18, 2015 at 03:23 PM 0
Share

Does graphics class work on iOS / Android?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Dynamic batching line renderer 1 Answer

Easy way to tell how many attributes a particular shader uses? 0 Answers

Draw trail behind player when its not moving 0 Answers

More Objects and less draw calls? Or Fewer Objects and more draw calls? 1 Answer

Drawing and saving during gameplay 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges