Text
Don’t be sorry for anything. I’m not going to stop and neither should anyone else. If i can afford to be a patron of you I will. I don’t exactly care about the voucher awards as much as I do for supporting you. If people are only supporting you for the rewards rather than to support your talent then they are supporting you for the wrong reasons. You’re not gaslighting anyone by saying you need a couple of months off to stabilize your life. So please stop always feeling like you owe us something.
If you currently support my patreon, please read:
Keep reading
17 notes
·
View notes
Text
Changing things up a bit
Instead of doing full on tutorials I will focus on making a rendering engine in DIrectX12 and Vulkan and then share my tales from the pixel mines as they are callled. I will still share code and coding tidbits but I feel that explaining all the code and what it does just to display a window is pretty discouraging to new users
0 notes
Text
DirectX 12 vs Vulkan
Which API is better for You?
DirectX 12 is for Windows only and highly optimized for the system, Vulkan is multiplatform but not as optimized for every platform.
DirectX 12 is written in C++ giving access to destructors and constructs off the bat. Vulkan is written in C, and therefore does not have these until you make them, however it also means Vulkan has more coding freedom then DX12.
Vulkan has the capability for superior graphics, however it doesn’t handle audio, input and networking like DirectX. I could go on and on about what things each is better for. However the real question is this. Which would you rather use and does it suit your needs. Not whether or not you like the name of one of them or have heard more of the other.
0 notes
Text
Hello Window : Part 1 Headers
Now that you’ve set up your Direct3D 12 project here’s the long road ahead for displaying a window.
First you should have a header for your Windows includes. I call it WSys.h and after the auto generated preprocessor operation known as the #pragma once operand. Type in the following code. I’ll explain it as we go.
#ifndef WINDOWS_LEAN_AND_MEAN #define WINDOWS_LEAN_AND_MEAN #endif
this tells windows.h not to include rarely used and deprecated code.
#include <windows.h>
Next this line tells us to include the windows system API but because we specified lean and mean we aren’t including everything.
#include <d3d12.h>
includes Direct3D 12
#include <dxgi1_4>
includes the directx graphics infrastructure.
#include <D3DCompiler.h>
I believe this is the shader compiler for DirectX shaders to give the GPU byte code instead of fully fledged text, but I may be wrong. Either way its used to compile Direct3D at some level and therefore it is necessary.
#include <DirectXMath.h>
This includes math helpers (obviously). So not only is it very useful with Direct3D but it is also useful for Vulkan.
#include <string>
this is to include the string library. For writing words instead of single characters.
#include <wrl.h>
includes the Windows runtime environment.
Alright that’s it for this file for now.
Next let’s create the next class. This class will be for displaying our window. Let’s call it MainWindow. First, in the public section create a constructor, a title setting method and a run method.
D3D12HelloWindow(UINT width, UINT height, std::wstring name);
int Run(HINSTANCE hInstance, int nCmdShow);
void SetCustomWindowText(LPCWSTR text);
Next create a protected section and within it create an init method and update method, a render method, a destroy method, an event handling method, a method to get an asset path, a standard window proclamation method, an unsigned integer for the height and width, A real number for the aspect ratio, A window handle, and a check for whether or not we are using a warp device.
virtual void OnInit(); virtual void OnUpdate(); virtual void OnRender(); virtual void OnDestroy(); virtual bool OnEvent(MSG msg);
std::wstring GetAssetFullPath(LPCWSTR assetName);
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
UINT m_width; UINT m_height; float m_aspectRatio;
HWND m_hwnd;
bool m_useWarpDevice;
Finally in the private section create a method for parsing command line arguments, a method to load the graphics pipeline, a method to load your assets, a method to populate the command list, a method to require the previous frame to finish before loading the next one, a wide string object to hold the assets path and title, a Command Pointer for the swap chain, the directx 12 device, the directx 12 resources, a command allocator, A DirectX 12 descriptor heap, a manager for the pipeline states, and a command list, and an unsigned int for the size of our descriptors.
void ParseCommandLineArgs();
void LoadPipeline(); void LoadAssets(); void PopulateCommandList(); void WaitForPreviousFrame();
std::wstring m_assetsPath;
std::wstring m_title;
ComPtr<IDXGISwapChain3> m_swapChain; ComPtr<ID3D12Device> m_device; ComPtr<ID3D12Resource> m_renderTargets[FrameCount]; ComPtr<ID3D12CommandAllocator> m_commandAllocator; ComPtr<ID3D12CommandQueue> m_commandQueue; ComPtr<ID3D12DescriptorHeap> m_rtvHeap; ComPtr<ID3D12PipelineState> m_pipelineState; ComPtr<ID3D12GraphicsCommandList> m_commandList;
UINT m_rtvDescriptorSize;
Next, still in the private section create an unsigned int for the frame index, a handle for the DirectX 12 fence events, a command pointer for the fences, an unsigned 64 bit integer for the fence value and a static variable for the frame count.
UINT m_frameIndex; HANDLE m_fenceEvent; ComPtr<ID3D12Fence> m_fence; UINT64 m_fenceValue;
static const UINT FrameCount = 2;
Finally, at the top but after the pragma preprocessor and the inclusion of WSys.h declare a using statement to use the M$ Windows Runtime Library namespace.
using namespace Microsoft::WRL;
That’s all for the headers section.
0 notes
Text
Setting Up a Project for Direct3D 12
First you are going to need a few prerequisites. The first is Windows 10, if you don’t have it or don’t feel like switching then please check out my Vulkan tutorials. The next is Visual Studio 2015. You can get that for free at https://visualstudio.com and clicking the community version.
You will also need to install it with a custom installation with everything checked. The most important are C++ and the Universal Windows SDK.
Next for reference I recommend downloading the DirectX 12 samples from Github at https://github.com/Microsoft/DirectX-Graphics-Samples and choosing Download Zip.
Finally to set up a 64 bit DirectX application open up Visual studio 2015 and click new project.
Then setup an empty Win32 Application, because as tempting as it is, we are not going to use the DirectX12 App template.
Finally Set up the project for 64 bit mode by clicking the x86 and changing it to x64.
Then for the DirectX SDK we simply need to add a couple things. First click the project settings menu by right clicking the project or by going to the project drop-down menu and clicking project settings.
Next setup the project to use the windows 10 SDK
Last but not least go to the linker tab select input, then go to additional dependencies.
Then type in as follows.
d3d12.lib; dxgi.lib;
0 notes
Text
Intro to DXVK
This is an introduction to my DIrectX 12 and Vulkan Tutorials. Because the APIs are immensely difficult to master. Therefore someone has to create a tutorial series for each of them, so I figured I’d be up to the task. Before we begin I will like to post the requirements to follow the DirectX 12 tutorials. First you need Windows 10, second you need a copy of VIsual Studio Community Edition(its free), finally you need a graphics card no older than Nvidia 600 series. You will also need the newest drivers from your graphics card vendors for your GPU.
0 notes