Martin Griffiths's banner
Martin Griffiths's profile picture

Martin Griffiths

@Griff_7,870 subscribers

#NoMansSky Engine Programmer. Owner of #TrickyPixels who re-mastered #JourneyPS4. Platform lead on #ProjectCars and EA’s Harry Potter games. BAFTA member

Shorts

As a graphics engine coder I think when you look at a flickering bug like this one in the video below it’s not immediately obvious what is going on. The key here is observation - to study this flickering/bugged render carefully - what do we see? Firstly for me it was very obvious that nearly all of the scene shadows were flashing on and off - but (but!) there was a secondary issue where some buildings and parts of the sky were also flashing purple. Hmmmm. Interesting. I initially thought then this might be two separate bugs - but because the sky purple element could only based on full screen post fx and not 3D rendering I looked at this first with a few GPU captures to step through all our post processing to find the rendering stage which made these pixels turn purple: When I did this I found the colour 3D texture LUT grading that makes our different biomes have unique colour palettes was going very wrong - colours near 0 or 1 were wrapping and making the purple elements that we see in the said sky and base parts. The only way this could happen was if the texture was corrupt (which it was not) or if the 3D texture sampling was wrapping and not clamped as intended. That was the Eureka moment - because if the post fx had the wrong texture sampler then the disappearing shadows which also require an exact texture sampler for comparing depth might be also wrong because of the same kind of texture sampling issue! So with this idea that the engine was using the wrong texture samplers, but only in very high draw call scenes like the big base here I the looked at some engine limits and found the bug very quickly - a circular dx12 descriptor buffer for samplers running out over multiple frames, reusing the wrong data for new scenes inflight. Hence the flickering, as the GPU randomly got wrong samplers for some post textures or shadow depth. Easy to fix with triple limits for future expansion and also adding an assert/debug spam in case this limit is ever reached again - QA testers would see this message and report if they ever saw a flicker with this style of bug. My bug and my bad from 2017 porting NMS to DX12 without foreseeing how massively complex bases and our game would grow.

As a graphics engine coder I think when you look at a flickering bug like this one in the video below it’s not immediately obvious what is going on. The key here is observation - to study this flickering/bugged render carefully - what do we see? Firstly for me it was very obvious that nearly all of the scene shadows were flashing on and off - but (but!) there was a secondary issue where some buildings and parts of the sky were also flashing purple. Hmmmm. Interesting. I initially thought then this might be two separate bugs - but because the sky purple element could only based on full screen post fx and not 3D rendering I looked at this first with a few GPU captures to step through all our post processing to find the rendering stage which made these pixels turn purple: When I did this I found the colour 3D texture LUT grading that makes our different biomes have unique colour palettes was going very wrong - colours near 0 or 1 were wrapping and making the purple elements that we see in the said sky and base parts. The only way this could happen was if the texture was corrupt (which it was not) or if the 3D texture sampling was wrapping and not clamped as intended. That was the Eureka moment - because if the post fx had the wrong texture sampler then the disappearing shadows which also require an exact texture sampler for comparing depth might be also wrong because of the same kind of texture sampling issue! So with this idea that the engine was using the wrong texture samplers, but only in very high draw call scenes like the big base here I the looked at some engine limits and found the bug very quickly - a circular dx12 descriptor buffer for samplers running out over multiple frames, reusing the wrong data for new scenes inflight. Hence the flickering, as the GPU randomly got wrong samplers for some post textures or shadow depth. Easy to fix with triple limits for future expansion and also adding an assert/debug spam in case this limit is ever reached again - QA testers would see this message and report if they ever saw a flicker with this style of bug. My bug and my bad from 2017 porting NMS to DX12 without foreseeing how massively complex bases and our game would grow.

72,701 views

Recently we had a bug on Switch where NPC interactions (which have Depth of Field) caused a horrible crawling black pixels bug. We saw reports of a similar bug with certain AMD 7xxx series cards with #NoMansSky Worlds Part II, but until this week hadn’t been able to reproduce this issue - our players reported various semi fix methods with AA modes and windows settings, adding to the mystery. I reproduced the bug yesterday after finding a YouTube link on Reddit that happened to show their full graphics settings! You can see the bug here in my quick phone capture of the horror bug! 4 hours of shader debugging later and I have submitted a fix which should make it into the next patch. On the surface this bug looks the same as the Switch issue which was NaN propagation - but it wasn’t: Interested to see if any graphics programmers here can have a stab at what the bug is, bearing in mind it was on one class of GPUs only.

Recently we had a bug on Switch where NPC interactions (which have Depth of Field) caused a horrible crawling black pixels bug. We saw reports of a similar bug with certain AMD 7xxx series cards with #NoMansSky Worlds Part II, but until this week hadn’t been able to reproduce this issue - our players reported various semi fix methods with AA modes and windows settings, adding to the mystery. I reproduced the bug yesterday after finding a YouTube link on Reddit that happened to show their full graphics settings! You can see the bug here in my quick phone capture of the horror bug! 4 hours of shader debugging later and I have submitted a fix which should make it into the next patch. On the surface this bug looks the same as the Switch issue which was NaN propagation - but it wasn’t: Interested to see if any graphics programmers here can have a stab at what the bug is, bearing in mind it was on one class of GPUs only.

28,757 views

I saw this video from Vazillia last week and was puzzled - We hadn’t noticed this quality regression with PSSR/PS5 Pro, but the bug reproduced on my dev kit, right away. 6 hours of debugging later, I worked out what went wrong and a fix made into the current 6.04 patch!

I saw this video from Vazillia last week and was puzzled - We hadn’t noticed this quality regression with PSSR/PS5 Pro, but the bug reproduced on my dev kit, right away. 6 hours of debugging later, I worked out what went wrong and a fix made into the current 6.04 patch!

14,740 views

On PS5 quite a few people reported this horrible visual bug with water and underwater base parts, affecting both VR and flat-mode. A fix is now in today’s experimental build and should make it to a future patch. My bug - rolling eyes when I found it.

On PS5 quite a few people reported this horrible visual bug with water and underwater base parts, affecting both VR and flat-mode. A fix is now in today’s experimental build and should make it to a future patch. My bug - rolling eyes when I found it.

26,401 views

Videos

No more content to load