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
0
Question by rioforce · Aug 20, 2013 at 03:07 PM · shaderfreeblurdepth of fieldreplacement shader

Depth of Field with Shader Replacement?

I am using Unity 4 free version. I saw this "shader replacement" in the Unity Asset store. I was wondering if I could use this shader replacement to make Depth of Field.

http://u3d.as/content/unity-technologies/shader-replacement/3zx

Here is what the description says:

Depth of Field A simple Depth-of-Field implementation. Shader replacement used to render blurriness factor of the scene.

Is there any way I can use these shaders for Depth of Field?

Thanks in advance! :D

Comment
Add comment · Show 1
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 Benproductions1 · Aug 21, 2013 at 05:31 AM 0
Share

AFAI$$anonymous$$ you need Pro to use "RenderWithShader"

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by CaptainScience · Oct 27, 2013 at 10:46 AM

This question is a bit old, but I will answer it anyway in case anyone else is wondering.

The answer is actually, yes, you can use this with Unity Free to create a "depth of field" effect. I've done it, but you can not do it as efficiently as you can with Unity Pro. In Unity Free, you do not have off-screen rendering (i.e. Render Textures), but you can replace them by simply rendering to the screen, ReadPixels() the framebuffer into a texture, and then clear the screen before rendering your final scene. The problem is that it requires a trip to the GPU to render the low res scene, back to the CPU when you read the pixels, and then BACK to the GPU when you Texture.Apply() the changes. This is for each pass BEFORE you even start rendering your final scene.

This makes it infeasible to do many full screen passes. Depending on your hardware you might get one or two with a reasonable frame rate, but that will be eating up a lot of your rendering budget. If you stick to, for example, 1/4 of the width and height of the screen, you can get four passes while only reading back a quarter of the screen. This may give you enough performance and render passes to create blur effects such as DOF (render one pass as depth with a replacement shader). There will be artifacts or ghosting created by using a lower resolution texture when applying a full-screen effect, but how severe they are will depend on your specific scene and the hardware you are targeting.

This technique would be most useful for things like refractions or reflections--create a very small texture and blur it. Even a very low quality refraction effect is better than none at all especially if it is highly distorted by a normal map. High quality full-screen effects (like tone-mapping or anti-aliasing) could be possible with sufficient hardware, but it may not be worth the opportunity cost of all the other geometry, effects, etc. you could be rendering instead.

I hope that makes sense, but the summary is: it is possible but very expensive.

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

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

17 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

Related Questions

How can I apply a blur effect to planes or textures in Unity Free? 2 Answers

How to blur the corners of the screen? 3 Answers

What exactly are replacement shaders? 1 Answer

How to blur entire scene but a specific spot? 2 Answers

UV offset in surface shader. 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