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 CANAD14N · Nov 04, 2013 at 04:37 PM · c#camerashaderrendertexture

Applying post-processing effects to RenderTextures

What I am trying to do is create a RenderTexture that exactly mimics the view from a camera and apply it to a plane that is scaled and position to take up the entire view of a second camera. The idea is the view from Camera_1, looking at an arbitrary scene, and the view from Camera_2, looking at a plane with a RenderTexture from Camera_1 applied to it, should be identical.

Currently I have this almost working using the Angry Bots example project from Unity 4.2.2f1 as my test. I have a "dummy" camera which is a child of Camera_1 and has the same view, except it renders to a target texture. I also dynamically scale and position a plane just in front of Camera_2 so that it takes up the entire view and apply the RenderTexture from Camera_1_Dummy to it. The results can be seen in the link below.

Camera_1 viewing the 3d scene

http://imgur.com/a/TFINf

Camera_2 viewing a plane with the RenderTexture from Camera_1_Dummy applied

alt text

As you can see, other than lighting issues, the RenderTexture is missing all the shader and post-processing effects that are applied to the view of Camera_1, namely the effects from the scripts MobileBloom, ReflectionFx, HeightDepthOfField, and ColorNoise that are attached to the Camera obeject. What I want is for the second picture to look EXACTLY like the first so that if I were to switch between the two cameras, the user wouldn't even notice.

I assume to do this, I need to somehow catch the RenderTexture after it has been updated by Camera_1_Dummy and before it has been displayed in the scene and then apply all the same effects to it? I haven't been able to find much information on the Camera rendering to RenderTexture flow. If anyone could tell me if it is even possible to do what I am asking, and if it is, how can I go about recreating the same image effects on the RenderTexture as I do for the actual camera. I was hoping there was a way to simply copy the view of the camera after all those effects have been added and use that as my texture but I haven't figured out how to do that yet.

TL;DR How to include all the shader/image/post-processing effects in a camera's targetTexture/RenderTexture?

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 CANAD14N · Nov 04, 2013 at 08:19 PM

Fixed. Overlooked the fact that the scripts attached to the Camera_1 which were responsible for the image effects were not attached to the Camera_1_Dummy object and therefore were not included in the RenderTexture. Attaching these scripts to the camera that is actually rendering to the texture fixed the problem. Apologies for the simple mistake.

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

15 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

Related Questions

What is the procedure of capturing a particular region using Render Texture 0 Answers

Unity Grabpass Feature 1 Answer

How to render a RenderTexture into a specific mipLevel 0 Answers

How to use Camera.RenderWithShader() to modify rendered image? 0 Answers

Distribute terrain in zones 3 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