Results 1 to 6 of 6

Thread: using framebuffers in maya 6.5 without mentalray standalone

  1. #1
    Join Date
    Aug 2005
    Posts
    169

    Default using framebuffers in maya 6.5 without mentalray standalone

    Hi, I'm currently using maya 6.5 with mentalray version 3.4.5.5 on XP

    I've seen plugins available that leverage the framebuffers feature in mentalray without having to use mentalray standalone, but cannot find any source code, and I'm wondering how it's done. So far I've only been able to use framebuffers with the use of mentalray standalone and either custom text or editing the mi files with python.

    We have some projects however that will not use mentalray standalone due to various issues and I'd like to be able to leverage the use of framebuffers on these projects even though they'll only be using mayatomr.

    Any and all help will be greatly appreciated!

  2. #2
    Join Date
    Sep 2005
    Location
    France
    Posts
    498

    Default

    Hi,

    Yes it is feasible.
    I am mixing several frame buffer with mayatomr (no stand alone version)

    The problem is that as far s I know, you can't directly say in your .mi file that you are using several frame buffer (maybe with an output shader as max says on one of the Maya thread, to be tested for Maya)...
    Maya doesn't know how to parse this information.
    So you have to do it manually by using the miDefaultOptions node.
    Do inMEL :
    select miDefaultOptions;
    then in the attribute editor, you can add a frame buffer and choose its settings (RGb,RGBA,Z etc...)

    Then the shader code to store/access a frame buffer is :
    Code:
    //In a shader (material, texture..)
    //Put something in user frame buffer 0
    miColor ToonColor; //initialized somewhere else
    miBoolean bResFB0 = mi_fb_put(state,0,&ToonColor);
    if (! bResFB0)return miFALSE;
    
    //Then in an output shader
    miImg_image *fb_color		= mi_output_image_open(state, miRC_IMAGE_RGBA);
        miImg_image *fb_colorToon	= mi_output_image_open(state, miRC_IMAGE_USER+0); /User frame buffer 0
    
    [...]
    miColor ToonG;
    miScalar ToonCoordXG, ToonCoordYB; // initialized somewhere
    mi_img_get_color(fb_colorToon, &ToonG, ToonCoordXG, ToonCoordYB);
    [...]
    mi_output_image_close(state, miRC_IMAGE_RGBA);
    mi_output_image_close(state, miRC_IMAGE_USER+0);
    Regards,
    David Lanier
    R&D, plugins & shaders development company
    http://www.dl3d.com

  3. #3
    Join Date
    Aug 2005
    Posts
    169

    Default

    Thanks for the reply dlanier!

    I'm still confused as to how this will output multiple images upon render time. Do we not need to specify the buffers we're going to ouput in the camera block as well as the options block?

  4. #4
    Join Date
    Sep 2005
    Location
    France
    Posts
    498

    Default

    Hi,

    Actually, when you add the frame buffers, you modify the Maya node called miDefaultOptions so these are the options block for rendering so it contains the frame buffers mi statements but it's transparent for the user, you don't have to care about that yourself.
    Regards,
    David Lanier
    R&D, plugins & shaders development company
    http://www.dl3d.com

  5. #5
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    2,916

    Default

    But you also have to add the output statements, if you are not going to write your own output shaders using dlanier's example above.

    Think of the output statement as an optimized output shader for the common task of just putting the framebuffer to file.
    Barton Gawboy
    Training and Special Projects, NVIDIA ARC
    LAmrUG Forum Originator

  6. #6
    Join Date
    Aug 2005
    Posts
    169

    Default

    Thanks alot dlanier and bart!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •