After upgrade 2018.2, 'Render Texture' is not working only in mobile(iOS)

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.

Please, help. I spend whole day…


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 :slight_smile:
Submitting a bugreport would be the best option, of course.

Sorry, figured it was already a known issue as I can’t seem to get them to work even in a fresh LRP project on Android.

Environment:
2018.2.0f2
SDK 28.0.1
JDK 1.8.0_181
LRP 2.0.5-preview

Results:

  • 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.

Some of the things tested:

  • Modifying LRP asset settings (removing HDR, etc) - Failed

  • 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 :slight_smile:

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):

  • unexpected struct parameter ‘unity_Builtins2Array[1].unity_SHCArray’

3574353--288503--LRP Definition.PNG

What’s the RT format and what are tha camera settings?
Does this camera have post effects?

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.

This is the Unity project file for test. It’s very simple project.
https://drive.google.com/file/d/1AqZwdnjfmCiYP7BSXGi2nM67Y-oE6ZVB/view?usp=sharing

Sorry, I am kind of newbie on Unity and I’m not a professional developer, so I don’t know which part of code or bugreport should I submit.

I think there would be not error message because it works fine on Unity editor. It happens only on mobile.

I attached image also.
The grey square is the broken part. It shoud be clean.

Thank you for helping!

3574400--288515--IMG_6405.PNG.jpg

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…

3574414--288530--Camera Settings.PNG
3574414--288531--RT Settings.PNG

This is the preferred way for us to work with bugs.
You can submit a bug report with the simple test project you’ve created.

Yes, doesn’t look like anything should be broken there. Can you try looking into what’s happening using RenderDoc?
Or just submit a bugreport :slight_smile:

