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 relativegames · Dec 21, 2013 at 12:50 PM · renderingrendererdirectx 11

Why does Unity render everything twice ?

alt textI used GPU Perf Studio to analyze Unity's draw calls under DirectX11.

Remarks : - everything gets drawn twice into a render target the size of the resolution as if transparency is enabled on everything. Once with FrontCounterClockwise = true, and then false. The first time the pixel shader doesn't sample any texture, the second time, it does. What is this ? It's definetely not occlusion culling as I turned that off and I get the same results. All objects are drawn reverse order both times btw. - terrains are rendered 2 times, twice, and this is even weirder, I see the same draw call with the same vertex/pixel shader being called twice, once with DepthMask on, DepthTest On, the other with DepthMask off,DepthTest On and Blend on as if it had 2 passes. Why would it blend together the same mesh if I just have 1 pass in my custom terrain shader ? And I only got 2( or 5 ) brush textures while my GPU can support up to 32+ sampled textures ?

EDIT : I added 2 screenshots of the same object with the 2 different draw states & shaders. You can also see how it tries to resolve 3 multisampled textures. Special effects don't use multisampling, so 1 is the color buffer, 1 is depth, what's the third one ? It definitely looks like deferred rendering of some sorts even though I checked "Forward" everywhere, even in Player Settings.

drawcalls1.png (332.2 kB)
drawcalls2.png (305.9 kB)
Comment
Add comment · Show 3
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 Bunny83 · Dec 21, 2013 at 02:02 PM 0
Share

Additional lighting pass? What lighting model do you use?

avatar image relativegames · Dec 21, 2013 at 02:24 PM 0
Share

Forward rendering ?

avatar image nchang · May 20, 2014 at 08:43 AM 0
Share

I suppose you use deferred rendering path. The first draw call is for prepassbase, it just renders normal and specular. The second one is for prepassfinal, it renders albedo and emissive, as you said, with texture. But I have no idea about other behaviors.

0 Replies

· Add your reply
  • Sort: 

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

20 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

Related Questions

Weird rendering on Android: some materials become black, some sprites are replaced 1 Answer

Low Performance when drawing many objects 2 Answers

Render a camera multiple times in a single frame? 1 Answer

How to make a Brightness Adjust Screen? 1 Answer

Overlapping particle systems 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