Obuka
Modul
Render a 3D model with Azure Remote Rendering - Training
Use Azure Remote Rendering to render a 3D model in a Unity project. You can deploy the model to HoloLens 2 or use the power of mixed reality with the MRTK.
Ovaj preglednik više nije podržan.
Prijeđite na Microsoft Edge, gdje vas čekaju najnovije značajke, sigurnosna ažuriranja i tehnička podrška.
When two triangular surfaces overlap, it isn't clear which one should be rendered on top of the other. The result even varies per pixel, resulting in camera view-dependent artifacts. When the camera or the mesh moves, these patterns flicker noticeably. This artifact is called z-fighting. For augmented reality and virtual reality applications, the problem is intensified because head-mounted devices naturally always move. To prevent viewer discomfort, Azure Remote Rendering offers z-fighting mitigation functionality.
Napomena
The z-fighting mitigation settings have no effect on point cloud rendering.
Situation | Result |
---|---|
Regular z-fighting | ![]() |
Z-fighting mitigation enabled | ![]() |
Checkerboard highlighting enabled | ![]() |
The following code enables z-fighting mitigation:
void EnableZFightingMitigation(RenderingSession session, bool highlight)
{
ZFightingMitigationSettings settings = session.Connection.ZFightingMitigationSettings;
// enabling z-fighting mitigation
settings.Enabled = true;
// enabling checkerboard highlighting of z-fighting potential
settings.Highlighting = highlight;
}
void EnableZFightingMitigation(ApiHandle<RenderingSession> session, bool highlight)
{
ApiHandle<ZFightingMitigationSettings> settings = session->Connection()->GetZFightingMitigationSettings();
// enabling z-fighting mitigation
settings->SetEnabled(true);
// enabling checkerboard highlighting of z-fighting potential
settings->SetHighlighting(highlight);
}
Napomena
Z-fighting mitigation is a global setting that affects all rendered meshes.
Z-fighting happens mainly for two reasons:
The first problem can always happen and is difficult to eliminate. If this situation happens in your application, make sure that the ratio of the near plane distance to the far plane distance is as low as practical. For example, a near plane at distance 0.01 and far plane at distance 1000 creates this problem much earlier than having the near plane at 0.1 and the far plane at distance 20.
The second problem is an indication of badly authored content. In the real world, two objects can't be in the same place at the same time. Depending on the application, users might want to know whether overlapping surfaces exist and where they are. For example, a CAD scene of a building that is the basis for a real world construction, shouldn't contain physically impossible surface intersections. To allow for visual inspection, the highlighting mode is available, which displays potential z-fighting as an animated checkerboard pattern.
The provided z-fighting mitigation is a best effort. There's no guarantee that it removes all z-fighting. Also, mitigation prefers one surface over another. When you have surfaces that are too close to each other, the "wrong" surface ends up on top. A common problem case is when text and other decals are applied to a surface. With z-fighting mitigation enabled, these details could easily just vanish.
Obuka
Modul
Render a 3D model with Azure Remote Rendering - Training
Use Azure Remote Rendering to render a 3D model in a Unity project. You can deploy the model to HoloLens 2 or use the power of mixed reality with the MRTK.
Dokumentacija
Port the GLSL - UWP applications
Once you've moved over the code that creates and configures your buffers and shader objects, it's time to port the code inside those shaders from OpenGL ES 2.0's GL Shader Language (GLSL) to Direct3D 11's High-level Shader Language (HLSL).
Component-wise double-precision add.
ID3DX11Effect GetVariableByName method (D3dx11effect.h) - Win32 apps
Get a variable by name.
ID3DUserDefinedAnnotation (d3d11_1.h) - Win32 apps
The ID3DUserDefinedAnnotation interface enables an application to describe conceptual sections and markers within the application's code flow.