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 metaleap · Aug 07, 2013 at 11:13 PM · shaderpost-process-effectimage-effects

Are multiple Unity Pro "Image Effects" auto-combined into a single (or as few as possible) quad shaders?

I'm new to Unity but have dabbled in shader-based ("modern") OpenGL with GLSL previously. (Don't really grok shaders written in HLSL or Cg at present, though.)

Let's say I want to apply to the final HDR linear render texture:

  1. anti-aliasing (fxaa or other post technique, msaa is off globally)

  2. glow or bloom or some such

  3. tone-mapping

  4. Vignette + chromatic aberration

  5. gamma correction (since all prior RTT was in linear space for correct lighting calcs)

In GLSL, I would write a single fragment program ("pixel shader" in DX parlance) with 5 functions for those (or more for other effects) and in its main() would call the needed functions in the desired order.

In Unity, I can add those effects as Components to any Camera. Neat! But since I don't really grok the engine internals fully, right now I can't tell if Unity is smart enough to generate a single final pixel shader pass (or as few as strictly really necessary) for whatever effects combination is currently activated on the cam -- or worst case it has 5 individual post-fx shaders with each such pass processing the result of the previous post-fx shader pass.

So could anyone with more inside knowledge confirm how well Unity deals with this question?

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
1

Answer by byteprogramming · Aug 09, 2013 at 01:13 PM

These effects are written each for itself , there is no reason why Unity would try to be the smartass and change that. Each of the effects fetches pass and modifies it.

You could write your own post shader that combines them all.

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 tomekkie2 · Aug 09, 2013 at 01:23 PM 0
Share

$$anonymous$$eans the final output of multiple image effects depends also on the sequence how they are applied, right?

avatar image metaleap · Aug 09, 2013 at 01:36 PM 0
Share

tomekkie --- by necessity, this must be the case one way or the other.

Thanks byteprogram$$anonymous$$g! That's pretty discomforting to know for anyone with some basic knowledge of GPUs. Program switching is known to be costly, and about some 5-9 of the various post-FX are just must-have "bare necessities" --- in a 1080p scenario, that's quite a few 5+$$anonymous$$B render textures and color buffers in VRA$$anonymous$$, also eating into bandwidth.

Looks like cloning the shaders into a custom combined post shader will be necessary then.

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

16 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

Related Questions

Different between tex2D and SAMPLE_TEXTURE2D (Post Processing effect) 0 Answers

Image-Effect Shading the GUI? 1 Answer

Curved Screen Post Processing Effect 1 Answer

Render Texture Screen Effect: Custom Shader Not Tiling 0 Answers

c#, how to access Depth Of Field 34 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