Giter VIP home page Giter VIP logo

microsoft / xbox-atg-samples Goto Github PK

View Code? Open in Web Editor NEW
657.0 69.0 224.0 523.7 MB

Game development samples published by the Xbox Advanced Technology Group using the Xbox One XDK and for the Universal Windows Platform (UWP).

Home Page: https://aka.ms/atgsamples

License: MIT License

C++ 87.87% HLSL 4.56% C 7.19% Batchfile 0.19% C# 0.10% POV-Ray SDL 0.09%
microsoft uwp cpp cpp14 direct3d game-development xdk

xbox-atg-samples's Introduction

Xbox-ATG-Samples

These samples are for the older Xbox One XDK. For the latest Xbox ATG samples using the Microsoft GDK, see Xbox-GDK-Samples.

This repo contains game development samples written by the Microsoft Xbox Advanced Technology Group.

  • Kits contains support code used by the samples
  • Media contains media files used by the samples
  • UWPSamples contains samples for the Universal Windows Platform
    • Audio
    • IntroGraphics
    • Graphics
    • System
    • Tools
  • PCSamples contains samples for the classic Win32 desktop PC platform
    • Graphics
    • IntroGraphics
  • XDKSamples contains samples for the Xbox One platform using the Xbox One XDK
    • Audio
    • IntroGraphics
    • Graphics
    • System
    • Tools

Samples by category

Audio

Spatial audio Simple playback UWP Simple playback XDK 3D playback UWP Advanced audio UWP Advanced audio XDK
XAudio2: Basic audio UWP XDK
XAudio2: Streaming UWP XDK
XAudio2: 3D playback UWP XDK
WASAPI: Playback UWP XDK
WASAPI: Capture UWP XDK
Play Text to Speech XDK

Introductory Graphics

Basic drawing UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
UWP (C++/WinRT) DX11 UWP (C++/WinRT) DX12 XDK (C++/WinRT) DX11 XDK (C++/WinRT) DX12
Basic texturing UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
Basic lighting UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
Bezier UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
DirectCompute UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
DirectX Tool Kit UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
Instancing UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
Multisample Antialiasing UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
Xbox One Device Setup XDK DX11 XDK DX12

Graphics

Physically Based Rendering UWP XDK
High-Dynamic Range Rendering UWP DX11 UWP DX12 XDK DX11 XDK DX12 PC DX11 PC DX12
Bokeh Effect XDK DX11 XDK DX12
Fast Block Compress XDK
Media Foundation PC DX12 UWP DX11 UWP DX12 XDK
ESRAM (XDK only) Simple DX11 Simple DX12 Advanced DX12
Xbox One (XDK only) AsyncPresent HLSL Symbols Simple DMA Decompression

System

UWP CPU Sets Memory Statistics
XDK Async I/O Coroutines Custom Event Provider Data Breakpoints Game DVR Memory Banks User Management
System Information UWP XDK
DirectXMath UWP XDK
Gamepad UWP XDK UWP (C++/WinRT) XDK (C++/WinRT)
Gamepad Vibration UWP XDK
Raw Game Controller UWP
ArcadeStick XDK
FlightStick XDK
WheelTest XDK
Input Interfacing UWP Mouse UWP Mouse XDK
User Gamepad Pairing UWP XDK
Process Lifetime Management UWP PLM XDK PLM Extended Execution
Localization UWP XDK
Device RGB Lamp Array UWP XDK
Xbox One X Front Panel Basic Text Demo Dolphin Game Logo

Tools

Error lookup
CrashDump Symbol Proxy OS Primitive TexConv for Xbox
FrontPanel Font FrontPanel Font Viewer

DirectX Raytracing (DXR)

SimpleTriangle SimpleInstancing Raytracing AO

Requirements

UWP apps

  • Windows 10 Anniversary Update (Version 1607) or later
  • Visual Studio 2017 (15.9 update) with the Universal Windows Platform development workload, the C++ Universal Windows Platform tools component, and Windows 10 SDK (10.0.19041.0).

XDK apps

  • Xbox One Development Kit
  • Xbox One XDK April 2018 - July 2018.
  • Visual Studio 2017 (15.9)

PC apps

  • Visual Studio 2017 (15.9) with the Desktop development with C++ workload and Windows 10 SDK (10.0.19041.0).
  • DirectX 11: Windows 7 Service Pack 1 with the DirectX 11.1 Runtime via KB2670838 or later.
  • DirectX 12: Windows 10 or Windows 11.
  • DirectX Raytracing: Windows 10 October 2018 Update or later.

VS 2019 / VS 2022

VS 2019 or VS 2022 can also be used with the required workload and components installed via Retarget solution for PC and UWP samples. The legacy Xbox One XDK does not support VS 2019 or later.

Privacy Statement