We’re facing the same problem. When I try to open the project in an Android device I got this error in the logs:

                  CRASH  E  signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr b72e8850
                         E  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
                         E  Build fingerprint: 'motorola/titan_retbr_ds/titan_umtsds:6.0/MPB24.65-34-3/3:user/release-keys'
                         E  Revision: 'p400'
                         E  pid: 17207, tid: 17259, name: UnityMain  >>> com.mycompany.app <<<
                         E      r0 00000001  r1 b72e8770  r2 00000003  r3 b9344100
                         E      r4 3f800000  r5 b92e8770  r6 00000000  r7 00000000
                         E      r8 9fb271e4  r9 00000000  sl b9a61c6c  fp 9fb26c88
                         E      ip 9fc81308  sp 9fb26b58  lr a02a18a8  pc a05479d8  cpsr b3f06c90
                         E  backtrace:
                         E      #00  pc 00a1f9d8  /data/app/com.mycompany.app-1/lib/arm/libunity.so
                         E      #01  pc 007798a4  /data/app/com.mycompany.app-1/lib/arm/libunity.so
                         E      #02  pc 0074b280  /data/app/com.mycompany.app-1/lib/arm/libunity.so
                         E      #03  pc 00007a08   ( (wrapper managed-to-native) UnityEngine.Texture:set_anisoLevel (UnityEngine.Texture,int) {0xba678d28} + 0x50 (0x915449b8 0x91544a68) [0x9da5af00 - Unity Root Domain]+31240)
                         E  memory near r1:
                         E      b72e8750 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8760 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8770 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8780 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8790 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e87a0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e87b0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e87c0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e87d0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e87e0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e87f0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8800 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8810 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8820 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8830 ffffffff ffffffff ffffffff ffffffff  ................
                         E      b72e8840 ffffffff ffffffff ffffffff ffffffff  ................
                         E  memory near r3:
                         E      b93440e0 b93440d0 00130000 74497b20 2c7d6d65  .@4..... {Item},
                         E      b93440f0 71655320 00000493 9fb27930 00000000   Seq....0y......
                         E      b9344100 9fb26bb8 b9346ad0 00000000 00000000  .k...j4.........
                         E      b9344110 00000000 00000000 00000000 00000000  ................
                         E      b9344120 00000000 9939b8e8 00000000 00000000  ......9.........
                         E      b9344130 00000000 00000000 00000000 00000000  ................
                         E      b9344140 00000000 00000000 00000000 00000000  ................
                         E      b9344150 00000000 00000000 00000000 00000000  ................
                         E      b9344160 00000000 00000000 00000000 00000000  ................
                         E      b9344170 00000000 00000000 00000000 00000000  ................
                         E      b9344180 00000000 00000000 00000000 00000000  ................
                         E      b9344190 00000000 00000000 00000000 00000000  ................
                         E      b93441a0 00000000 00000000 00000000 00000000  ................
                         E      b93441b0 00000000 00000000 00000000 00000000  ................
                         E      b93441c0 00000000 00000000 00000000 00000000  ................
                         E      b93441d0 00000000 00000000 00000000 00000000  ................
                         E  memory near r4:
                         E      3f7fffe0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f7ffff0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800000 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800010 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800020 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800030 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800040 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800050 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800060 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800070 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800080 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f800090 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f8000a0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f8000b0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f8000c0 ffffffff ffffffff ffffffff ffffffff  ................
                         E      3f8000d0 ffffffff ffffffff ffffffff ffffffff  ................
                         E  memory near r5:
                         E      b92e8750 b92e8744 00000000 00000000 00000000  D...............
                         E      b92e8760 00000000 000004db 00000004 00000979  ............y...
                         E      b92e8770 00000000 65726441 28206f6e 20294d54  ....Adreno (TM)
                         E      b92e8780 00353033 0000000f 00000044 00000000  305.....D.......
                         E      b92e8790 6c617551 6d6d6f63 00000000 00000000  Qualcomm........
                         E      b92e87a0 00000008 00000044 b96ab800 0000002b  ....D.....j.+...
                         E      b92e87b0 00000000 00000000 00000000 0000002b  ............+...
                         E      b92e87c0 00000044 b96ab9d0 0000002b 00000000  D.....j.+.......
                         E      b92e87d0 00000000 00000000 0000002b 00000044  ........+...D...
                         E      b92e87e0 b96ab960 0000001d 00000000 00000000  `.j.............
                         E      b92e87f0 00000000 0000001d 00000044 00000000  ........D.......
                         E      b92e8800 00000000 000006eb 00000001 43800000  ...............C
                         E      b92e8810 00000001 00000001 00000010 00000020  ............ ...
                         E      b92e8820 00000000 00001000 00001000 00001000  ................
                         E      b92e8830 00000100 00000004 00000000 00010001  ................
                         E      b92e8840 00000101 00000000 00000001 00010001  ................
                         E  memory near r8:
                         E      9fb271c4 00000000 00000000 00000001 00000000  ................
                         E      9fb271d4 b9a61c6c b9a61c70 a038a424 ba4bb600  l...p...$.8...K.
                         E      9fb271e4 00000000 ba4488a0 b9a61c50 ba4bb500  ......D.P.....K.
                         E      9fb271f4 ba4bb600 b9a61c70 a0389408 ba4488a0  ..K.p.....8...D.
                         E      9fb27204 a0147c58 b91e54d0 00000000 a03893b8  X|...T........8.
                         E      9fb27214 a0d4dd94 00000001 ffffff72 00000000  ........r.......
                         E      9fb27224 00000000 00000000 00000000 ba67eb20  ............ .g.
                         E      9fb27234 ba67e88c ba67eb5c 0000000b ba67eb20  ..g.\.g..... .g.
                         E      9fb27244 00000000 9fb27344 9fb27258 00000000  ....Ds..Xr......
                         E      9fb27254 a0366fc0 ba6f4570 00000048 0000004b  .o6.pEo.H...K...
                         E      9fb27264 b6d02ddd a0d4c700 b9282728 0000005d  .-......('(.]...
                         E      9fb27274 ba67dee0 0000000f 0000000f 0000001e  ..g.............
                         E      9fb27284 ba6f4570 ba67dee0 a0d4c748 ba67def0  pEo...g.H.....g.
                         E      9fb27294 a0d4c700 ba67dee0 a0d4c700 00000227  ......g.....'...
                         E      9fb272a4 a0b4603d 00000046 9ffa8d90 0000000c  =`..F...........
                         E      9fb272b4 00001c20 ba67def0 9ffa8d1c 00001c20   .....g..... ...
                         E  memory near sl:
                         E      b9a61c4c 00000079 a0cfebd8 00001238 17500026  y.......8...&.P.
                         E      b9a61c5c 00000000 ffffffff 00000000 00000000  ................
                         E      b9a61c6c 00000031 00000000 ba4bb840 ba4bb500  1.......@.K...K.
                         E      b9a61c7c ba4bb380 00000007 ba4bb500 00000003  ..K.......K.....
                         E      b9a61c8c 0000000b 00008008 00000000 00000058  ............X...
                         E      b9a61c9c 00000013 b9a648c8 a13ff424 00000000  .....H..$.?.....
                         E      b9a61cac 0000001b b9a648c8 b9a648c8 b991dbf0  .....H...H......
                         E      b9a61cbc 00000000 00000018 00000043 00000081  ........C.......
                         E      b9a61ccc 06005ca4 b9a5fa80 b9a61a40 9a9f9289  .\......@.......
                         E      b9a61cdc 7fff9000 00000000 00000000 00000000  ................
                         E      b9a61cec b9a5cea0 b9a5fa58 00000000 b927b140  ....X.......@.'.
                         E      b9a61cfc 00000000 00000040 0000002b 00000015  ....@...+.......
                         E      b9a61d0c 44000d0c 0288080e 0e44018e 0a980238  ...D......D.8...
                         E      b9a61d1c 44080e44 0000000b 00000000 00000028  D..D........(...
                         E      b9a61d2c 00000023 99839478 ffff0001 06400000  #...x.........@.
                         E      b9a61d3c b9a5c050 b6d37f08 b6d37f08 00000020  P........... ...
                         E  memory near fp:
                         E      9fb26c68 00000000 92b19e60 9fb271e4 00000000  ....`....q......
                         E      9fb26c78 b9a61c6c 9fb26c88 9fb26c88 9154432c  l....l...l..,CT.
                         E      9fb26c88 00000000 00000000 00000000 9da5af00  ................
                         E      9fb26c98 9fb26cbc 99866b98 9fb26cbc 9939ef84  .l...k...l....9.
                         E      9fb26ca8 9fb26ef8 b9eaf1d0 9fb26ef8 ba256f28  .n.......n..(o%.
                         E      9fb26cb8 9157fc50 00000500 000002d0 9fb271e4  P.W..........q..
                         E      9fb26cc8 00000000 9fb271e4 9fb26cd8 9df44d74  .....q...l..tM..
                         E      9fb26cd8 00000000 00000000 00000000 00000000  ................
                         E      9fb26ce8 9fb26cfc 00000000 92b19e60 9fb270a0  .l......`....p..
                         E      9fb26cf8 9fb271e4 915442c0 9fb271e4 9fb271e4  .q...BT..q...q..
                         E      9fb26d08 9fb26e8c 993a0cd8 9fb26ef8 00000000  .n....:..n......
                         E      9fb26d18 9fb271e4 9fb270a0 92b19e60 b9d963a0  .q...p..`....c..
                         E      9fb26d28 00000000 00000002 00000000 00000000  ................
                         E      9fb26d38 00000000 00000000 00000000 00000000  ................
                         E      9fb26d48 00000000 00000000 00000000 00000000  ................
                         E      9fb26d58 00000000 00000000 00000000 00000000  ................
                         E  memory near ip:
                         E      9fc812e8 13510000 0a000001 e5910024 e12fff1e  ..Q.....$...../.
                         E      9fc812f8 e92d4800 eb22971b e1a0e00f ea22ad30  .H-...".....0.".
                         E      9fc81308 e3500000 15902008 13520000 0a000001  ..P.. ....R.....
                         E      9fc81318 e1a00002 ea17ee82 e92d4800 eb229711  .........H-...".
                         E      9fc81328 e1a0e00f ea22ad26 e3500000 15901008  ....&."...P.....
                         E      9fc81338 13510000 0a000001 e5910028 e12fff1e  ..Q.....(...../.
                         E      9fc81348 e92d4800 eb229707 e1a0e00f ea22ad1c  .H-...".......".
                         E      9fc81358 e3500000 15902008 13520000 0a000001  ..P.. ....R.....
                         E      9fc81368 e1a00002 ea17ee75 e92d4800 eb2296fd  ....u....H-...".
                         E      9fc81378 e1a0e00f ea22ad12 e92d4010 e24dd008  ......"..@-...M.
                         E      9fc81388 e3500000 e1a04001 15901008 13510000  ..P..@........Q.
                         E      9fc81398 0a000007 e5910000 e5902068 e1a0000d  ........h ......
                         E      9fc813a8 e12fff32 e89d0003 e8840003 e28dd008  2./.............
                         E      9fc813b8 e8bd8010 eb2296eb e1a0e00f ea22ad00  ......".......".
                         E      9fc813c8 e3500000 15901008 13510000 0a000001  ..P.......Q.....
                         E      9fc813d8 e1a00001 ea17ca87 e92d4800 eb2296e1  .........H-...".
                         E  memory near sp:
                         E      9fb26b38 00000000 00000000 00000000 00000000  ................
                         E      9fb26b48 ba6eb280 9fb26bb8 9fb26bb4 994c28e0  ..n..k...k...(L.
                         E      9fb26b58 ba6eb2a0 3f800000 00000000 00000000  ..n....?........
                         E      9fb26b68 9fb26c88 a02a18a8 ba6eb280 ba6eb2a0  .l....*...n...n.
                         E      9fb26b78 00000000 a0273284 9fb26b94 9da61f20  .....2'..k.. ...
                         E      9fb26b88 9158aa80 00000000 99866b98 9fb271e4  ..X......k...q..
                         E      9fb26b98 00000000 00000000 9fb271e4 00000000  .........q......
                         E      9fb26ba8 9fb26c88 91544a0c 9157fc50 a1210090  .l...JT.P.W...!.
                         E      9fb26bb8 b9346ad0 b9344100 ba678ca0 9fb26bb0  .j4..A4...g..k..
                         E      9fb26bc8 915449f4 9fb26c88 9fb26c04 b9af4a68  .IT..l...l..hJ..
                         E      9fb26bd8 99866b98 9fb271e4 9fb26ef8 b92d0c80  .k...q...n....-.
                         E      9fb26be8 b9eaf1d0 9da5af6c b9eaf1d0 9da5af84  ....l...........
                         E      9fb26bf8 9fb26ca4 00000000 9fb26c24 9939db88  .l......$l....9.
                         E      9fb26c08 00000007 9da5af00 00000000 b9106ad8  .............j..
                         E      9fb26c18 9fb26c3c 00000000 9df44d00 9da5af00  <l.......M......
                         E      9fb26c28 b9106ad8 9fb26c3c 9df44d00 9da5af00  .j..<l...M......
                         E  code around pc:
                         E      a05479b8 e8bd8800 e92d48f0 e1a04001 e1a05000  .....H-..@...P..
                         E      a05479c8 e3540000 0a000013 e0851104 e3a00001  ..T.............
                         E      a05479d8 e59110e0 e1110210 11a00004 18bd88f0  ................
                         E      a05479e8 e1a07210 e1a06004 e1a00006 ebf41fa3  .r...`..........
                         E      a05479f8 e5900014 e1500004 11500006 0a000005  ......P...P.....
                         E      a0547a08 e0851100 e1a06000 e59110e0 e1110007  .....`..........
                         E      a0547a18 0afffff4 e8bd88f0 e3a00000 e8bd88f0  ................
                         E      a0547a28 e92d4830 e1a02001 e59f1078 e1a04000  0H-.. ..x....@..
                         E      a0547a38 e3a00000 e08f1001 e7913180 e1530002  .........1....S.
                         E      a0547a48 0a000007 e2800001 e3500016 bafffff9  ..........P.....
                         E      a0547a58 e59f0054 e08f1000 e1a00004 eb01ed5a  T...........Z...
                         E      a0547a68 e8bd8830 e59f1044 e3a02000 e3a03044  0...D.... ..D0..
                         E      a0547a78 e5842000 e08f1001 e5842014 e0810180  . ....... ......
                         E      a0547a88 e5843018 e5c42004 e5905004 e1a00005  .0... ...P......
                         E      a0547a98 ebd8bede e1a02000 e1a00004 e1a01005  ..... ..........
                         E      a0547aa8 ebdc7eab e8bd8830 007be710 0069880f  .~..0.....{...i.
                         E  code around lr:
                         E      a02a1888 e1a04000 e59f003c e08f0000 e7905181  .@..<........Q..
                         E      a02a1898 eb0a8db2 e1a01005 e3a02003 eb0a9844  ......... ..D...
                         E      a02a18a8 e1a05000 eb0a8dad e1a01005 e3a02001  .P........... ..
                         E      a02a18b8 e3a03000 e3a06000 eb0a9829 e3500000  .0...`..).....P.
                         E      a02a18c8 05846000 e8bd8070 009d6bd8 e92d4070  .`..p....k..p@-.
                         E      a02a18d8 e1a04000 e59f003c e08f0000 e7905181  .@..<........Q..
                         E      a02a18e8 eb0a8d9e e1a01005 e3a02000 e3a06000  ......... ...`..
                         E      a02a18f8 eb0a982f e1a05000 eb0a8d98 e1a01005  /....P..........
                         E      a02a1908 e3a02001 e3a03000 eb0a9815 e3500000  . ...0........P.
                         E      a02a1918 05846000 e8bd8070 009d7a18 00000000  .`..p....z......
                         E      a02a1928 00000000 00000000 e92d4ff0 e24dd02c  .........O-.,.M.
                         E      a02a1938 e1a08002 e1a06000 e286200c e1a09001  .....`... ......
                         E      a02a1948 e8920007 e1a0a003 e3520003 e59db05c  ..........R.\...
                         E      a02a1958 e1a04002 e1a05001 c3004003 e3520000  .@...P...@....R.
                         E      a02a1968 b3004000 e3510003 c3005003 e3510000  .@....Q..P....Q.
                         E      a02a1978 b3005000 e3500003 e1a07000 c3007003  .P....P..p...p..
           MessageQueue  E  IdleHandler threw exception
                         E  java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr b72e8850
                         E  Build fingerprint: 'motorola/titan_retbr_ds/titan_umtsds:6.0/MPB24.65-34-3/3:user/release-keys'
                         E  Revision: 'p400'
                         E  pid: 17207, tid: 17259, name: UnityMain  >>> com.mycompany.app <<<
                         E      r0 00000001  r1 b72e8770  r2 00000003  r3 b9344100
                         E      r4 3f800000  r5 b92e8770  r6 00000000  r7 00000000
                         E      r8 9fb271e4  r9 00000000  sl b9a61c6c  fp 9fb26c88
                         E      ip 9fc81308  sp 9fb26b58  lr a02a18a8  pc a05479d8  cpsr b3f06c90
                         E      at libunity.00a1f9d8(Native Method)
                         E      at libunity.007798a4(Native Method)
                         E      at libunity.0074b280(Native Method)
                         E      at Unknown.00007a08(Unknown Source)

