Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MegaGrab

Discussion in 'Assets and Asset Store' started by SpookyCat, Apr 15, 2011.

  1. richardek

    richardek

    Joined:
    Aug 23, 2012
    Posts:
    1
    Anyone got it to work in ortographic? Please share code or tips how to make it work.
    Thanks!
     
  2. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Think you should probably ready the description of the Asset again :)

     
  3. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    The way the grab system works is to manipulate the camera matrix on a subpixel level and that wont work on orthographic cameras I am afraid hence the note in the asset description that orthographic cameras are not supported.
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I'm trying to capture a fairly high-rez image of the camera view, but the rendered image is always blurry when viewed at actual size. See attachments. Camera is set to Perspective. The resolutions seems to match the in-Editor view, but I need it rendered out at higher-rez than that. What am i doing wrong?
     

    Attached Files:

  5. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    You need to make sure any screen space effects are disabled, so Anti Aliasing or image effects.
     
  6. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Ah, yes, I'd turned on antialiasing before finding this tool. Thanks for the quick help!
     
  7. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just done a little update to MegaGrab that fixes a couple of issues with the sequence grab. The new version is available now in the Asset Store or from our website.

    Changes in v1.23
    • Sequence Grab now uses the format string
    • Sequence grab frame number now has leading zeros for easier sorting
     
  8. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Does this support WP8 ?
     
  9. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I don't have access to Windows 8 or any WP8 devices so can't actually test here, but the main aim of this is to be used in the Editor really, you can use it at runtime with no problems on any device so far so I can't imagine a Windows 8 app or mobile app will be any different.
     
    sathya likes this.
  10. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    Just picked this up today, it's awesome to see this plugin still supported and doing amazing work
     
  11. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
  12. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Might it be possible to add transparency to MegaGrab -- so I could capture an image sequence with the background set to transparent. I've seen some scripts for that, but really need it for an image sequence, not a single image.
     
  13. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    MegaGrab has been updated to support the feature gecko asked for above, you can now do grabs with alpha support, this allows you to render a scene with say the background as transparent so when you do a grab you can use that in a paint package to overlay the grab over another background. The system also supports the anti aliasing system built into MegaGrab so you can still have super smooth massive res grabs for you compositing. The alpha grab will also work with the sequence grab so videos can be made offline.

    To use the new feature make sure the format is set to TGA then you will see the Alpha options, select 'Use Mask and set the color to 0,255,0 or purple, set the same color for the camera clear color and set the clear flags to solid color. Now when you scene renders anything that is purple will be treated as transparent. IT is best to turn of AA in Unity and use the MegaGrab AA option to get the best results.
     
  14. arteria

    arteria

    Joined:
    May 31, 2007
    Posts:
    2,189
    This is an excellent tool, and very appreciated. Ive been using it recently on the arteria screenshots taken in unity.
     
  15. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Thanks @arteria and there I was thinking it was your fab 3d skills that made your environments look so amazing but all along it was MegaGrab doing the hard work :)
     
  16. proso

    proso

    Joined:
    May 24, 2012
    Posts:
    67
    Hi, I'm using MegaGrab for a while now, great product!! I'm busy with the new Unity 4.6 GUI. I'm not good at scripting and have a question, I hope someone can help me.

    I have a simple button, how can I grab an image by pressing a new Gui Button?
    There is the Onclick () event, but I don't know how to set this to the GrabKey. Now it only grabs by pressing a key.
     
  17. zOffTy

    zOffTy

    Joined:
    Nov 6, 2013
    Posts:
    1
    Hi,

    Nice tool!
    is it ready for Unity 5 ?
    Thanks!
     
  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @zOffTy - Yes the system works fine with Unity 5.
     
  19. vismonkey

    vismonkey

    Joined:
    Jul 23, 2013
    Posts:
    7
    Did you ever find a solution for this? Im in the same boat. I need to trigger a screenshot from a button click versus a keystroke.
     
  20. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just did a small update to MegaGrab, it now has two new methods which can be called from other scripts to start a grab and to cancel a seq grab. So call DoScreenGrab() to do a screen grab with the current MegaGrab settings, and if that means a Seq grab is started it can be cancelled by calling the CancelSeqGrab() method.

    Changes in v1.26
    • Added DoScreenGrab() method to MegaGrab which can be called from GUI methods etc to do a grab instead of using a Key Press.
    • Added CancelSeqGrab() method to MegaGrab which can be called to cancel a seq grab instead of using a key press.
    • Fully Unity 5 compatible
     
  21. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    I saw this asset a while ago and passed on it. I don't need high res stills. I only just found out you'd added sequence saving... bought it instantly. Very pleased.

    I saw on the previous page here someone having issues with not being able to get a predictable render size. Did you fix that, because I'm having those problems now.

    Even if I manually change the size of the whole unity window (set to aspect ratio 16x9), watching the Mega Grab Size changing as I do it. I get the size I want 960x540 (Res Upscale set to 2 to get 1080p) Then I hit play and capture, and I get frames that are 1860x1046. Which is 16x9 but about 3% too small.

    I get that there's some stupid Unity glitches in how the window size is being reported, but is there any fix for this or should I just make a point of rendering out slightly larger than I need and crop it off later in After Effects?
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    The way the system works is the resulting grab is a multiple of the render window size, you cant just set a value for the end size, so if your render window is 800x600 and you have an upscale of 2 then the end grab will be 1600x1200. The system works by jittering the projection matrix by a subpixel amount and then combining the end result in an interlaced way.
     
  23. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    I know, I get that. The problem is... even setting the render window to 800x600 won't give me 1600x1200. I just tried, my jpegs came out at 1554x1166.
     

    Attached Files:

  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    That's very odd just tested it in Unity 3, 4 and 5 with the render view set to 1024x768 and upscale set to 2 and I am getting grabs 2048x1536, tried it in the editor and in a built stand alone.
     
  25. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    That's weird, it's working now. I tried in Unity 4 and it was fine then I started a new project in Unity 5 and it was fine. Then loaded the previous project (which was in Unity 5) and it's now working.

    I can make a new preset screen size in the top left option in the game view, and as long as Unity can fit it in, it captures exactly that. Nice.
     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    That is odd, did you redownload or update MegaGrab at all?
     
  27. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    No, that's just with the same first and only version I've downloaded, the latest one just a couple of days ago.

    I think I know what it was. For some reason I wasn't using the corner resolution preset button. I'm sure I new about it but I left if on 16:9 and I think I was just trusting your script's "Grab Size" where it tells you 960 x 540 etc. That part is still wrong, I'm not sure what that's really informing us of. As you can see it threw me right off. Ignoring it and using that Unity preset option is key to making use of Mega Grab maybe.
     
  28. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Setting it to 16:9 only ensures that aspect ratio, the actual screen size is determined by the window size.
     
  29. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    Yes, I know. But why is it telling me 1087 x 919 in the Grab Size? That's with 960x540 as the preset resolution, which is what my captures are. I realise it's the actual size of the Unity Game window (regardless of what you have it set to).

    My point is, having that number adds confusion. Unless it's useful for something I'm not aware of.

    I see in the version history of the help file it says...

    Version 1.22
    Grab size label in inspector will now show correct size based on game view size.

    Is this what's happening? Because this seems broken as it is. Even if I set if to Free Aspect Ratio, I get a capture that's 1087x902, so the height's incorrect.
     

    Attached Files:

  30. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    If you measure the height of the window title bar, with the resolution dropdown, would that happen to be 17 pixels high? Because that would explain the height discrepancy. Unity reports window size including the chrome, MegaGrab grabs the image excluding the chrome.

    Edit: I'm on my iPad, but the dropdown seems to be 17 pixels high indeed.
     
  31. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    I read about that in here previously.

    So telling people the Grab Size is useful I guess. Assuming they're capturing in Free Aspect Ratio and are aware that they need to take the number and mentally subtract 17 from the height.... Anyone with a different setup, just ignore it.
     
  32. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    If I were you I'd define my own resolutions in Unity's preferences: no more uncertainty.
     
  33. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    Hi in MegaGrab I turn on the secuence. run ok.

    But I need change name file format in the secuence.
    I need set not to date, only to number secuence.

    No info about this optiones.

    Thanks.
     
  34. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Ther is no option to remove the date/time and res options in the filename, but it is to change the line at 716 in MegaGrab.cs to whatever you need ie:
    Code (csharp):
    1. fname = epath + Path + SaveName + framenumber.ToString("0000");
     
  35. glunity

    glunity

    Joined:
    Jun 19, 2014
    Posts:
    23
    Thanks, I will try this :p
    Best regards.
     
  36. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Ill see about adding an option for including the date/time and grab size in the sequence grab.
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    New version in the Asset Store with a new option for Sequence grab to stop the date/time/res info being included in the file names to make it easier for image sequence software to load the files.
     
  38. AlanLadd

    AlanLadd

    Joined:
    Feb 12, 2015
    Posts:
    40
    Hi!
    Bought this incredible asset! I just have one problem whit it, It docent work with Kode80SSR when i use alpha mask, it destroys the mask with artefacts! Is there a way to fix that? Or can you disable the effect SSR just in time when Megagrab creates and saves TGA alpha mask, but I still have the effect SSR on the picture? Hope you understand what I mean! Thanks for any reply in this matter!

    Heres the link to Kode80 SSR http://www.kode80.com/blog/2015/03/11/screen-space-reflections-in-unity-5/
     
    Last edited: Jun 3, 2015
  39. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Thanks for the purchase. The problem I think lies in the fact that the grab system works by adjusting the camera projection matrix via subpixel means, ie shifting the camera view by a fraction of a pixel then doing a grab, moving it again and doing another grab then combining them to produce a final image, when using screen space effects though they don't bother with the same level of accuracy to you will get the same image effect but when combined the image effect will produce small artifacts, it is the same with any image effect, sometimes the results are not really noticeable sometimes they are but generally all image effects and even AA should be disabled if doing very high res grabs.

    Could you post an example of the artifacts so I can see or email it to me.
     
  40. AlanLadd

    AlanLadd

    Joined:
    Feb 12, 2015
    Posts:
    40
    Hi again!
    Here you have a picture!
    Is there a way too get around that some how?
    Now I have to take one screenshot with SSR and one without SSR that makes a perfect alpha and combine this too in photoshop! But that is too many steeps to do!
    This is made in TGA but I have to make it too JPG so you can see it!

    Thanks for reply!
     

    Attached Files:

    Last edited: Jun 3, 2015
  41. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    That looks very odd, I cant see why there should be any rendering in the areas where the artifacts show up, I could understand if they were right up next to the edges of your mesh but the artifacts are seem to be a long way from your mesh and in areas where there is no mesh on which to render reflections so intrigued as to what is causing that.
     
  42. AlanLadd

    AlanLadd

    Joined:
    Feb 12, 2015
    Posts:
    40
    Hi SpookyCat!
    Thank you for reply!
    Is there a way to take too screenshots, one with SSR so I get the picture and one without SSR so I can get the alpha and combine them by script in one shot, or it takes too screenshots and process it as one! Just wonder?
    Any solution to this or do I have to wait for a more compatible SSR? I really like SSR! What can I use instead of SSR!
    Thank you in advance!
     
    Last edited: Jun 3, 2015
  43. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Well you could do a little script that is called when you do a grab that does a normal grab first then disables the image effects and then does a second grab on the next frame, you would need to make sure the camera or other objects didnt move in that time so probably do something like set the Unity Time.timeScale to 0.0f as well during the grab process.
     
  44. AlanLadd

    AlanLadd

    Joined:
    Feb 12, 2015
    Posts:
    40
    Hi SpookyCat!
    I think this i something I need help with! Maybe I can buy that little script from you so I have something too start with?
     
  45. AlanLadd

    AlanLadd

    Joined:
    Feb 12, 2015
    Posts:
    40
    Hi SpookyCat!
    Hope you are okej!
    Are they going to implement PNG save and PNG with transparent in MegaGrab?
    Thanks for reply!
     
  46. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Any road-map to add VR support (spherical/cylindrical panorama) ?
     
  47. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @AlanLadd - I will look at adding a png encoder but not sure why its needed, the TGA format has alpha support, what are the benefits of png support?

    @devang_xprt - Not had any requests for VR support, not sure what would be needed, the system just grabs what is being rendered are you saying you want the end result to be transformed in some way?
     
  48. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Last edited: Jun 12, 2015
  49. AlanLadd

    AlanLadd

    Joined:
    Feb 12, 2015
    Posts:
    40
    Hi SpookyCat!
    About PNG with ARGB32!
    It´s lot easier to use then TGA alpha in photoshop then you want to put different backgrounds on 100 of pictures!
    Hope you will fix that. I will gladly to pay for Mega-grab again!
     
    Last edited: Aug 17, 2015
  50. proso

    proso

    Joined:
    May 24, 2012
    Posts:
    67
    Hi, I have two questions.
    1 - Is it possible to safe the grab without a time/date, but with a number (for example grab_001.jpg for the first grab and grab_002.jpg, etc., etc.) Now, with the same grabname, it overwrites.
    2 - Is it possible to call a window where you can choose a save location?