Results 1 to 6 of 6

Thread: Renders come out differently in viewport render region and output image

  1. #1
    Join Date
    Oct 2012
    Posts
    6

    Default Renders come out differently in viewport render region and output image

    Hi, several times i have experienced strange problem, which is when i render something in render region and then render it into image, output may come out quite differently in areas of high reflection. It seems like region render clamps the image somehow, while rendering into file does not, showing much more intense highlights. It can mean significant loss of time, fine tuning something that will appear differently in rendered image. Im not sure if its more related to mental ray or implementation, but i want to find out why it happens. Render output is typically 16bit exr and yes, render region settings and scene render settings are the same tahnks for any help. David.

  2. #2
    Join Date
    Aug 2010
    Location
    New York, NY
    Posts
    123

    Default

    That's becasue the XSI render region is 8-bit while your actual output may be 16 or 32-bit. Mental ray clips sample values for 8-bit framebuffers by default. This can be disabled by setting the undocumented framebuffer clip option to off. Since this option is not natively exposed in XSI/Maya/etc, you must write a geometry shader to turn off this option at render time. Here is the neccesary code:

    Code:
    #include "shader.h"
    #include "geoshader.h"
    
    extern "C" DLLEXPORT
    miInteger framebuffer_clip_off_version(void) {
    	return 1;
    }
    
    extern "C" DLLEXPORT
    miBoolean framebuffer_clip_off(
    	miTag* result,
    	miState* state,
    	void*)
    {
    	mi::shader::Edit_fb framebuffers(state->camera->buffertag);
    	size_t framebuffer_count = 0;
    	framebuffers->get_buffercount(framebuffer_count);
    	for (size_t i=0; i < framebuffer_count; ++i) {
    		const char* name;
    		if (framebuffers->get_buffername(i, name)) {
    			mi_info("%s: clip off", name);
    			framebuffers->set(name, "clip", false);
    		}
    	}
    
    	*result = miNULLTAG;
    	return miTRUE;
    }

  3. #3
    Join Date
    Oct 2012
    Posts
    6

    Default

    Cool, thats exactly what i needed. Thanx!

  4. #4
    Join Date
    Oct 2012
    Posts
    6

    Default

    Tried your code but turning the clip option on and off doesnt seem to make any difference in render region. Any hints? Using softimage 2012.

  5. #5
    Join Date
    Aug 2010
    Location
    New York, NY
    Posts
    123

    Default

    Do you have all the other options set for linear workflow, e.g. colorclip raw, dither off, desaturate off? If so, you may be running into a different issue and will need to post more information, example renders, etc.

  6. #6
    Join Date
    Dec 2008
    Posts
    11

    Default

    See attached scene, the highlight is different in region and preview window. "ClipOff" shader is included in the scene...
    clip.zip

    Note: Compiled shader requires VS2012 redist.

Posting Permissions

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