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
0
Question by zhuce · Jul 05, 2016 at 06:33 PM · lightingforward rendering

additional pass for each per pixel light in forward rendering

Why need additional draw call for each per pixel light in forward rendering? Why not just upload all lights information into constant buffer ,and loop through all of them in pixel shader and add up the result?

It seems UE is doing so. Any particular reason unity3d not doing forward in such a way?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tanoshimi · Jul 05, 2016 at 06:37 PM

Because that's how forward rendering works: it is more efficient for mobile devices, better at transparency, but more costly if you have a lot of per-pixel lights.

Note that UE4 does not support forward rendering - it only has a deferred rendering pipeline. If you want that behaviour, just switch Unity to deferred rendering mode :)

https://docs.unity3d.com/Manual/RenderingPaths.html

https://docs.unity3d.com/Manual/RenderTech-ForwardRendering.html

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 zhuce · Jul 06, 2016 at 06:16 PM 0
Share

If having hundreds of thousands lights, it make sense to go for deferred lighting to pay the tax of fat gbuffer and no-$$anonymous$$SAA support. But with only few lights, forward is sure a better choice. $$anonymous$$y question is not about why using forward lighting, it is about why unity3d implement it in this way. One forwardbase(one pixel light, N vertex light, lightprobe, lightmap) + N forwardadd( per additional pixel lights). Is there any reason not done it in one pass by uploading light info into constant buffer as much as possible. Is there any kind of reason like, on mobile hardware one extra draw call doesn't cost that much than mapping data into constant buffer, or it is just we like to do so because it make the code easy to implement and maintain. :)

Good to know UE4 only support deferred lighting :). But from this forward lighting shader, https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Shaders/BasePassForForwardShadingPixelShader.usf It looks like trying to not shade with only one light per draw.

avatar image zhuce · Jul 06, 2016 at 06:25 PM 0
Share

I really am curious about why 'because that's how it works' that way, just like how deferred lighting is done in the engine, why still do point light and spot light as geometry, rather than go for tiled based deferred lighting. I think there may be some good reasons, like the engine supports a wide range of platform from very low end to high end, the choice is to be able to support as much as possible. :)

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Lighting error in Forward Rendering with vertex shader 0 Answers

How do you stop shadows from casting through meshes? 0 Answers

Profiling: "FFWD Lights" costs 17% performance 0 Answers

How to remove shadow from a particular object on a some other particular object in unity 0 Answers

How can I make particles receive light? (Not HDRP or LWRP) 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