Questions tagged [directx]
DirectX is a collection of APIs for handling tasks related to multimedia, especially 3D graphics and game programming and video, on Microsoft platforms.
5,749
questions
0
votes
0
answers
20
views
An array of Texture3D's in DirectX?
There is Texture2DArray in HLSL, but is there any workaround for an array of Texture3D's in HLSL/DirectX?
0
votes
0
answers
20
views
What does the member "AlphaMode" do when creating a DXGI swapchain for Direct2D device contexts?
I am currently creating a game using Direct2D. For rendering, I want to use D2D's device context because it allows for more control and effects etc.
I have created the HWND swapchain as usual and it ...
0
votes
0
answers
8
views
How to use Matrix for spiecified range in buffer. DirectX
I created some simple 3D engine. I can draw object from verticies/indiecies into a projection. But now I want to add multiple object. If there will be multiple objects in vertexbuffer. Is it possible ...
0
votes
2
answers
33
views
Is depth-sorting redundant if using depth-prepass?
To avoid overdraw (shading the same pixel twice) it's beneficial to draw objects front to back. When you draw an object in the front the depth values are written to the depth buffer, then when you ...
1
vote
1
answer
48
views
DirectX:- How to copy a pointer image data to the existing D2D1Bitmap?
I've 4 image byte array with the same resolution 640*480. I'm trying to copy the byte array data from memory if the D2D1Bitmap is already available. After copying, d2dContext.DrawBitmap(bitmap) method ...
0
votes
0
answers
22
views
Can I use a Deferred Context for Instancing?
Before starting, I'm sorry for my bad English.
I read here like below.
Things like map/discard and the like can cause a lot of memory to be consumed; for example, iirc if you 'map' on a deferred ...
0
votes
0
answers
17
views
How to use 'D3d Shared Texture' method for screen shots?
I am trying to create a code that takes series of screenshot of a game, use Open-CV to edit it, and display it in a window, all in real-time. I am using windows operating system. For taking ...
0
votes
0
answers
49
views
c# Lib/code for creating directional/motion blur on an image [closed]
Im writing a scientific app, which is going to simulate the way a person with defect of vision see things, using C#, .Net and WinForms.
For creating this effect, i need a way to apply directional blur ...
0
votes
0
answers
31
views
DirectX 11 glGetUniformLocation / gluniform
hello i I am trying to make my 3d object to move. I added custom (float3 offset) to .hlsl file and sum it in output.pos.
Now I have to access pointer to this data (float3 offset) and add a specified ...
0
votes
0
answers
20
views
How to move object DirectX11
I am trying to make my 3d object to move. Using default vs2022 template I managed to import model from .ply file and load to pixelshader / vertexshader. Object is displaying on screen, but I have no ...
-2
votes
0
answers
21
views
Is libsh faster directx?
Been reading "Metaprogramming GPUs with Sh" & i think Windows PowerShell is at a disadvantage. Vectors & 3D coordinates are NOT supported by PowerShell. In the past PowerShell only ...
1
vote
0
answers
44
views
d3d Convert 1 descriptor table (2 cbvs) to 2 descriptor table (each one cbv) get screen flicker
I am learning d3d develpoment recently.
For the triangle example, I add code about model, view matrix setting.
Here I set model, view seperate.
There are 3 methods to do this.
root constants
root ...
0
votes
0
answers
14
views
SV_DEPTH and UAV Combination in Pixel Shader
I want to update a UAV in my pixel shader, which outputs to SV_DEPTH with the depth buffer set to standard depth buffer settings.
Question is - does the depth buffer only affect SV_TARGET outputs, or ...
0
votes
0
answers
33
views
UWP D3D12 Compute shader super slow on XBOX ONE S
We have developed an UWP D3D12 Compute app, which heavily relies on GPU memory bandwidth.
The kernel can run at 600 time per sec on a laptop GPU RTX3060 and 450 time per sec on an AMD laptop GPU RX ...
2
votes
1
answer
40
views
What is the smallest type that can be used for a render texture in a compute shader
I'm using unity's compute shader to write into a render texture that will be used later. The values I want to enter into my render texture are 0 and 1, therefore to avoid using a lot of useless memory,...
4
votes
0
answers
152
views
Tessellation shaders not working with UWP DirectX 11 on Xbox Series X|S
I ported a DirectX 11 application to UWP to deploy it on Xbox Series X|S and hardware tessellation shaders are not working when running the app on Xbox (tested on retail Xbox Series X and Series S in ...
3
votes
0
answers
100
views
Enforce use of independent flip mode with DXGI FLIP SwapChain
I currently face a problem with DXGI Swapchains (DirectX 11). My C++ application shows (live) video and my goal is to minimize latency. I have no user input to process.
In order to decrease latency I ...
-1
votes
0
answers
47
views
How to pass IntPtr (holding an image data in C#) to C++ and use this IntPtr to create an IDirect3D11Resource in C++?
I've an IntPtr of an image in C#. How can I send and use this Intptr and create an ID3D11Resource equivalent in c++?
What I'm trying to achieve?
I'm getting frame as Intptr and trying to render the ...
0
votes
1
answer
36
views
C++ DirectX VS2022 Template. Problem with shaders
I am trying to add shaders to basic template from vs2022. But there is a error when I am trying to compile.
default function looks like this:
BasicAppasdMain::BasicAppasdMain(const std::shared_ptr<...
0
votes
0
answers
17
views
Gaussian blur based on depth that preserves energy
I want to blur my image with a gaussian kernel to help with anti-aliasing (I have MSAA and FXAA, but upping the sample rate too high is way too costly on the frame rate since I am rendering about 20-...
1
vote
0
answers
39
views
Is every buffer in GPU memory always a minimal alignment of 64 KB in DirectX12 for all different allocation methods?
So I am trying to save some bytes in my VRAM usage and one thing I have seen is that every PlacedResource for a buffer (vertex or index or any other kind of resource buffer) must be 64 KB aligned (...
1
vote
0
answers
46
views
What is a quick way to scale down an image using SharpDX hardware acceleration in C#?
I'm trying to scale down large images (~ 23k x 1k) to be displayed in winforms. The current way I'm scaling the images is taking too long, which is why I want to use the GPU through SharpDX (C#) to ...
0
votes
0
answers
38
views
Replace color by area and by color with Directdraw
I need to implement a sort of "select box" on this vertical menu:
In short I like to add the possibility to navigate the vertical menu via arrow keys.
I have already hook the game, but this ...
0
votes
1
answer
40
views
C# Matrix4x4 equivalent of DirectX::XMMatrixPerspectiveLH
I was trying to port some c++ code to C#, everything works except the perspective.
In c++ the code looks like this, which worked without distortion.
DirectX::XMMatrixTranspose(
DirectX:...
2
votes
1
answer
41
views
D3D12 CreateHeap alignment, Does MSDN use 1024 or 1000 for its definition of KB
I am trying to use CreateHeap and PlacedResources in DirectX12. However for CreateHeap it requires a D3D12_HEAP_DESC where it says "applications should pass SizeInBytes (a field of the ...
2
votes
2
answers
57
views
Binding OpenCL buffer to DirectX buffer
I'm trying to find a way to bind an OpenCL buffer into DirectX buffer.
I did manage to find the inverse way of doing so using eh OpenGL Api function: clCreateFromGLBuffer, but failed on finding the ...
2
votes
1
answer
30
views
c# SharpDX ScaleEffect Interpolation question
i've been using this wonderful library for low impact screen recording software however im at a point where i need to use a DirectX Scale Effect to scale the image down with anisotropic filtering.
I ...
1
vote
0
answers
30
views
How to hook d3d9 and call my detour function?
I'm trying to hook d3d9 EndScene in a game: Tibia otclient.
What I want to do is translate ingame XYZ coordinates to screen XY coordinates.
The typical WorldToScreen function.
Here I share the code I'...
-1
votes
1
answer
53
views
Getting library dependencies for DirectX sample applications
I am reading a book on directx and wish to run the books sample applications. The instructions to do this are found here: https://bitbucket.org/pvarcholik/real-time-3d-rendering-with-directx-and-hlsl/...
0
votes
0
answers
42
views
How do I implement pass-by-reference with derivations of abstract classes?
The wording of this question might be a little strange. Let's get into it.
I have been developing my own DirectX11 video game engine and have recently come across an issue.
Here's the Bindable class, ...
0
votes
0
answers
28
views
Unhandled exception thrown: read access violation. _Scary was 0x30
i got an issue with specific error Unhandled exception thrown: read access violation.
_Scary was 0x30.
i m trying to load a terrain with a model loaded from assimp and i keep getting this exception
...
0
votes
1
answer
56
views
Error while trying to get sample directx applications to work
I am reading a book on directx 11 and I have undertaken advised steps in order to be able to run the sample applications. Despite all of these steps, I am left with the following error:
Severity ...
-3
votes
1
answer
75
views
why does memcpy copy only the first element of std::vector?
I'm trying to copy vector of DirectX::XMMATRIX elements into a Direct3D vertex shader constant buffer, but it only copies the first element (which is 4x4 float matrix, which is 64 bytes), resulting in ...
2
votes
0
answers
63
views
Adjust value set in IDXGISwapChain2::SetMaximumFrameLatency
I use the combination of DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT, GetFrameLatencyWaitableObject() and SetMaximumFrameLatency(UINT MaxLatency) to control the input lag vs. smoothness of my ...
0
votes
1
answer
93
views
Direct3D 11 and 2D: multiplication matrix-vector in HLSL does not give the correct result
I am still trying to improve my test program about Direct3D 11 in 2D, without any additional library (see direct3d 11 and 2D: pass coordinates of a vertex as int and not float).
Now, what I want to do ...
0
votes
1
answer
58
views
Can I ExecuteBundle without SetPipelineState at bundle?
I created a some bundle command lists:
IASetVertexBuffers(0, 1, &vtxBuff.m_view);
IASetIndexBuffer(&idxBuff.m_view);
DrawIndexedInstanced(idxBuff.m_nCount, 1, 0, 0, 0);
and not called ...
0
votes
1
answer
27
views
Upgrading an existing D3D9 SH3 project to SH4?
I have an old DirectX 3D 9 Visual Stuido project that I have recently been working on.
I have been diving into the world of rendering & HLSL shaders, however it is becoming quite apparent to me ...
1
vote
1
answer
22
views
Adding Light Falloff for multiple Point Lights
I'm currently trying to add multiple point lights to my game. What I have done appears to be mostly working, except for a small problem of blending light falloff. Here's two images to show you what's ...
0
votes
0
answers
32
views
Program hangs/freezes when DirectInput GetDevices() is called C#
Trying to get Joystick input with DirectX DirectInput but the program seems to hang/freeze
without any errors on Manager.GetDevices().
Here is the simple code:
// C#
using Microsoft.DirectX....
0
votes
2
answers
55
views
Fading a 3D object into the background, using D3D9, SH3 & HLSL
I have a simple program that renders a couple of 3D objects, using DirectX 3D 9 and HLSL. I'm just starting off with HLSL, I have no experience with 3D rendering.
I am able to change the texture & ...
0
votes
0
answers
52
views
How can I synchronize two threads, one for functions and one for directx, and run ImGui functions in one of them?
I am trying to extend the functionality of a program, adding an analytics menu made with ImGUI.
The program has two threads: the main thread where all the program logic is executed, and the drawing ...
0
votes
1
answer
82
views
dx12) It takes too long to compile Shader
When profiling, it took about 14 seconds only for shader compile. (Although it took only 7 seconds to load all that obj files.)
how can I optimize this? do I have any option to pre-compile hlsl ...
-1
votes
2
answers
31
views
what is multisample per pixel in directx11 DXGI_SAMPLE_DECS
I was reading documentation about DXGI_SWAP_CHAIN_DESC and i came across with DXGI_SAMPLE_DESC
Count
Type: UINT
The number of multisamples per pixel.
now what exactly is multisamples per pixel?
0
votes
0
answers
30
views
Creating a sub-texture, from an existing texture, using D3D9
I'm working on an older project that uses D3D9 for rendering 3D environments.
I have a texture file loaded into memory, that I'm applying onto a simple 3D model for rendering. I'm loading this file ...
0
votes
1
answer
65
views
IDXGIFactory2::CreateSwapChainForHwnd fails
https://1drv.ms/u/s!AkVRV9eGJ20rgTu13uTcNkhp0eZb?e=lwMe70
That links takes you to my OneDrive where you can download my Visual Studio 2022 solution and project (it is a .7z file of 17.7KB), it only ...
0
votes
0
answers
73
views
Copy raw video frame buffer to IDirect3DSurface
Normally, MediaPlayer has supported function CopyFrameToVideoSurface(IDirect3DSurface destination) to copy video frame to Direct3DSurface.
But now I receive a video frame as byte[] pbuffer with width ...
0
votes
1
answer
79
views
identifier D3DReadFileToBlob is undefined?
#include<D3Dcompiler.h>
void Init()
{
D3DReadFileToBlob(L"", nullptr);
}
it gives D3DReadFileToBlob is undefined error, i don't think it is a linking error and i read this which ...
1
vote
0
answers
65
views
Error submitting the frame for encoding when submitting NV12 texture
I'm trying to encode D3D11 NV12 Texture on QSV encoder but getting [h264_qsv @ 00000244ce6f50c0] Error submitting the frame for encoding.
Main:
int width = 1920;
int height = 1080;
FILE* outfile;
...
2
votes
1
answer
85
views
DirectX 11 render BGRA32 Frame
First time trying to render something and I have big troubles... I am using DirectN library and SwapChainSurface class from KlearTouch.MediaPlayer. I am trying to render BGRA32 frame using D3D11Device....
0
votes
1
answer
26
views
how to do cube mapping of a static environment onto a complex model by directx11 and HLSL?
I am very new to Shaders and programming in direct 11(c++) and HLSL for shaders. However, I have been given a task to:
Implement cube mapping of a static environment onto a complex model (not a cube). ...