devlog > graphics

Captain's Log: Stardate 78247.8

Having run into some more bugs with Filament, today I spent some time getting Filament set up as a git submodule that builds as part of Anukari's overall CMake config (instead of linking against a binary release). This has a number of advantages, the main one being that I can easily make local Filament modifications for debugging and bugfixes. Also, I can use the latest commits instead of the N-week-old release that the Filament folks produce. It does have the drawback of dealing with building Filament, but it wasn't too much of a problem (only took one PR to get it building).

Before digging into the Filament bugs I've seen, I wanted to get the 3D renderer preferences menu to a good stopping place. Namely, I wanted it to expose all the options, and I wanted low/med/high presets. I also had to implement a bit of a dependency system so that if, for example, Post-Processing is disabled, some of the other effects like FXAA need to be marked invisible or greyed out or whatever, since they do not work without Post-Processing.

This is all done, and it's really nice to be able to edit these parameters and see the results in realtime in the 3D editor window. And the "Max Speed" preset really is quite fast. I am pretty certain that it is no slower than my previous hand-rolled OpenGL implementation.

Next I will add something like a "3D Skin" tab, which to start off with will just contain a menu for changing the skybox. I have bought a number of commercial skybox models that I'll include with Anukari, and the user will be able to choose from those. In addition, I plan to allow custom skyboxes to be used. For now, this will be a power user feature since the user will need to run Filament's cmgen tool to convert their HDRI or EXR file into Anukari's format. Maybe eventually Anukari will do that itself, but it doesn't seem super important.

The 3D Skin tab will later include things for changing the 3D models for the Anukari objects, but I suspect that I will leave that until another time, and focus on stability with the new effects/skin tabs and cut a pre-alpha release as soon as practical.

Captain's Log: Stardate 78245

MacOS Mouse Hover

Continuing my work from my previous devlog entry, I finally tracked down exactly what was going wrong with mouse hover on MacOS for floating native child windows. Basically there is a bug in JUCE where it allows mouse events to be duplicated between the frontmost child NSView and whatever NSView is behind it. In practice the mouseMove events were being sort of interleaved, so JUCE saw the mouse as entering/exiting the button and then entering/exiting the window below the button on each event.

The fix was pretty simple. Here's hoping that the JUCE folks will accept my pull request.

OpenGL on Intel Iris Xe Chips

In the previous devlog entry I was investigating Google Filament crashes with the Vulkan backend. While doing that, I figured I'd just change the default backend to OpenGL to get things working in the meantime. That worked great on my NVIDIA desktop chip, but on my Intel Iris XE chip OpenGL displays a black screen.

I haven't tracked down the root cause here yet, but I debugged it to a pretty significant extent and am hoping to hand off further debug work to the Filament team in this bug.

While working on this, I found other issues with Filament, like the fact that it crashes in debug mode on MSVC and in general misuses its own panic feature. I have a feeling the Filament folks are going to be very annoyed with me; I've already discovered more bugs that I haven't yet filed.

Note: anyone who wants Anukari to succeed might like to add smiley emojis on all of these Github issues to indicate that they're important.

Configurable Graphics Settings

After fighting with all these third-party library bugs, I finally had a little bit of time today to spend on fun stuff, namely: making the graphics quality settings fully-configurable. Google Filament has a lot of options, and I plan to expose most of them to the user. Right now I have the majority of the options configurable via the preferences menu system, and it's been a blast to play around with different settings. The screenshots below show some fancy stuff you can do with bloom, depth-of-field, and camera ISO. There are also options for fog, various quality things like FXAA and MSAA, and everything can be disabled or turned to low-quality. Once I'm done with the preferences menu, it will be possible to turn the graphics down to the point that they're faster than the old renderer, while still looking much nicer.

Captain's Log: Stardate 78226.3

I'm getting closer to being able to release the next version of the pre-alpha installer. Today I finished up some basic stuff that the new renderer needs to go live.

One thing I frequently do when building out something new is instead of adding proper error handling, I'll just add assertions everywhere that an error can happen. This is obviously a no-go for production code, but it helps get the core functionality up and running much more quickly. This is especially useful when I'm not sure whether what I'm building will work, or I'm not sure about the architecture I've chosen. The assertions help make sure everything is working correctly, and then once I'm happy with the core code I can go through and replace them all with real error handling. I can be sure I removed all the assertions because I have a pre-submit that rejects them.

In this case, I had to do a little bit of wiring to get errors out of the 3D rendering thread into the main GUI thread to display to the user in a thread-safe way. That's all done now.

I also took the time today to redo the camera rotation & pan controls based on a suggestion from joey. Rotation is now done by an unmodified right-click drag, and pan is shift + right-click drag. You no longer need the middle mouse button, which is nice on touchpads where you can't do it like MacOS (but it's there if you want on desktop, or touchpads that do 3-finger tap).

I am still not super happy with the camera controls, but today I had an idea for how to make them even easier. Blender has a nice little widget in the corner of the window that shows the camera orientation, and you can left-click drag it to rotate the camera. I don't really use this, as I prefer the hotkeys/mouse, but it's much more discoverable/approachable, and possibly easier for some people on touchpads. Plus it will work with touchscreens. I'll extend Blender's idea a bit to add panning as well. But this will probably wait for a while.

Next up is fixing some issues with window resizing on MacOS. I think that I'm not correctly handling the fact that Retina displays have 2 physical pixels per 1 logical pixel.

Loading...

© 2024 Anukari LLC, All Rights Reserved
Contact Us|Legal