Home Technical Talk

[MAXSCRIPT] Grabviewport 2.0 (alpha, color, AO, wire support )

2

Replies

  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmm, a friend of mine was having issues with Z Passes in realtime also, here is my old shader, but slightly corrected for Z-Depth, mind if you guys take a test on it?

    http://www.mediafire.com/?zpn0fb2bv45mx4t

    You should be able to changed colors and go upto 5 digit values incase (like me) you're using M/CM units in Max.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    hmm.. im running into some new issues. if i render the exact size of my max viewport (1364 x 769) everything turns out fine. however, if i decide to resize it bigger (im going for 1920 x 1080 specifically), it removes my background image, and any transparent materials i have get duplicated and appear twice on the screen, once where it actually is, and once where it used to be before re-size.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Are soft shadows enabled in your Viewport config?
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmm, the only other issues I could think off is disabling the graphite tools or any AA you might have enabled through your graphics cards drivers.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    so when i am saving out an animation sequence, be it .tga .png or anything, it defaults to saving as a .avi. is there any way i can have it not do that (i want the tga sequence so the alpha can be embedded in the targas?

    also is there some sort of filesize limit to the script? im trying to render a 1920 x 1065 video and since it defaults to .avi, when it is done i can see it is the actual file size (8 seconds, 1.92gb) but then a moment later it goes to .99gb and 4 seconds.
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    The animation files get pretty big quick, so when you go for largescale avis it might start bugging just because of max.

    I'm reworking the script from the ground up to optimize it atm and to get all the bugs out. The animation option wil also benefit from this and i'll add the tga sequence option as wel.

    Sorry for the wait
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    so how goes these updates?

    im still getting some issues with the script when it comes to taking screenshots larger than the viewport. there is a plane behind my object thats being used for ground shadows and sort of an ambient light bounce and when a screenshot is taken at the size of the viewport, the plane does not appear. when the screenshot is taken at a higher res than the viewport, the plane in the background sort of creates this ghosting effect as if there is another plane behind it.

    also at times when rendering, the object will lose its material and be replaced with a regular grey mat.. and the plane will receive the material from the object.

    this is all happening with the Xoliul II shader.
  • zoombapup
    Options
    Offline / Send Message
    Wanted to request a feature. I tried looking for a solution myself, but havent come up with anything so far.

    I've been using it with the "realistic" view in 2012 and the lighting looks good in the viewport. When I use grabviewport, it actually grabs the view with none of the soft ambient occlusion lighting. I suspect its because the ambient gets iteratively developed rather than instantly rendered. So I looked for a way to delay the screengrab but couldnt find on. Is there any way to make it so that the grab happens after the lighting has settled?

    I guess it doesnt matter if you're using xoliul, which is my next option.
  • jaffajuice
    Options
    Offline / Send Message
    Hiya Raven

    I have an issue with your grabviewport script, which is awesome by the way :)

    I'm using max's standard viewport shader with an alpha texture for some hair fins.

    The problem is the aliased edges of the alpha planes don't scaled up with the rest of the image .. They float separately and don't appear to be used/caried forward with the grab viewport script.

    I'm using Max2011 SP2, but this also happens on max2010 and 2012.

    Any ideas?

    and Thanks
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    I'm gonna jump in and suggest it probably has to do with either Softshadows (does not work with large res viewport grabbing, thx autodesk) or Transparency quality (try all 3 settings).
  • jaffajuice
    Options
    Offline / Send Message
    Thanks for the tip.

    Setting the transparency to None actually yielded better results and the grab viewport script works fine with my hair alpha. Simple also works, but doesn't look as good.

    Thanks

    Seeing as we are in the spirit of improvement ... I have a few suggestions on this script as well...

    Viewport Size ... can we have a cropped viewport? For a tall character on a wide screen there is a lot of screen space rendered that doesn't need to be.

    Save Settings .. an incremental name saving system for those who will take many many screen shots like me ... a Save+1 button?


    These are very minor suggestions on what is an awesome and very useful little script. Thanks again.
  • jaffajuice
    Options
    Offline / Send Message
    One more thing I've noticed about running viewportGrab is that the amount of memory max uses increases each time you use the script. After several grabs things can start to get a little slow so I suggest running a garbage collect every once in a while. Perhaos this could be added to the script?
  • jaffajuice
    Options
    Offline / Send Message
    and one last thing...

    the alpha mask layer currently doesn't account for double sided materials or the materials alpha channel :S

    Which is making my hair alpha planes a little tricky to work with.

    Transparency is set to None, shadows Hard and the Xoiliul material is double sided with clipping at 0.3.
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    yeah i still need to work on this script and do some proper testing with the new xoliul shader

    anyway tnx for the suggestions, most of them sound pretty good additions so when i finally do update the script they probably will be in there.
  • seth.
    Options
    Offline / Send Message
    seth. polycounter lvl 14
    hey Ravenslayer, great script....I had the visibility in undefined error also, MAX 2011 64 bit, never used 3ds clean or any custom set-up....got around it by deleting .visibility from the script wherever it came up as an error while trying to execute the script...works just fine now...odd huh?

    thanks again for the ace script :D
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    hey seth , i don't really know what the problem is with some of these max versions but my check is adjusted in the new script i'll be releasing so it checks for the ViewCubeOps itself instead of the visibility attributes (which was a stupid thing to do to begin with)

    So i finally found the time to start adjusting and optimising this script, from the looks of it i'll probably be done somewhere this weekend. It should be A LOT faster since it doesn't work with scenestates anymore and i now try to do as little double work as possible if multiple passes are being made.

    I'm also adding in some of the minor suggestions given but the bigger ones will be for later.
    First a "bugfree" script, not really possible if you're using maxscript but i'm trying to work around everything that could be a problem

    fun little line of code
    while m_vps.ShadowsActive do m_vps.ShadowsActive = false
    i need to do this otherwise he just skips the false argument sometimes...
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    For those who are interested i'm finalising my 2.5 release.
    It's a pretty big update when it comes to usability and stability from the tests i've done now but i'd like to have some more people to test it.
    If you're interested pm me and i'll send you the script :)

    Grabviewport25.png

    some features and fixes:
    - textureAlphas should now always work in the alpha, color and zdepth passes (standard,Xoliul 1 & 2 shaders, 3Point Shader are supported)
    - New Viewportscaling technique fixes soft shadows scaling issue and should also enable nitrous captures.
    - Presets of all settings can be made and loaded, Last Settings are also always saved.
    - Tags for filenames and directories are supported , quick tag inset tool is also available
    - Cropping to Safeframes has been added
    - Anti Aliasing has been added
    - Scenestate method has been removed and should speed up the process
    - Animations can be saved as Avi or image sequences for all passes
    - Both the SSAO and the Zdepth Pass can be live tweaked by pressing the buttons next to the checkboxes.
  • Tadao215
    Options
    Offline / Send Message
    Tadao215 polycounter lvl 13
    nice! when will this be available??
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    I'll probably release this on sunday if no bugs turn up.
    For those who are interested i'm finalising my 2.5 release.
    It's a pretty big update when it comes to usability and stability from the tests i've done now but i'd like to have some more people to test it.
    If you're interested pm me and i'll send you the script
    :)

    Grabviewport25.png

    some features and fixes:
    - textureAlphas should now always work in the alpha, color and zdepth passes (standard,Xoliul 1 & 2 shaders, 3Point Shader are supported)
    - New Viewportscaling technique fixes soft shadows scaling issue and should also enable nitrous captures.
    - Presets of all settings can be made and loaded, Last Settings are also always saved.
    - Tags for filenames and directories are supported , quick tag inset tool is also available
    - Cropping to Safeframes has been added
    - Anti Aliasing has been added
    - Scenestate method has been removed and should speed up the process
    - Animations can be saved as Avi or image sequences for all passes
    - Both the SSAO and the Zdepth Pass can be live tweaked by pressing the buttons next to the checkboxes.

    i'll quote this to the new page just so people don't miss it :)
  • mLichy
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    tnx ^^

    BETA TESTERS ARE STILL WELCOME!
  • SideEffect
    Options
    Offline / Send Message
    SideEffect polycounter lvl 19
    if you save an animation to an image sequence with the new version will it include the alpha channel in each image?
    I've been trying to figure out a good way to do this recently and this would make life a lot easier :D

    Thanks for the awesome tool!
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    atm it doesn't but it's noted, next time i'm updating i'll look into it and if it wouldn't take too much time i'll add it in right away :)

    general message:
    For questions and bugreports about the new script please post them here
    http://www.polycount.com/forum/showthread.php?t=92812

    i'll check this one more ofter
  • Teessider
    Options
    Offline / Send Message
    Teessider polycounter lvl 11
    This script is awesome! However I keep getting errors with it:

    --Runtime Error: Attempt to access deleted scene object
    Line 226 is highlighted

    I'm using 3ds Max 2012 sp2 with Xoliul's Viewport Shader 2.0 (which is also awesome). I thought I got it because I had hidden objects in the scene but I got it even with no hidden objects in the scene.

    Any ideas?
2
Sign In or Register to comment.