Search Unity

render-to-texture woes?

Discussion in 'Shaders' started by Joe ByDesign, Mar 18, 2007.

  1. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Anyone else (using Pro) seeing RTT woes?

    I'm seeing that 100% of the time, I cannot use Play with 2 cameras when the lower 1 has an RTT without Unity automatically disabling the RTT on me (previously, was only like 5 - 10% of the time and even then, restarting Unity 'fixed' it for a while. Not so now).

    I can toggle the RTT while the game is running and it shows the RTT fine then (so the cameras are set up fine), it's only on launch that it disables the RTT and it makes the otherwise awesome Unity work-flow a bit of pain actually. Have already bugged it via Report Bug.app, but am curious how many others are seeing it.

    Anyone else notice this? Am I just stuck with this until the next update?

    ___

    Not sure if it's related, but a few days after going 10.4.9, I had to re-install OSX (after doing something silly) and I'm not sure, but the problem seems worse than prior to the system re-install. I haven't yet re-installed Dev Tools from Apple, so maybe this is related?
     
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Hmmm... no problems here. Running 10.4.9 on an Intel iMac and Unity Pro.
     
  3. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    I'm on a MBP here. Here's a bare bones package which demonstrates the issue on my machine.

    Launching Play on the included scene, I see no glow (bluish around the edges of the objects). However, if I toggle OFF/ON the Glow script on the Main Camera, there appears to be "some" glow on the outer edges of the objects, but no overfill on the object edge interiors. However, disabling GUI Camera shows glow as desired / expected.

    The 1st image (collage of 3 images) shows the changes. Any pro users seeing this?

    Also, the 2nd image shows corruption that sometimes appears when the glow is not showing (when it likely should be).

    *edit added description for images toggle description. also, updated package (somehow had old version that showed no glow because of Main Camera bckgrnd color alpha)
     

    Attached Files:

  4. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    For me on an Intel Mac mini and 10.4.8, I get odd results as well.

    I get no glow when I press Play, and no glow until I disable the GUI Camera. Even no glow if the GUI Camera's clear flags are set to Don't Clear. And the GUI Camera is not set to render any layers. And then some funky texture garbage when switching out and back into Unity while typing this reply. :eek:

    Looks like some bug with render textures or image effects to me. If not, I don't know what's going on at all. :)

    Cheers,
    -Jon

    p.s. So in your texture garble I see that you use Maya, Parallels, Unitron, and Unity. ;-)
     
  5. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Yeah sorry Jon, looks like i didn't save the Scene file before making the package, and it had the wrong GUI Camera clear flags and the Main Camera background color alpha as 0 (which results in no perceptible glow in this scene), which is probably why you're not seeing glow at all. Can I get you to grab the updated one above and try again?


    re: icons
    they're all worth it!
     
  6. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Don't know if this helps, but I get the same behavior, except I don't get the garbled screen.
     
  7. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Adding, while chatting with Jon, he gets the same errant behavior on 10.4.8 Mac Mini once he grabbed the updated package above.

    Wonders if Pro assets have changed?
     
  8. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    Yeah, I played with that stuff. Same weirdness.
     
  9. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Multiple cameras and Image Effects have always been fickle for me since I got Pro when 1.5 first came out. Restarting Unity or doing a build of the scene to make sure the Effect is working are the only 100% workarounds and I agree it's a little frustrating. Any hints from OTEE as to why this happens?
     
  10. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Yeah, it used to be only like 5 - 10% of the time and even then, restarting Unity 'fixed' it for a while.

    Now, I get 100% failure and restarting doesn't fix it. :(

    Even tried importing old Pro assets from a project folder from 1.5 but no change.

    Out of curiousity, do you have Dev Tools installed? I did before when I had 5-10% repro but not now. Wondering if it's connected some how.
     
  11. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    I still have 10.4.8 (MacBook Pro) and everything works as expected, i.e. I get two rightmost images in your 3-image attachment. That is, there is glow; and there seems to be more glow when disabling GUI camera. It is correct because GUI camera also renders everything - so it renders the ground and the cube on top of glow (you can see that my moving camera around).

    Now updating to 10.4.9 to check what happens there.
     
  12. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Ok, 5 hours of wasted time later, I've got 10.4.9 on my machine :x It looks like all things that could go wrong did go wrong on me. Oh well.

    Now, with 10.4.9 on MBP everything works. So I'm not sure how to reproduce this case...
     
  13. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Sorry to hear about your other woes Aras. I hope you got it all sorted out. Weirdness abounds! =)

    Adding to the mystery, I get the same behavior whether in editor or standalone app (haven't tried other exports yet).

    Reproducing this case so far, we have :

    1 iMac 10.4.9 - yes
    1 MacMini 10.4.8 - yes
    1 MBP 10.4.8 10.4.9 (now 100%) - yes
    1 Whatever aNTeNNa runs - yes

    1 MBP 10.4.8 10.4.9 - no

    As indicated above, I get this behavior 100% meaning "no gui camera for The Late Call" :(
     
  14. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Really strange. Can you do this: create a new project, import this package, then send that project (in reply to your bug post). Should not change things, but maybe worth a shot.
     
  15. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    Oops, I'm running 10.4.9 with an ATI 9700 and I have Dev tools installed. 10.4.9 didn't change anything either way. Sorry the update was such a bitch for you Aras... my laptop automatically rebooted 3 times after I installed it. I was starting to worry but it all worked out in the end.
     
  16. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Did this and resulted in the same behavior. Though on your advice, I sent the package through Report Bug just in case.

    Would love to resolve this. Will re-install dev tools to see if that reduces / changes anything.

    * Update; installed Dev Tools, nothing changed :(
     
  17. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    I'm currently digging through the OpenGL profiler, trying to isolate what's causing this erratic behavior. That said there are a mound of variables with any number of possible values and that's just looking at pixel formats.

    Anyone with any ideas on this, to narrow it down?

    OTEE please chime in here. I need to demo for interested publishers and cannot due to this bug. Any help you guys can give on this what looks to be an increasingly wide-spread issue will be very much appreciated.
     
  18. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    Good news! The problem is gone, but also it's gotten weirder... :)

    _________

    I had already tried many things, including Rebuild but none availed. Following Aras' lead, I started looking into what other objects are in the project file (not in the scene).

    I created a new test project, and imported the posted package. The behavior did not change.

    Next, I rebooted (shutdown, then pressed On) and re-opened the new project and it worked as expected! So I opened the base project where this issue first came up and it worked as well!!

    Then I restarted the scene (Stop, delay a few secs then Play), and it was back to the old corrupted behavior! I reopened the new project and it worked as expected!

    So at this point, I copied assets from the base project into the new test project and the new test project started showing the old corruption!

    _________

    So it's clear at this point there is something in the base project that causes it, and that it sets something in the video so that the problem carries over into other projects (but not always).

    And now the weird part... heh

    I re-opened the base project and all is well. I've started, played, stopped, replayed, reopened the base project scenes and this errant behavior is just gone; all works as expected!

    _________

    Possible causes, to all this, I don't know. It seems bizarre, and I find the test results misleading and confusing.

    I'm content that it is working, but also disturbed; it is disturbing that such problems appear and disappear without any real change to the code and assets (just moving things around).

    Perhaps in the cycle of trying, tweaking, and retrying, something became corrupted in such a way that it carried over unpredictably, and moving things around updating caches etc. eventually fixed it.

    Huge thanks to everyone who participated in tracking this down. I can now breathe a sigh of relief and return to game making!! :)
     
  19. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    I've never seen image effect related things getting corrupted just by importing/exporting assets or moving them around. That was a really weird issue you had. Glad it's solved now.
     
  20. jeffcraighead

    jeffcraighead

    Joined:
    Nov 15, 2006
    Posts:
    740
    I have, just the other day... With 3 spot lights that overlap a bit, two become very "soft" (the other day 1 became narrow w/ a large black prenumbra) See the screen shots. I just created one spotlight and copy/pasted it to create the others after adjusting the parameters. It almost seems to be switching from pixel lit to vertex lit from the behavior of the moving lights (smooth movement vs vertex snapping). Not the same problem probably, but a similar bug maybe?

    Jeff
     

    Attached Files:

  21. Joe ByDesign

    Joe ByDesign

    Joined:
    Oct 13, 2005
    Posts:
    841
    This is probably unrelated. Do you have other pixel lights in your scene or prefabs that are instantiated with lights?

    The Quality Settings (Edit -> Project Settings -> Quality) determine how many pixel lights are used before switching to vertex lighting (if lights are set to Auto).

    If you want to override this on specific lights, change Render Mode from Auto to Pixel or Vertex.
     
  22. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Yes, what you are see is lights becoming vertex lights. In Quality settings there is a setting for how many lights on each object are pixel lights; after that they are turned into vertex lights. You can force the lights to be always pixel lit of course.