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
2
Question by GivingTales · Jun 30, 2015 at 12:30 PM · guirendertexture5.0.1p4

Unity UI + RenderTexture broken since 5.0.1p4

In our project one of the scenes we use a Camera with some sprites and a Canvas set to Screen Space - Camera. The contents of the camera is rendered into a RenderTexture that is put onto a procedural mesh and another main camera sees that mesh. We call the Camera.Render() in LateUpdate to render the texture. Until 5.0.1p3 this works fine. (Except an already known bug: it has to be rendered twice to get the UI elements properly. Any ideas when that will be fixed?) However the main problem is that after 5.0.1p4 the UI elements doesn't get rendered to the texture at all. They are shown properly in the scene view but they are somehow not in the rendering pipeline anymore. Tried to call the Render() method in normal Update, or yield until WaitForEndOfFrame and call it there. Tried OnPreRender, OnPostRender whatever I could find, but nothing. We are stuck and cannot upgrade any further (no fix so far in the upcoming versions). Any ideas what might have caused this? I don't see any rendering core or UI related change in the 5.0.1p4 changelog. Shall I file a bug report or is this a known problem?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by johnseghersmsft · Jul 29, 2015 at 12:43 AM

Have you tried simply setting the camera which renders to the texture to have a lower (numerically) Camera Depth? This will force it to be rendered by the normal rendering chain prior to rendering the camera that should see the rendered texture.

This has been working for me.

Comment
Add comment · Show 1 · 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 Zhu Xiaoyi · Jan 31, 2016 at 12:36 PM 0
Share

Thanks man. It works.

avatar image
0

Answer by GivingTales · Jul 08, 2015 at 09:05 AM

I filed a bug. Until it is resolved if anyone knows a temporary workaround, let me know!

Comment
Add comment · Show 5 · 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 marco-we · Sep 11, 2015 at 01:53 PM 0
Share

I'm having the same issue. Has this bug been resolved?

avatar image GivingTales marco-we · Sep 14, 2015 at 08:12 AM 1
Share

Hi, you can follow the ticket here: http://issuetracker.unity3d.com/issues/rendertexture-unity-does-not-render-ui-images-into-rendertextures

However, I have received a mail from the Unity $$anonymous$$m just recently, that it will only be included in the 5.3.0 release. So let's hope for a patch release in the mean time, just look for 710195 being fixed.

avatar image Michael_Squiers GivingTales · Sep 23, 2015 at 03:40 AM 0
Share

Hi, I had this problem too. I was trying to get text from an Input Field and place into the scene. I was going to use a RenderTexture and go from there. If you just wanted text I would recommend FlyingText3DLink. With this asset you can turn text into a 3d mesh into the world. I tried unity's Text$$anonymous$$esh and the results weren't good.

Show more comments
avatar image
0

Answer by LoungeKatt · May 10, 2017 at 10:29 PM

This is a known issue with Unity. You can find more details at:

https://forum.unity3d.com/threads/rendertexture-not-working-on-ios-and-android-unity-4-2-0f4.192561/

https://forum.unity3d.com/threads/render-texture-not-working-on-device-unity-5-2-1f1.358483/

https://forum.unity3d.com/threads/render-texture-works-in-editor-but-not-on-devices-after-upgrade-to-unity-5.362397/

and a few others where the moderators and staff claim it is fixed in a future release or (with a touch of unnecessary arrogance) that the issue is the user and a bug never existed at all.

BUT

This is going to sound silly, but add an ImageEffect to the main camera. I have made a dummy effect that is attached to my main camera and without any logical explanation, it fixes RenderTexture on mobile.

DummyEffect.cs:

 using UnityEngine;
 
 [ExecuteInEditMode]
 [AddComponentMenu("Image Effects/Dummy Effect")]
 public class DummyEffect : ImageEffectBase {
 
     // Called by camera to apply image effect
     void OnRenderImage (RenderTexture source, RenderTexture destination) {
         Graphics.Blit (source, destination, material);
     }
 }

DummyEffect.shader:

 Shader "Hidden/Dummy Effect" {
 Properties {
     _MainTex ("Base (RGB)", RECT) = "white" {}
 }
 
 SubShader {
     Pass {
         ZTest Always Cull Off ZWrite Off
         Fog { Mode off }
 
 CGPROGRAM
 #pragma vertex vert_img
 #pragma fragment frag
 #pragma fragmentoption ARB_precision_hint_fastest
 #include "UnityCG.cginc"
 
 uniform sampler2D _MainTex;
 
 float4 frag (v2f_img i) : COLOR {
     return tex2D(_MainTex, i.uv);
 }
 ENDCG
 
     }
 }
 
 Fallback off
 
 }
Comment
Add comment · Show 3 · 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 lopezmramon · Jul 11, 2017 at 02:19 PM 0
Share

Hello. You have an "ImageEffectBase" from which your Dummy Effect inherits. Where can I find that? I am looking everywhere for the RenderTexture fix and I saw you're posting in a couple places about it.

I apppreciate the help.

avatar image lopezmramon · Jul 11, 2017 at 02:28 PM 0
Share

Never$$anonymous$$d. I found it - had to download the legacy image effects. Currently testing...

avatar image lopezmramon · Jul 11, 2017 at 02:37 PM 0
Share

Weirdly, it doesn't work for me. I'll have to give up Render Textures, I suppose. Ugh.

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

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Render RenderTexture in OnGUI 0 Answers

Trouble with drawing a RenderTexture in the GUI 0 Answers

Custom GUI System RenderTexture (Ortographic Cam) vs Perspective 2 Answers

what concept is used here ? 1 Answer

Drawing GUI on Editor Window Preview Render 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