New slots system in render view

These ideas are all great. The most useful to me would be automatically creating new slots. I’m always overwriting renders that I intended to keep because I forgot to save or change slots before I pressed F12. Retaining the previous render when rendering with boarder is also great. I missed this feature when switching from Mental Ray to Cycles. It truly is a time saver when rendering complex, high res scenes and you see one small item you want to change. There have been many times I’ve had to restart a 30 minute render just make small changes that only effect one small part of the image - or render boarder and have to composite it back in manually.

I agree with brecht that the slots should be limited, but I think the number should be higher than 3 slots. I think 10 would be more helpful for doing interior stills for clients, but I appreciate that using too many can kill memory usage, so it may be worth considering allowing the user to adjust this to his or her liking.

1 Like

The thing I am trying to do at the moment is that you can (automatically or manually) offset all the images in the slot so that when you render again it saves your render (without having to change the slot before rendering). For the number of slots, you can already choose it in blender 2.8, you can add and delete slots as you wish :slight_smile:

That’s definitely a good start. I’m thinking about two different scenarios where having to manually delete slots may not be good:

  1. new users who don’t know that they need to do this. They spend all day trying different renders in a single file and their memory and/or disk space is filled up with 4k EXRs.
  2. experienced users who spend all day making renders and realize they have to, under a tight deadline, go back and have to manually delete multiple slots to free up memory.

Even experienced users who develop their renders in preview mode may not see some issues with the render until the samples and resolution are pushed way up to final render settings. Will border renders take up new slots? These scenarios add to the memory usage and time required to clean up slots.

I say this understanding that first steps are important. Automatic slot creation will be a great feature.

No the slots won’t be automatically created, at the moment you can already manually create or remove slots, even empty a slot. With my proposal let’s say that you have 5 slots, all the slots have already an image in them. When you press the push button (this can be done automatically when you render a new image), the 5th slot is emptied, then the image of the 4th slot goes into the 5th, the 3rd into the 4th, … , and your render goes into the 1st slot. And the render will always be done in another slot called Render slot. (don’t know if this is clearer haha). So yes now, border renders will be considered like a normal render and will override the entire render slot.

I misunderstood. I thought you were moving away from that idea. Proceed. :slight_smile:

@brecht I have a quick question about how the images and the slots are handled in the code (if it is all right aking about it here ?) :

Does the image in each slot stored in RenderSlot → render ?
If not, is it possible to access each image from Image → renderslots or is there a better way ?

Maybe it is silly questions but I am not sure of how the images and the slots are linked, I style playing with the code to find out, but if you have any clue about it :slight_smile:

There is a RenderResult that stores all the render layers and passes resulting from a render. These are indeed stored in RenderSlot.render, with one exception. The active render is stored elsewhere and owned by the rendering pipeline. It is accessed through RE_AcquireResultImage / RE_ReleaseResultImage for thread safety while the renderer is changing it.

1 Like

I started a patch here, so if some of you have any advice to give me on the code part, you are welcome.

So now I have a frame buffer system working, with a Automatic push in the frame buffer toggle available in the user preferences, and I wanted to know exactly where I can put this toggle ? At the moment it is just under the “compute device” section but I don’t think it’s the right place.

1 Like

We don’t have an obvious place to put it, I would suggest the Editing tab in the user preferences since it seems to be that kind of setting.

Image viewer header?

I am not sure if it is an option that the user would change a lot, so it’d take room for an option you change only once ?

It can be an option in the Render Slots panel if it’s something you want to control per .blend file, instead of in the user preferences. People can still save that in their startup.blend.

1 Like

Sounds as the best fit to me

I changed it, it is now above the new slots list in the N panel of the image editor :slight_smile:

@brecht
I have a few question about the developement now:
At the moment I am storing the char for the compare_with toggle AND an int called compare_slot (which is the number of the slot that is conpared) both in SpaceImage, the problem is that as soon as a new SpaceImage is created, compare_slot goes back to 0, so I have two questions (related hopefully) :

  • How can I specify that it has to be equal to 1 by default ?
  • Where can I store this variable so that it is not reset every time we close the Image Editor ?

@ideasman42
I would like to start working on a manipulator for the Slider comparison and as you worked a lot on manipulators, I wanted to know if you had a few tips and advices to create a new one, like where to start ? In what file should I write a manipulator that will be in the Image Editor when it is displaying the Render Result ?

For initializing it in new editors, set it in image_new() in space_image.c. The more tricky part is version patching existing files (which includes the startup.blend).

For example see this code for initializing the new texture_paint_mode_opacity property in the 3D view:
https://developer.blender.org/diffusion/B/browse/blender2.8/source/blender/blenloader/intern/versioning_280.c;c974a359531733e02adcd7366d684291b257affa$1517

It seems the entire image editor state is lost when rendering to a new window and closing it. So if you want to avoid that you either need to store it on the “Render Result” Image datablocks, and then it’s shared between all image editors. If it needs to be per image editor, we have to figure out some way to preserve the image editor settings in general.

Hey, I don’t know if @ideasman42 saw this post but if you have an answer for that @brecht, let me know :slight_smile:

On top of that I have some questions about drawing the image in the view, to implement the difference mode. I think I found the areas in the hierarchy I have to work on. But I don’t really know if I have to work in the image_draw.c and if there are already functions to do that, or is if I have to go at a lower level maybe in glaDrawImBuf_glsl_ctx_clipping in glutil.c, or even lower to work with the pixel values and in that case I don’t know where this is. Do you have an idea ?

Thanks a lot for your help, hope my code is not too much of a mess, please let ma know if I am really doing things the wrong way :slight_smile:

Hey, I was trying to find one of the crash I get when I push the images twice and display the Slot 3, so I am using Microsoft Visual Studio now (was using Sublime Text before) and when I try to run Blender from Visual Studio in Debug mode, I get this :

It works perfectly when I run it in Release mode.

Do you know where that could come from ?

I don’t know if this is the right place (if not, then delete this message), but

Is it possible to implement such feature like render new in new slot, and don’t overwrite existing?
And if render slots is maxed out, then creating empty one for next render or overwrite first one.
And option to store render results in .blend file, because they are disappearing every time you reopen your scene.