What I did today

Improved my motion blur quite a bit. It turned out that a fast blur path of the shader sometimes kicked in at unexpected times due to the threshold for it being too low, so now it only kicks in if the fast path would yield very close to the same result. That made it a bit slower in some cases, but in most cases it has no significant impact on performance

In addition, I found a way of renormalizing the weights based on the maximum motion vector spread of the pixels processed. This helped in cases where a single fast moving pixel could cause an entire 3x3 area of tiles to get a very high dominant motion vector, effectively corrupting the motion blur of slow-moving objects around it and showing an ugly reduction in blurriness for nearby pixels. This was most visible when the camera was moving and a foreground object was moving fast on the screen, causing the slower moving background around it to get a reduced amount of motion blur. Although my fix isn’t perfect, it’s a LOT better than nothing, and together with the fast path fixes it really improved the quality, stability and continuity of the motion blur. I really like the result.

In the following picture, the old and new technique is compared. The problem here is that the foreground objects are moving much faster than the distant tall wall, and the tiles around the foreground object don’t compute the motion blur for the background walls correctly. The left side is the how the blur looks with my renormalization. The green circles highlight areas that it improved. The right side uses the old version and the red circles show the artifacts that are fixed by the renormalization.

Tomorrow I will look into just one more thing. Since my anti-aliasing is applied before the motion blur (the guy in the middle that isn’t moving looks great), the motion blur doesn’t get anti-aliased. If you look closely at the motion blur at the top of the big white thing to the left, the top edge looks quite aliased. I think I can with a clever AA-system offset the blur a tiny bit to get some anti-aliasing on the motion blur edges as well.

@theagentd Really looking forward to seeing it in all it’s glory, especially with knowing bits of the technical narrative behind it.
Thanks for these great WIDT posts.

Glad you like them. It’s quite giving for me to write down my progress as well like this, as it forces me to think through and justify my decisions. It helps me look at it from a different perspective. Hopefully it’s also useful/interesting to others. >___<

If you’re interested in the motion blur I have, it’s based first on this paper: http://graphics.cs.williams.edu/papers/MotionBlurI3D12/, with the improvements described in these slides: http://advances.realtimerendering.com/s2014/#_NEXT_GENERATION_POST For Advanced Warfare, they did a lot of cool motion blur enhancements that helped make the motion blur better and for reconstructing the background. I’m looking into depth of field from that slide as well for cutscenes, we’ll see how that goes.

Just creating small prototypes to learn new things ;D

Got a 17 second 3x3 solve. Finally sub 20…

All these great projects are making me really want to make a game. Now what should I make…

Did some motion blur anti-aliasing experiments, but nothing worked out… Trying to use the previous frame failed miserably due to horrible ghosting, and the subpixel nudging idea didn’t help at all. I’ve run out of ideas for now, but at least the current problems are hard to spot in motion, which luckily is when the motion blur obviously kicks in. Still, once you’ve seen the artifacts you can’t unsee them… >___<

@theagentd sorry, haven’t followed the whole discussion, but why can’t you do the motion blurring before AA?

Switched to Java 8 because I want default methods for my entities. Yum… multiple inheritance, kinda!

Checked out this 1042-page monster from the public library today

Today I played around with the Android SDK/XML a little and had a blast ;D

Definitely think this is the type of field I want to go into (mobile/tablet development)!

Makes me want to start another game alongside my current one :frowning:

To properly do motion blur where sharp objects aren’t blurred by motion blur, you need to take the depth of each pixel into consideration. If a sharp foreground is overlapping an unsharp background, the sharp foreground should stay sharp and the background should only blur the background, etc. Anti-aliasing basically averages together color values. If you anti-alias the silhouette of a foreground object you will in some way mix in the color of the background to get a smoother image. That means that the depth information you had is no longer relevant since each pixel is now a weighted average of samples that originally had different depth values, and we can’t tell them apart anymore since they’re just a single color now. The result is that the silhouette will “smear” since you can’t get correct depth ordering.

EDIT: Oh, I misread your question. I AM doing it before anti-aliasing, but if you motion blur the aliased picture the aliasing can sometimes get more obvious. A small, bright flickering pixel is no longer just a pixel, it’s a flickering 30 pixels long line.

EDIT: Also, as my anti-aliasing only works on triangle edges and I can’t do temporal anti-aliasing of motion transparent stuff like motion blurred edges without getting ghosting, the motion blur basically has to be added on top of the anti-aliased picture, reintroducing the aliasing.

Today, for the first time, I played a sound on an Android emulator while making use of a Java audio library that I wrote.

Leading up to this (over last 6 months):

  • building new PC from parts that is able to handle Android dev;
  • installing Android Studio and emulator in Linux;
  • working through various books and tutorials to learn the basics of Android programming;
  • getting a tutorial that has a “simple synth” in Android working (https://audioprograming.wordpress.com/2012/10/18/a-simple-synth-in-android-step-by-step-guide-using-the-java-sdk/);
  • refactoring my audio mixer (in Java) to separate out the platform-specific parts (yesterday mostly), testing that it still works in the Java context;
  • importing the jar to the Android project and running a simple synth written in Java, running as a track on my audio mixer.

Sounded as clear as a bell. Next up, maybe I will test getting the FM synth bell working (the one used in Hexara) as well as the Event Handling parts. I’m a bit concerned that one of the classes I’m using (ConcurrentSkipListSet) may not be implemented in Android.

Learned that default methods really aren’t a good idea for this. Going back to using simple composition.

I had a quiet chuckle.

I like java8 interfaces because you can finally have static methods in them. You would think that with java’s class/namespace conflation that would have happened earlier.

At work a couple days ago I found a great opportunity for static interface methods, but it wasn’t to be because our projects are still running Java 6. I love dusty old enterprise software, it’s so fascinatingly horrible to manage!

If you just need a place for methods that doesn’t have to be an interface I usually use a variant-less enum:

public enum Namespace {
    ;

    public static blah blah(blah blah) {

    }
}

Be glad you aren’t one of the poor schmucks stuck on 1.4.2 or whatever.

As long as nobody uses lambdas for recursion in methods everything is fine…

-ClaasJG

[quote] private static void printUserDirContent(){
@SuppressWarnings(“unchecked”)
Consumer[] printer = new Consumer[1];
printer[0] = p -> {
System.out.println§;
if (Files.isReadable§ && Files.isDirectory§ && !Files.isSymbolicLink§)
try (DirectoryStream ds = Files.newDirectoryStream§){
ds.forEach(printer[0]);
} catch (IOException e) {
e.printStackTrace();
}
};
printer[0].accept(Paths.get(System.getProperty(“user.dir”)));
}
[/quote]

Well that’s just an infinite recursion, so of course it’s not fine. It would work (although still be a bit weird) if it wasn’t.