When compiling and running a sample, the file name of the sample executable will be sent to Microsoft to help track sample usage. To opt-out of this data collection, you can remove the block of code in Main.cpp labeled Sample Usage Telemetry.

For more information about Microsoft's privacy policies in general, see the Microsoft Privacy Statement.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Other Samples

For more ATG samples, see DirectML-Samples, PlayFab-Samples, and Xbox-LIVE-Samples.

xbox-atg-samples's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xbox-atg-samples's Issues

AO Sample Camera Change Fix

When the camera was altered from a y-axis rotation camera to a zoom based one, certain lines of the code were not changed to comply with the new projection to world matrix.

Specifically, line 83 in RaytracingAOPC12.cpp showing:
m_sceneCB[frameIndex].projectionToWorld = XMMatrixInverse(nullptr, viewProj);

Needs to be transposed as the entries are no longer symmetric:
m_sceneCB[frameIndex].projectionToWorld = XMMatrixTranspose(XMMatrixInverse(nullptr, viewProj));

Consequently, line 86 of AORaytracing.hlsl must be removed as it is no longer needed as a temporary fix:
screenPos *= 20;

Lastly, the readme seems to be missing information about the camera controls A and D for zooming in and out.

Cheers,
Kevin Pick

Why doesn't DSV need multiple Descriptor?

`D3D12_DESCRIPTOR_HEAP_DESC rtvHeapDesc = {};
rtvHeapDesc.NumDescriptors = c_frameCount;
rtvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
rtvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
Engine::ThrowIfFailed(m_d3dDevice->CreateDescriptorHeap(&rtvHeapDesc, IID_PPV_ARGS(&m_rtvHeap)));
NAME_D3D12_OBJECT(m_rtvHeap);
m_rtvDescriptorSize = m_d3dDevice->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);

D3D12_DESCRIPTOR_HEAP_DESC dsvHeapDesc = {};
dsvHeapDesc.NumDescriptors = 1;
dsvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;
dsvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
ThrowIfFailed(m_d3dDevice->CreateDescriptorHeap(&dsvHeapDesc, IID_PPV_ARGS(&m_dsvHeap)));
NAME_D3D12_OBJECT(m_dsvHeap);

`

rtvHeapDesc.NumDescriptors = c_frameCount;
dsvHeapDesc.NumDescriptors = 1; why???

GamepadVibrationUWP Vibration Issues

This project
\UWPSamples\System\GamepadVibrationUWP
when used with the official Xbox controller via Bluetooth, the vibration feedback seems to have lagging issues and sporadic trigger level issues, especially with the left trigger (LT).

The exact Xbox controller I am using is
https://www.amazon.com/dp/B08K4HLCPR?ref=ppx_yo2ov_dt_b_product_details&th=1

I am on Windows 11 Home 23H2 and I have updated the controller firmware to the latest using the Xbox Accessories app.

The problem does not happen when the controller is connected via USB with a wire, the problem only happens when the controller is connected wirelessly via Bluetooth.

I have tested GamepadVibrationUWP on the Xbox One with its stock controller and that appears to be fine. The problem only happens on Windows.

SimpleBezierUWP not working correctly on Xbox Series X and S

I tried to run the SimpleBezierUWP sample on Xbox Series X and S as a UWP game app (using retail consoles in devmode) and it is not working correctly. The rendered geometry simply won't show up in the viewport and no errors are logged on the debug console in Visual Studio. Investigating the problem a little bit using D3D11_QUERY_DATA_PIPELINE_STATISTICS revealed that the hull shader is still executed on the expected number of control points but no domain shader innvocations are recorded. From here on, I'm not sure how to debug this further. Is this a bug? Or is tessellation not supported on these devices and UWP?

Missed .inc files

Error C1083 Shaders/Compiled/XboxOnePBREffect_VSConstant.inc: No such file or directory, DirectXTK_XboxOneXDK_2015 <..>\Xbox-ATG-Samples\Kits\DirectXTK\Src\PBREffect.cpp 87
This error i got whe trying to compile 'Gamepad' sample.
As i see, there are no some .inc files with names such as 'XboxOnePBREffect_VSConstant.inc'
These includes don't work (PBREffect.cpp) for Xbox One part :

#include "Shaders/Compiled/XboxOnePBREffect_VSConstant.inc"
#include "Shaders/Compiled/XboxOnePBREffect_VSConstantVelocity.inc"
#include "Shaders/Compiled/XboxOnePBREffect_VSConstantBn.inc"
#include "Shaders/Compiled/XboxOnePBREffect_VSConstantVelocityBn.inc"

#include "Shaders/Compiled/XboxOnePBREffect_PSConstant.inc"
#include "Shaders/Compiled/XboxOnePBREffect_PSTextured.inc"
#include "Shaders/Compiled/XboxOnePBREffect_PSTexturedEmissive.inc"
#include "Shaders/Compiled/XboxOnePBREffect_PSTexturedVelocity.inc"
#include "Shaders/Compiled/XboxOnePBREffect_PSTexturedEmissiveVelocity.inc"

