I have 2 problems after I got 2018.2 0f2 ver. about ‘Render Texture’.
Firstly, when I build my project for mobile(I only had tests on iOS), background image in Render Texture is broken weirdly.
Secondly, when project starts, Camera for Render Texture is shown briefly very at the beginning.
However, everything works fine on Unity editor.
I’m sure this is not problem about script or graphic setting becasue when I went back to 2018.1 version everything works fine also.
Is this bug?
I searched for similar problem in this forum but there is no clear answer.
Same problem here. 2018.2 + LRP + Render Textures + Android (haven’t tested iOS) = broken.
Removing our LRP asset from Graphics Settings and manually reverting all of our materials “fixed” the issue. Anyone on the Unity side able to comment on potential fix/workaround? Thanks!
“Broken” is not enough information to say something useful.
At least a screenshot or a description of how it’s broken could help a lot
Submitting a bugreport would be the best option, of course.
Fire HD 10: main project, when rendering a render texture to raw image causes entire screen to go black (but game continues to run in background and remains interactable). Works fine on PC.
Galaxy Tab A: main project, rendering a render texture to raw image causes rendering to “freeze” (but game continues to run in background and remains interactable). Works fine on PC.
Galaxy Tab A: test project, rendering a render texture to raw image just didn’t show up at all (but no black screen or freeze!). Works fine on PC.
Using on-disk Render Textures (vs generated at runtime) - Failed
Testing different on-disk Render Texture settings - Failed
LRP 3.0.0-preview - Failed
Applying LRP material to Raw Image that render texture is bound to - Failed
Generate Shader Includes - Failed (UnauthorizedAccessException on GeometryUtils.cs.hlsl)
Actually NOT rendering camera to render texture but otherwise leaving everything exaclty the same - Success
Removing LRP asset from Graphics settings and hand-converting all materials back to standard shader - Success
NOTE: providing screenshots of the above won’t help as they would be of a black or frozen screen
NOTE 2: OnPostRender doesn’t seem to work (not called at all) in LRP projects. Tested in fresh LRP project.
NOTE 3: On Fire HD, when trying to render the render texture, lines similar to the following appear in the log (can post actual log later but all devices are currently unavailable):
My project has gone back to previous version of Unity 2018.1, so I can’t share anymore.
But I made a similar situation in version 2018.2 and it happens again.
Standard (default) render texture settings in our test case. I’ve attached a screenshot just in case. When created at runtime, I specified the same settings in code.
Camera settings are also attached. Nope, no post effects!
Notes:
Camera culling mask is set to only the content we want to be rendered in that camera (3 layers total)
The Field Camera script is simply a registration callback system for OnPostRender calls (which don’t work in LRP).
The camera target texture is set to a render texture made at runtime (as we’ve always done it), not the one on disk, which is why it shows no name in the field.
It’s nothing fancy. Works without LRP, doesn’t work with.
Thanks for the reply! Any suggestions would be greatly appreciated…
In my case, it happened on iOS(I didn’t check Android).
I tried to change all settings that I know on Unity edtior(not on code) but it took time too long for each testing because I had to build for mobile for each testing.
I submitted bug report to Unity. I’m going to tell you when they answer.
@matheus-cardoso : Unity - Scripting API: Texture.anisoLevel says that “The value range of this variable goes from 1 to 9, where 1 equals no filtering applied and 9 equals full filtering applied.”
I would suggest sending a bugreport anyway, since it shouldn’t crash.
Unfortunately our problem remains exactly as before: attempt to use a render target in the UI (with a raw image) causes the entire screen to go black. I’m on 2018.2.4f1 and have tried the suggestions above.
Anyone have any other suggestions? Being tied to standard rendering with no shader graph is cramping our style
I’m getting a similar issue. Since updating to Unity 2018.2.4 my bespoke depth render is black when running on Android, but looks fine in editor and on iOS (it was fine on Android using 2017.3). I’m rendering to a temporary depth render texture in OnPreCull using shader replacement.
Curiously, I captured some frames using the Graphics API Debugger (About · Graphics API Debugger), and the captured frame shows a correct depth render even though the device shows it as black…!? Like this…
Some more info on this… The built in _CameraDepthTexture render (created when a camera’s depthTextureMode is set to DepthTextureMode.Depth) shows up fine.
It’s the same format as my bespoke one, has the same resolution, uses the same shader replacement pass, and happens at the same time in the render stack (before the main render).
I’m not using that, no. I just tried setting the buffers but no change. It does sound similar to that bug though.
Something else which may be relevant… When I select one of the realtime shadow depth render draws in the Frame Debugger (under Shadows.RenderJobDir), it shows a broken, empty, dark grey square image. But when I select a subsequent opaque draw, the shadow shows up correctly on the object, so it was clearly rendered properly! Hard to say whether that’s an issue with the Frame Debugger or not.
So, I just found out the root cause for the issue I linked earlier. It’s related to rendering to a custom depth texture in general, so it will likely fix your issue.