Direct3D 9 Z-Buffer Precision Bug occuring only in release build - direct3d

I'm currently experiencing a weird issue that looks like Z-Fighting with Direct3D 9. I suspect that my problem is actually a Z buffer precision issue.
I noticed that absolutely no depth artifacts appear in Debug builds (I'm using Visual Studio 2012). The bug only occurs in Release builds.
The depth buffer format I'm currently using is 24-bits padded with 8 (D3DFMT_D24X8). When I use only 16-bits, the exact artifacts appear in both Debug AND Release builds. So what does that mean? Is DirectX rejecting 24-bits depth buffers? And if that's the case, why would you even do this?
Aside from all that, I tried setting 32-bits, but it just crashes and returns a null-pointer for the D3D device.
Many thanks in advance.
Here's a screenshot of my problem :

Ok, so I eventually found a work-around. I divided my scene into regions of depth, and I'm rendering all of them one by one after clearing the Z-buffer between each passes.
I currently have two passes (0.1m to 5m, and 5m to 10km). This seems to work pretty well for now.

Related

Why does the dimensions of Kivy app changes after deployment?

As mentioned in the question, I build a kivy app and deploy it to my android phone. The app works perfectly on my laptop but after deploying it the font size changes all of a sudden and become very small.
I can't debug this since everything works fine. The only problem is this design or rather the UI.
Does anyone had this issue before? Do you have a suggestion how to deal with it?
PS: I can't provide a reproducible code here since everything works fine. I assume it is a limitation of the framework but I'm not sure.
It sounds like you coded everything in terms of pixel sizes (the default units for most things). The difference on the phone is probably just that the pixels are smaller.
Use the kivy.metrics.dp helper function to apply a rough scaling according to pixel density. You'll probably find that if you currently have e.g. width: 50, on the desktop then width: dp(50) will look the same while on the phone it will be twice as big as before.
PS: I can't provide a reproducible code here since everything works fine.
Providing a minimal runnable example would, in fact, have let the reader verify whether you were attempting to compensate for pixel density.

Nvidia High Performance Processor Setting leads to graphical bug (Seizure Warning) with current lighting system, drawing completely in the shader code

I followed the Lighting tutorial on learnopenGL, modifying some of the code to work in a 2D game engine. Everything was looking great and my team got our game done and the lights were quite simple for our designers to use. However we ran into a rare bug. as shown here: https://www.youtube.com/watch?v=to0mMP5I0cs one team member was able to recreate the bug by switching his Nvidia settings to use the "High Performance Processor" as opposed to "Integrated Graphics". Otherwise everything renders properly. The bug doesn't appear when there are no lights and everything is rendered in its full color. We have gone through alot of Ideas already but they haven't worked and now I am at a loss. Does anyone have any ideas about what is going on?
Always make sure you initialize your variables. Apparently some cards and drivers automatically initialize vec3 to (0,0,0), but others don't. That was what was going on here. Garbage values causing different colors at each fragment. By Initializing my resulting color vec3 to (0,0,0) at the beginning the problem is fixed.

UWP MapControl does not draw MapPolyline and other elements on Surface Pro 4

The same project compiled on the identical versions of Windows 10 and Visual Studio 2015 but on different hardware (Asus laptop and Surface Pro 4) produces different results: some elements (like MapPolyline and borders of MapPolygon) are not drawn along with the whole streets outlines and such (see the attached screenshots)
Expected behavior
Problematic behavior
Does anybody experience similar behavior and/or know how to fix that?
I think this is the same bug as reported here http://answers.microsoft.com/en-us/windows/forum/apps_windows_10-win_maps/windows-10-maps-app-sometimes-does-not-show-the/7183916a-9567-4d49-ab92-297eec8737ab?auth=1 Microsoft is working on a fix...

Did XAML caching behavior change in Windows 8.1 Preview

I have a repeating XAML animation of multiple scaling arrows which update several times per second which has worked fine on Silverlight, Win8, WinPhone7, and WinPhone8. But now, with the Windows 8.1 Preview I'm getting the following unexpected behavior:
Initial display of the animated arrows is correct through one cycle of all scaled sizes.
On the second and subsequent repetitions of the animation, the arrows are scaled to the correct size, but are all apparently scaled up versions of a low rez, cached bitmap of the arrow. This looks horrible.
If I switch apps and return to my app, the initial display is correct and then reverts to the bad low-rez version (in other words behaviors 1 and 2 repeat).
I would assume this is due to some change in UIElement caching behavior in Win8.1 Preview, but can't find any documentation of a change in this area.
UiElement.CacheMode would seem a likely candidate to effect a fix, but I'd like to know if this behavior is by design or will require code changes for the final release.
Answering my own question: A work around to the bug/feature in Windows 8.1 Preview XAML is adding the following to the TransformGroup associated with the problematic UIElement:
rotateGroup.CacheMode = null;
I have absolutely no idea why this change was necessary. One further description of the problem before the above hack was added:
If the arrow resizing changes incrementally by a small amount, then the bug appears. If the scale factor changes in larger jumps, then the bug goes away and the arrows display correctly.

Parts of Visual C++ IDE GUI stops refreshing

I'm having a weird bug on one of my computers with Visual C++. For some reason the screen will stop refreshing where my source code is. I can force a single refresh if I minimize and maximize Visual C++.
For example if I try to type something or use the scroll bar, it will not show any changes until I minimize and maximize. If I type something the changes have been made however. I can save and those changes will remain.
Oddly auto-complete still works as intended. If I type myClass.get_ it will bring up the auto-complete window.
It seems to occur randomly. It can happen if I leave the program up for a bit while doing other things or when I first start up the program. A fresh reboot nearly always fixes at that moment but what ever the cause is will occur after time. One thing that nearly always causes the program to stop working is if I start a video game.
I'd appreciate any help, thanks.
Assuming this is VS2010 - I think it does new-fangled GUI things with WPF and notably relies on hardware acceleration and write combining quite a lot more than before.
I had display issues in a virtual box gues installation (with multiple-monitor support in the guest enabled). I worked around it by lowering / disabling the hardware acceleration settings for the (virtual) graphics adaptor.
right click desktop
screen resolution
advanced/performance
use the slider to adjust acceleration level
Changing this setting apparently required a reboot on my system when I did it.

Resources