GraphicsMemory object - do MT compatible ?

After adding GraphicsMemory files to my project I start to got exceptions (C++ exception in debug build and 0xC00005 in release) when activating multithreading mode. Single threading works OK. Do GraphicsMemory from DirectXTK12 is MT-compatible ?

The usage is simple - for uploading 1 constant buffer into accelerator memory:

m_graphicsMemory = std::make_unique(m_D3D12device.Get());
m_computeHeap = m_graphicsMemory->Allocate((size_t)(4 * 1024));

SharedGraphicsResource* pUploadHeap = &m_computeHeap;
SAD_CS_PARAMS* pCBsadCSparams = reinterpret_cast<SAD_CS_PARAMS*> (pUploadHeap->Memory());

'filling memory here'

m_graphicsMemory->Commit(m_computeCommandQueue.Get());

Exception occur in the 'external' application that load this plugin after returning from the function with this sequence.

Unfortunately exception looks like happens in the server-application so remote debug session simply closes without breaking at the point of error.

Cant add any file pickers to SimpleSpatialPlaySoundUWP.cpp

Working with ChatGPT, I spent 3 hours trying to add some sort of file picker to SimpleSpatialPlaySoundUWP.cpp.

Despite very specific and detailed instructions (in both directions) in the end I could not find a file picker method that could be compiled, with the example, without errors.

Adding winrt to the project resulted in a ton of errors (VS2022).

Asking specifically for a UWP solution, that didn't rely on winrt, also did not result in any picker function compiling with the code (tried 3 or 4 iterative variants, feeding the errors back to ChatGPT).

Please consider adding a file picker to this sample project. There doesn't seem to be ANY file pickers used anywhere in the UWP sample code.

The target platform is Windows 10/11 (not Xbox).

Force feedback not working with T300RS

I have an issue somewhat similar to #22, but I don't get any errors at all. From my own testing, the code runs through all the force feedback checks and ends up runningm_effect->Start(), but the wheel doesn't budge. Essentially all other programs work fine, games and wheel testers alike.

Prerequisites in readme.md - build tools 149

Hi, I had problems building the SimplePlay3DSpatialSoundUWP audio sample due to "MSB4057: The target 'MarkupCompilePass1' does not exist in the project" against the DirectXTK project.

Finally solved this by installing the 10.0.14393 Windows 10 SDK for Visual Studio Built Tools 2017 15.2 (26530.15). This is not part of the default build tools install.

Please add build tools and versions to the prereqs, and if there's a way to adjust the build tools installer to include the latest version of all required components, that would be great.

Racing Wheel Force Feedback

I tried to run the InputInterfacingUWP because I want to use the Force Feedback feature on my Logitech G920 steering wheel.

When I run the code without connecting the steering wheel, the app window comes up and reports "No navigation input connected" - as expected.

However, when the steering wheel is connected, the window pops up and immediately closes.

In debug mode, I see these error messages:
image

I'm using Visual Studio 17 (15.9), Windows 10 SDK 10.0.18362.0. (I also tried with the Windows 10 SDK 10.0.17763.0, but I got errors in the DirectXTK code)

Is there other XBox software I need to download? Have you tested this code on the G920 steering wheel? Is this a bug with the steering wheel?

The RawInputControllerUWP works as expected using the Logitech G920 steering wheel, so I'm wondering if it is a problem only with the ForceFeedback functionality?

Do you know how to solve the "onecoreuap\xbox\devices\api\winrt\hidforcefeedback.cpp(415)\Windows.Gaming.Input.dll!00007FFD1AA50B10: (caller: 00007FFD1AA50864) LogHr(1) tid(607c) 80070005 Access is denied." error?

Question: explicit control of ESRAM?

Is it possible to explicitly control DirectX 12 resource residency by moving textures or buffers to / from ESRAM? I think I can assume that in certain cases Xbox will move stuff for me implicitly, but if I want a specific piece of data stay there I need some form of explicit control. Is there any info / documentation on that or it's not even possible? (context: I'm under Xbox Live Creators program)

Dependancies?

Is there any documentation anywhere about the dependancies? I cannot get this to compile no matter what I do. Just 1000+ errors.

What do I need to do to get any of the WinRT samples to compile on VS2022? I didn't imagine not getting anywhere when I tried to access any of the samples. I got thrown to the samples page and thought "oh, cool! I can test some stuff out." Nope. No documentation. Nothing. Just stop and go do something else. I feel like there's something vital missing there.

Xbox One X, Unity3D, UWP, 4K

Hello!

