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 hugo.tguerra · Aug 27, 2014 at 11:24 PM · texturesfreeblurdepth of fieldplanes

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

Hi, I'm developing a small game using planes in parallax and would like to fake a DOF effect to simulate depth. I've seen free effects but I'm not really happy with them. I really wanted to be able to apply some sort of gaussian blur on the planes or textures according to their distance from the camera. I don't need true DOF in this case.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by GraviterX · Aug 27, 2014 at 11:57 PM

I've used this and it works for what you need: http://forum.unity3d.com/threads/indieeffects-bringing-almost-aaa-quality-post-process-fx-to-unity-indie.198568/

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
avatar image
0

Answer by AlwaysSunny · Aug 27, 2014 at 11:36 PM

Short answer: You probably shouldn't.

Long answer: Assuming you're only going to do this once per image at Start() time - as opposed to once per frame which will melt your computer - the method is this:

  • Copy the texture into a new texture object

  • Read the pixel data into an array of pixels

  • Perform a box or gaussian blur operation on that array

  • Write the array back into the texture object you created

  • Apply the change using myTexture.Apply();

Box and gaussian blur algorithms are around here and there. Note that it'd be best to do this in your graphics editing program unless you absolutely have no choice. This is a very expensive operation.

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 Kiwasi · Aug 28, 2014 at 12:35 AM 0
Share

Reading and rewriting a texture every frame is very expensive. Though I've managed to do it on a scene with only a few textures involved for an overlay effect.

This is not my area of expertise, but shouldn't a shader be able to achieve this effect?

avatar image AlwaysSunny · Aug 28, 2014 at 12:54 AM 0
Share

If he wanted it to update every frame, yeah, I think a shader approach exists. But even on the GPU, blurring is too expensive to perform on multiple objects.

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

Depth of Field with Shader Replacement? 1 Answer

Unity corrupted; textures missing on run, letters missing in editor. 1 Answer

Blurred textures 0 Answers

Depth of field problem with transparent objects 1 Answer

How to blur my background 2 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