When I comment the RenderTexture code it works:

//    private RenderTexture _renderTexture;
    private Camera _camera;

    void Start()
    {
//        _renderTexture = new RenderTexture( Screen.width, Screen.height, 0);
//        _renderTexture.name = "TransitionTexture";
//        _renderTexture.anisoLevel = 0;
//        _renderTexture.wrapMode = TextureWrapMode.Clamp;
//        _renderTexture.format = RenderTextureFormat.ARGB32;
//        _renderTexture.filterMode = FilterMode.Bilinear;
      
//        _texture.mainTexture = _renderTexture;
        _texture.width = Mathf.CeilToInt((float)_baseHeight * ((float)Screen.width/Screen.height));
        _texture.height = _baseHeight;
    }

    public void StartRecording()
    {
        _camera = Camera.main;
//        _camera.targetTexture = _renderTexture;
        _texture.gameObject.SetActive (true);
    }

I’ve discovered that setting the following code is causing the crash:

_renderTexture.anisoLevel = 0;

Maybe it’s what caused the crash on Android? Are you also trying to change the renderTexture settings?

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.

We’re able to solve this problem enabling the 32 Bits Display Buffer in Player Settings

4 Likes

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 :slight_smile:

Will write up an official bug later this week.

1 Like

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…

However, using the Unity Frame Debugger connected to the device shows it as black! It’s very confusing.

Any ideas?

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).

@Jde are you using camera.settargetbuffers?

Looks similar to this one

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.

1 Like