Results 1 to 7 of 7

Thread: user buffers garbage

  1. #1
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default user buffers garbage

    I have a issue with garbage in all user framebuffers if GI-Next enabled and tile render used.

    buffers_garbage.jpg

    I have to cleanup buffers before put some data.

    Code:
    mi_fb_get(state, direct_specular_buf, &temp_color);
    temp_color.r += direct_specular.r;
    temp_color.g += direct_specular.g;
    temp_color.b += direct_specular.b;
    mi_fb_put(state, direct_specular_buf, &temp_color);
    And everything is ok without GI-Next.
    I could not reproduce this issue with MILA shader. It looks like MILA use some trick or always replace value in buffers.

    mr 3.14.3.41 and any latest.
    Pavel Ledin

  2. #2
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    1,148

    Default

    Quote Originally Posted by Puppet View Post
    I have a issue with garbage in all user framebuffers if GI-Next enabled and tile render used.
    Do you have a scene to reproduce? Do you use FB writing shaders like mila_scatter or the like?

  3. #3
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default

    Here is *.mi scene and simple shader with source code in attachment.
    Attached Files Attached Files
    Pavel Ledin

  4. #4
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    1,148

    Default

    Quote Originally Posted by Puppet View Post
    Here is *.mi scene and simple shader with source code in attachment.
    Thanks for the scene. Do you happen to have a Maya scene too? It's easier to handle these days...

  5. #5
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default

    Maya scene
    Attached Files Attached Files
    Pavel Ledin

  6. #6
    Join Date
    Jan 2009
    Location
    Berlin/Germany
    Posts
    1,148

    Default

    Hi Puppet, we can confirm that this is a problem in the current version of mental ray when enabling GI Next.
    It appears that custom shaders might not be able to detect this case properly and work around it.

    We are working on a fix.

    Best, Steffen

  7. #7
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default

    Thanks. It will be great if you fix it.

    Currently, I'm using a pretty stupid trick as a workaround.

    Code:
    miColor black_color = {0.f, 0.f, 0.f, 0.f};
    miUint *buftf_pt = (miUint *)mi_shaderstate_get(state, "buftf", NULL);
    
    //cleanup buffers value for the first call
    if (!buftf_pt || *buftf_pt != state->qmc_instance)
    {
    	mi_fb_put(state, stp->direct_diffuse_buf, &black_color);
    	mi_fb_put(state, stp->direct_specular_buf, &black_color);
    	mi_fb_put(state, stp->indirect_diffuse_buf, &black_color);
    	mi_fb_put(state, stp->indirect_specular_buf, &black_color);
    	mi_fb_put(state, stp->back_sss_buf, &black_color);
    	miUint buftf = state->qmc_instance;
    	mi_shaderstate_set(state, "buftf", &buftf, sizeof(miUint), miSS_LIFETIME_EYERAY);
    }
    I have to use state->qmc_instance, because of another bug with "miSS_LIFETIME_EYERAY" that not deleted.
    Pavel Ledin

Posting Permissions

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