I'm working with Unity3D and i have a released game which i would like to bring to Xbox, i setted up my consoles with dev mode and deployment working well but, i would like to make the game on Xbox One X in 4k, but i can't figouring out how to iplement native 4k game starting, Unity3D make a Visual Studio project with IL2CPP backend what i can deploy to Xbox but in this project a can't find where i can set the resolution also if i try to set the resolution from ingame the game freeze and the cpu usage goes to null so i thinking to implement dx device creation from the SimplePBR12_UWP but how can i do that?

you can download my sample to see how Unity3D generate the project.

Thank you!

PIX for UWP games?

Is it possible to profile a UWP game under Xbox Live Creators Program with PIX? I see some UWP examples are using it, but I can't find official docs on this.

Thanks!

DX::ReadData - paths issue ?

I use DX::ReadData() function to load shader .cso file (as from sample SimpleCompute -

).
It is from file https://github.com/microsoft/Xbox-ATG-Samples/blob/9654b6efa4e1db52365fc2ae80386e0e27b9658d/Kits/ATGTK/ReadData.h

I not experience any issues at development Windows10 machine. But with release version users start to complain on Unhandled C++ exception crash at startup.

I add exception handler around DX::ReadData() call:

// load compute shader
 std::vector<uint8_t> computeShaderBlob;
 try {
   computeShaderBlob = DX::ReadData(L"Compute.cso");
 }
 catch (std::exception& e)
 {
   env->ThrowError(
     "MAnalyse: Can not load file Compute.cso %s", e.what()
   ); 
 }

And users report error:
MAnalyse: Can not load file Compute.cso ReadData
(https://forum.doom9.org/showthread.php?p=1962099#post1962099 )

The solution at user-side was mostly like to place compiled executable (.dll and launching .exe and compute.cso) in some simple path like c:\AVS and it works. The non-working path may be some like c:\plugins64+ . Can the + char cause some error in function ReadData ? Can ReadData return more detailed error about what is happens ? May I not right use e.what() method of return error description ?

The Windows SDK version 10.0.14393.0 was not found.

I'm trying to build "SimpleMSAA_PC12" project but it doesn't work with any of my installed SDKs (10.0.19041.0, 10.0.18362.0, and 10.016299.0). From the looks of it (see image), VS installer doesn't have any options to install SDKs older than 10.016299.0, is there any way to install 10.0.14393.0 SDK? Is there any workaround to use later SDKs with the project?

image

Build errors on SimpleRaytracingTriangle_PC12 project

I get a compile error, see output below. Looks like it's just the FallbackLayer and I'm guessing I haven't set something extra outside of the project.
Thanks for any help!

1>------ Build started: Project: FallbackLayer, Configuration: Debug x64 ------
1>'PrebuildCheck.bat' is not recognized as an internal or external command,
1>operable program or batch file.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: The command "cd "C:\Users\skendall\Downloads\Xbox-ATG-Samples-master\Xbox-ATG-Samples-master\Kits\D3D12RaytracingFallback\src..\tools\x64"
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: PrebuildCheck.bat
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(128,5): error MSB3073: :VCEnd" exited with code 9009.
1>Done building project "FallbackLayer.vcxproj" -- FAILED.
2>------ Build started: Project: SimpleRaytracingTriangle_PC12, Configuration: Debug x64 ------
2>LINK : fatal error LNK1104: cannot open file 'C:\Users\skendall\Downloads\Xbox-ATG-Samples-master\Xbox-ATG-Samples-master\Kits\D3D12RaytracingFallback\Bin\x64\Debug\Output\FallbackLayer.lib'
2>Done building project "SimpleRaytracingTriangle_PC12.vcxproj" -- FAILED.
========== Build: 0 succeeded, 2 failed, 1 up-to-date, 0 skipped ==========

Profiling Tools

Hi,

I'm relatively new to UWP development on Xbox One and I'm wondering what kind of performance profiling tools are available for this platform. Is there something similar to the ETW system present on desktop Windows 10?

Thanks

SimplePlay3DSpatialSoundUWP crashes when changing Spatial Sound setting

SimplePlay3DSpatialSoundUWP (and potentially others too) crash when the user changes the "Spatial sound" setting from e.g. Windows Sonic for Headphones to OFF. (Also crashes at any other combination.)

Callstack:

SimplePlay3DSpatialSound.exe!ISACRenderer::IsActive() Line 29 C++
SimplePlay3DSpatialSound.exe!`anonymous namespace'::SpatialWorkCallback(_TP_CALLBACK_INSTANCE * Instance, void * Context, _TP_WORK * Work) Line 37 C++
[External Code]

Reason:
Sink->m_renderer in SpatialWorkCallback is NULL.

SimplePBR12 Xbox problems

  • it works extremely slow in debug mode under Xbox one.

  • unlaunchable in release mode - exceptions

Xbox has installed updates

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.