Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by Sondre-S · May 03, 2015 at 06:29 PM · optimizationshadowscombinemeshes

Reduce number of shadowcasters

My racing game runs at 69/70 fps when shadows are turned off, but when turned on the stats shows that there are over 600 shadowcasters in the scene(mostly all of them in my car object) and the framerate drops from 70 to 35-42.

The car mesh has lots of child game objects/child meshes. I guess this is the reason why there are tons of shadow casters. So I guess I should combine the car object(ideally to one single mesh). However using the CombineChildren script makes one mesh per material and does'nt seem to affect this at all...

Thanks in advance

Comment
Add comment · Show 2
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 Dave-Hampson ♦♦ · May 04, 2015 at 07:30 AM 0
Share

What's the question exactly, how do you combine models in Blender?

avatar image Sondre-S · May 04, 2015 at 09:54 AM 0
Share

Thanks for the reply, well, the main question is: "how can I reduce the number of shadowcasters". Just disabling the "cast shadows" option does'nt seem to affect this number or the frame rate at all, so I guess I have to combine as many meshes as possible. I tried to join the car mesh in blender, by selecting all geometry and join it(ctrl+j) and then export to Fbx.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Sondre-S · May 04, 2015 at 05:44 PM

Okay, so I was able to get the bumber of shadow casters down to 143(now with a FPS of 100(!)) by joining the mesh in Blender.

Comment
Add comment · Show 2 · 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 haim96 · May 04, 2015 at 05:46 PM 0
Share

well done! :)

avatar image Sondre-S · May 04, 2015 at 05:51 PM 0
Share

Thanks:), howeverthe blender export got some strange artifacts but, I have created a new separate question for that. Just solved one problem and another one appears:)

avatar image
1

Answer by haim96 · May 04, 2015 at 10:15 AM

i would try another approach, instead of combine meshes, create dummy mesh in shape of the car bottom side and make it the only shadow caster. make sure that the rest of the car don't receive\cast shadows so the shadows from that dummy mesh will fall on the track and not the car it self. hide the dummy inside the car, close to track.

if this for a mobile this should do the job...

and if using real time shadows is still heavy for your game there several solutions for faking shadows. i'm using one of these and it real performance booster.

Comment
Add comment · Show 3 · 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 Sondre-S · May 04, 2015 at 10:38 AM 0
Share

Hi, thanks, I should have mentioned earlier it is a PC game.

I'm using the car physics pack UnityCar, and the test models that comes with that package runs smoothly at about 80 FPS with both real time shadows and real time reflections enabled, even tough they have a higher poly count than my models. The difference is they are only one big mesh with different materials.

That dummy thing was actually not a bad idea, I'll try that. The thing is it seems no matter how many mesh filters I uncheck "cast shadows" on, it does not affect the number of shadow casters...

And I should clarify this: I'm testing my car model in the exact same scene as the UnityCar model, so the only difference is my car model.

avatar image haim96 · May 04, 2015 at 10:56 AM 0
Share

how many shadow caster do you see when running unity's scene with the original car?

avatar image Sondre-S · May 04, 2015 at 11:14 AM 0
Share

the stats shows 135 shadow casters in the scene with the UnityCar test mesh, if I replace the test mesh with my own mesh, it shows 1400 shadow casters. If I add the CombineChildren.cs script to my car mesh it drops to 343 shadow casters.

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

21 People are following this question.

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

Related Questions

Lightchanel's: Tell a light what objects it does effect in runtime 0 Answers

Need Help with Dynamically Building a Mesh 0 Answers

Framerate drops from 60 to 20 because of meshrenderer? 0 Answers

Real soft shadow vs "illusion" shadow 0 Answers

Unity Blob shadow projector massive tris amount, why? 1 Answer


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