- Home /
Render to texture works on computer, but not on iphone
My problem with render textures is a rather complicated one. I have two render textures in my scene, each rendering something different and each has a perspective matrix (from the same code) applied to it. Both of these textures work exactly how I want them to on my computer and on a computer app build. However, when I build it to the iphone, only one of these textures shows up. I was thinking that the iphone was somehow killing one render texture because the second texture was using too much ram, but when I deactivated the working render texture, and rebuilt the scene with only the one previously non-working texture, this texture still did not show up (just pure black) even though it was the only one in the scene. I have also built the scene with one working camera rendering its texture to two objects and tested this on the iphone and it works. Just some background knowledge, I have built an app using two render textures before that have been displayed correctly.
So my question is, why would both textures get rendered in the editor and in the play view and when built for the computer, but not get rendered when built for the iphone? I suppose I could try deleting the broken one and recreating it, but I still cannot answer the question above. I would love any suggestions.
hi, I have a question for you. are you using textures with transparency? perhaps png files?
Nope, just simple render textures with diffuse shaders and the main colors are off white on both. They are both set up exactly the same, it is just one camera is in a different position than the other one. However only camera's texture is showing up on the iphone build.
Ok this is kind of strange. I believe you have 2 cameras in your scene? Could you attach a picture or something just so i can see what exactly going on?
Ok, this is the picture of what it should look like:
http://www.flickr.com/photos/64364958@N03/5869741247/
This is the picture of what it does look like(a screen shot taken from my iphone):
http://www.flickr.com/photos/64364958@N03/5870299504/
Finally a picture of the scene in play mode and the editor also showing what it is supposed to show:
http://www.flickr.com/photos/64364958@N03/5870299620/
Thanks for your help.
Just wanted to let you know I was able to solve this problem by just deleting the object the camera's feed was rendering to and recreate a new one. Hope this helps anyone who has this same problem.
Answer by Macdude2 · Jun 27, 2011 at 04:44 AM
I was able to completely fix this problem by deleting the old object and creating a new one. This worked for me twice so I am quite confidant this is a valid solution. I am sure this will come up later and I just want others to know that the fix is simple.
Answer by Dreamora · Jun 27, 2011 at 12:45 AM
Reasons for render textures not working at least as far as I know:
Ensure the format is even supported you try to use (render textures with depth will not work, larger than 1024 x 1024 does not work either, not all desktop color formats are valid, I think only ARGB8 and the 16bit one work)
How are you handling the two? is it the same code or is the code management of them differently?
Your answer
