Results 1 to 7 of 7

Thread: to create additional images

  1. #1
    Join Date
    Apr 2005
    Location
    Los Angeles, CA
    Posts
    11

    Default to create additional images

    Hi there, I'm mentalray for Maya user.

    I'm trying to make output shader to create another rgb image for later composite work.
    I could make a user defined framebuffer with adding small modification to my_material shader like this:

    float rgba[4];
    if( mi_fb_put( state, 1, rgba ) == miFALSE ){
    mi_progress( "put fb1 failed" );
    }

    and turned on framebuffer1 in miDefaultOptions.

    but can not make actual image file. I could not find sample codes to create "additional" images.

    How can I make another images ?

    thanks,
    tendo

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

    Default

    Hi tendo,

    Just noticed that I didn't answer this. There must have been a similar post somewhere.

    For framebuffers to work, you need them turned on in both the options block and the camera block. Is your output shader question really a question about how to enable them in the camera block?

    I'm not sure how to do this within Maya, without using custom text, writing an mi file, and rendering with standalone. However, I know it is possible, since there are several folks who have written multiple framebuffer shaders.
    Barton Gawboy
    Training and Special Projects, NVIDIA ARC
    LAmrUG Forum Originator

  3. #3
    Join Date
    Apr 2005
    Location
    Los Angeles, CA
    Posts
    11

    Default

    Yes. my question was that how to enable "output" statement them in the camera block.
    I tried custom text way which only way I could find that mentioned in framebuffer tips in Resource page. I can output .mi files and can see the "output" statements in camera block but did not work from interactive render.
    Is there other way?

    tendo

  4. #4
    Join Date
    Dec 2004
    Location
    Marina Del Rey, California
    Posts
    2,929

    Default

    You know, in a phenomena you can add an output statement that could be run with the fb shader.

    I haven't tried this yet but maybe an fb output statement could be packaged up with an fb shader in a phenomenon. Say, if you use fb2 in the shader, then add an output statement for fb2.
    Barton Gawboy
    Training and Special Projects, NVIDIA ARC
    LAmrUG Forum Originator

  5. #5
    Join Date
    May 2005
    Location
    Italy
    Posts
    187

    Default

    I donno about the bart phen solution but you have at least another
    option that is to create an output shader that will write out your imgs
    without refering to the 'mechanism' mentalray automatically adopts
    when find an output statement like,

    output "fb1" "bmp" "G:\3Dprojects\_mentalray_cmd\outfb1.bmp"


    infact there's another kind of output stat that assign a shader to.

    output "rgb" = "super_writeme".

    but you'll have to dev an output shader that effectively will do
    all the work of looking for the buffer availability and writing out
    imgs by itself using the mi_img_* functions.


    if you wanna use the first way interactively from within maya
    you could also dev a geometry shader that will adding another
    filepath to the output file list, it is something like add custom text
    to a mifile, but you'll do it from within a geo shader updating
    the db scene directly in the preprocess phase.

    max

  6. #6
    Join Date
    Apr 2005
    Location
    Los Angeles, CA
    Posts
    11

    Default

    I wrote an output shader that writing out am image by using libtiff. and it worked.
    one thing need to care is that fb0 is used by glow shader like someone said in other thread. so I used fb1.

    thanks bart and max for the help.

  7. #7
    Join Date
    May 2005
    Location
    Italy
    Posts
    187

    Default

    one thing need to care is that fb0 is used by glow shader.
    mentalrayglobals->translation->export.post.effects.
    decheck it, it should free up the fb0.
    (if you don't need the glow, of course..)

    max

Posting Permissions

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