Overcoming small engine issues

Project Page Next project post Post History

Over the past 2-or-so months, I've had limited time to work on my projects. On top of that, I had the virus over Christmas (thanks COVID), and I was quite sick. However, since the new year I have had a bit more in me to sit at the computer. And in doing so, I plugged away at some small things for The Dark Room project.

I've continued to work on adding interface bits and pieces for the user. Nothing particularly fancy, just simple click and command things. I now have some basic interface features for selection and timeline controls. Here's a screen shot:

Some basic interface tools, including a selection tool and frame/timeline control buttons.

Interestingly, I've designed the interface so that there's three ways in which a tool can be drawn. But I realised while taking the screen shot for the image above, that some ways are not included in the final image draw. They're actually drawn on top of the image, and not apart of the image itself. It means getting the screenshot with interfaces that use that kind of draw, are not included in the screen shot. The two tools shown in the image above are using a different draw type. The selection tool is drawn into the image itself, and is included in the screen shot function. But the frame/timeline commands use a different draw method, and are not apart of the image itself. Which means they're not included in The Dark Room's screen shot function. I had to take this screen shot using the standard Windows way (using the keyboard's print screen button). So I need to think about how this should really work, and what should be included in the in-built screen shot function. Something to think about.

Another step that's been good, is I can now bring in 3D scenes into my viewport. This is part of a crucial link between compositing 3D scenes over the cinema camera images. But it wasn't without its hiccups. One of the biggest was dealing with sub-pixel sized polygons. Due to the way The Dark Room works under the hood, there was a need to have sub-pixel draws take place, even if the engine wanted to discard them. It really looked funky at times, take a look at the screen grab below:

The engine had problems displaying one image over another

The image above highlights this issue quite well. There's two clips in this project, one you may spot is from the film camera; there's a partial shot of a caravan to the left side. And over the top is a mash of a 3D render. The engine here was having a difficult time displaying the 3D render over the film camera clip. By the way, the orange in that shot is part of the clip selection shader, where a selected clip is outlined in an orange colour. The highlighting works great! But the clip-over-clip draw does not. Here's another example where no clip is selected:

The viewport engine with a mash-up of two clips

You can see the two frames mixed together. There's a simple 3D render of a grey cube that's meant to be at the front, and the film camera image of the caravan in the back. This strange draw happens when parts of the clip are too small for the engine to draw, so it thinks it should discard them. This meant the rear image would at times come through the front one.

But alas, I did manage to find a way to resolve it. I had to enable some extra draw calls to tell the engine to not discard things that are too small. The following image shows the most recent fix:

The 'corrected' viewport draw, with sub-pixel drawing

Now, I'm not sure this is completely right yet. You can see the green camera frustrum lines (green lines) disappear behind the clip draws, even though they should be over the top. I still need to look at this. But the rest seems to work. So it should be enough for this tool for now, which was only ever meant to be a previsualiser.

And I have to keep reminding myself of this. This project is meant to be a previsualiser tool, not a complete compositing application. So, if it does enough for the user to work with, then that's all that matters. The final compositing will still be done in an external and more dedicated application.