prman-pixar / RenderManForBlender

RenderMan for Blender render addon
MIT License
808 stars 133 forks source link

Bugs when using render border #683

Closed johannes-wilde closed 2 months ago

johannes-wilde commented 1 year ago

Final render does not work, when using a render border in the viewport. While viewport rendering kind of works with a render border, switching between the render kernels is not possible.

Blender 3.6 on Win11

prman-pixar commented 1 year ago

@johannes-wilde This seems to be working for me. Can you give me a list of steps to follow to reproduce what you're seeing?

johannes-wilde commented 1 year ago

Thanks for your reply!

Sure I can wirkte a short guide:

  1. Create a Blender scene, it can be empty as well.
  2. Create a Camera, go to camera view
  3. "ctrl+b" : Drag rendering border over the camera
  4. Hit F12 for rendering (does not work for me)

Cheers,

Johannes

prman-pixar commented 1 year ago

@johannes-wilde thanks for the steps! Can you see if the latest commit in the dev branch fixes the problem for you?

johannes-wilde commented 1 year ago

Hey, now it works! But there is still an issue, when in viewport rendering. If the render border is set to the camera and you move the camera, it gives artefacts and leads sometimes to a crash of Blender.

Here is a screenshot:

Screenshot 2023-08-07 191304

prman-pixar commented 1 year ago

@johannes-wilde thanks for confirming. I'm having a hard time reproducing your new issue. I'll keep digging, but if this is stopping you from using the addon, I would suggest rendering to "it" instead in the meantime.

TeaNotes commented 2 months ago

The issue happens for me when rendering region and crop to render is enabled, but only if the render region exceeds the bounds of your viewport. So a simple repro is render with crop to region and zoom in until the crop region boundary goes beyond viewport extents.

EDIT: doing this without crop enabled works just fine, you can zoom without problems, it's only a crop problem. EDIT 2: I'm on version 26.2 for Blender (2336968)

I came here to report this specific issue but didn't want to start a new thread for it. Sorry to revive a thread from a year ago. Any further info you need, let me know.

prman-pixar commented 2 months ago

@TeaNotes do you have a blend file you can share?

TeaNotes commented 2 months ago

@TeaNotes do you have a blend file you can share?

Of course, I've attached a very simple scene, just start viewport render and just zoom in a couple of times, the app crashes when the boundary exceeds the limits of the viewport. I've tried with 4.2 and 3.6, crashes with both. At first I thought it was because of the Omniverse build but it happens with vanilla Blender builds as well.

crop_region_bug.zip

Anything else you need help with, let me know.

prman-pixar commented 2 months ago

Thanks @TeaNotes . I will see if I can take a look at this tomorrow.

prman-pixar commented 2 months ago

@TeaNotes can you see if this patch works for you? RenderManForBlender.zip

TeaNotes commented 2 months ago

@prman-pixar it doesn't crash so that's fine, but panning creates this weird artefacting around the render. But it doesn't crash, that's great, I can ignore the weirdness for now.

image

Thank you for looking into this so quickly, hopefully the patch will make it's way into the next release. I can keep testing until the artefacts are gone, if that's something you will be addressing.

EDIT: the artefacting is persistent between stopping and starting the preview render, just panning around does this:

image

Changing to XPU still displays the artefacting but it is not persistent between stopping and starting viewport render.

prman-pixar commented 2 months ago

Actually, there's still some issues that I'm running into. Let me address those and I'll provide a new patch for you to test.

TeaNotes commented 2 months ago

No problem at all, I'm around for the next 3-4h if there's anything you need tested.

TeaNotes commented 2 months ago

So, a bit of a development with this patch. On another scene I have that I can share but not public, with the new patch it just won't render at all, render region remains grey, and trying XPU hard crashes, I will try to see what causes it.

EDIT: Rendering to "it" seems to work, rendering to Blender's native render viewer also works, just not viewport.

This is soooo weird and I don't know how to explain it. Anything I try to render in new files will not render. But if I import into the cube scene I submitted, it renders fine. That is the only file able to render anything in viewport with the latest patch. I'm guessing these are the issues you were mentioning.

prman-pixar commented 2 months ago

@TeaNotes do you mind trying this patch?

RenderManForBlender.zip

TeaNotes commented 2 months ago

This patch seems to render the other scenes as well, still artefacts like crazy when moving the view around but it does render my other scene just fine.

prman-pixar commented 2 months ago

@TeaNotes thanks for testing. When you say artefacting, are you talking the region outside the crop border? If so, we don't clear the buffers outside of the border, so could what you're seeing just be remnants of the previous render?

TeaNotes commented 2 months ago

My pleasure, thank you for providing a fix so quickly! And yes it's only outside the render region, it is exactly what you've described. I'm maybe used to the behaviour in Maya more :) But as far as the viewport crashes are concerned, this seems to be fixed as far as my testing so far has gone.

I'd say this closes the ticket but that's for you to decide.

PS: There is one viewport-related note I wanted to add, it's not a bug report, if anything it is borderline pedantic and mostly irrelevant functionally - if you let the viewport samples play out all the way, the last buffer refresh doesn't happen until you click somewhere, anywhere. It's not something you'd notice without looking at the viewport sampling stats, it's not affecting anything, it doesn't pause the render, just need to click somewhere to get that last refresh.... make of it what you will :))

Thank you again for looking into this, if you need further testing I'd be happy to help.

TeaNotes commented 2 months ago

I may have spoken too soon. I have a situation where with border crop enabled, if I tweak a node in the shader tree or disable a modifier, it will crash blender. Will probe this further and come back when I have solid repro steps because at this point I only have this on one file that I can reliably crash. All the above are fine without render region, but with it enabled, it crashes.