DirectX 11 is the primary graphics API for Microsoft platforms including Windows, Xbox One, and Windows phone.
1
vote
1answer
31 views
View Matrix to Texture Matrix
I'm converting view coordinates to texture coordinates for both my shadow maps and Screen space reflections.
I keep seeing this conversion in examples:
var T = new Matrix
{
...
1
vote
0answers
16 views
Is it normal in skeletal animation to NOT consider the translation component in bone transform matrices?
I'm using assimp to load a model, and DirectX11 and DirectX ToolKit to render it.
In the document of DirectXTK's IEffectSkinning, it says:
As an optimization, SkinnedEffect and DGSLEffect assume ...
0
votes
1answer
30 views
DirectXTK Model : How to draw with custom vertex & pixel shader?
Here is the code I use to render a .cmo (from .fbx) mesh :
void Render()
{
assert(g_d3dDevice);
assert(g_d3dDeviceContext);
Clear(Colors::LimeGreen, 1.0f, 0);
...
0
votes
0answers
23 views
Screen Space Reflections
Screen space reflections seems very straight forward but for some reason I'm struggling with this.
My GBuffer is in View space and depth is z/w.
float3 ViewSpaceToScreenSpace(float3 viewSpace)
{
...
2
votes
0answers
38 views
When does the memory transfer from CPU to GPU happen when creating a buffer?
I just finished my first DirectX 11 program. But I have several questions on memory transfer between CPU and GPU.
In my program, I create a vertex buffer first:
bool InitializeGeometry() {
...
2
votes
2answers
40 views
How can I test DXGI_ERROR_DEVICE_REMOVED error handling?
My application uses DX11 and it periodically gets a DXGI_ERROR_DEVICE_REMOVED error on startup. It is an infrequent thing (I can go days or weeks without seeing it) but according to the documentation ...
0
votes
1answer
69 views
The Pixel Shader unit expects a Sampler configured for default filtering to be set at Slot 0 […]
I don't understand this error. The full output being :
The Pixel Shader unit expects a Sampler configured for default
filtering to be set at Slot 0, but the sampler bound at this slot is
...
0
votes
1answer
39 views
Problem with ID3D11DeviceContext::CopyResource method - How to properly read a texture CPU-side?
I am trying to make a full copy from a render target texture to a staging one but it seems my data length ends up being only 4 in length instead of 921600 (1280 * 720).
Here is my textures ...
0
votes
1answer
47 views
Why isn't my cbuffer updating?
I am really frustrated because my cbufer isn't updating.
This is my VS:
cbuffer MatrixBuffer: register(b0)
{
float4x4 worldViewProj;
};
struct VertexIn
{
float4 Pos : POSITION;
float4 Color: COLOR;
...
1
vote
0answers
21 views
Is it possible to have a SoA Vertex Buffer in DirectX 11?
Hi!
I'm wondering if it is possible to structure a Vertex Buffer in a SoA approach like this
{ x1, x2, x3 . . . xn, y1, y2, y3 . . . yn, z1, z2, z3 . . . zn }
instead of the traditional AoS ...
7
votes
1answer
375 views
Strange SSAO effect (wrong position/normal textures in view space?)
I try to create an SSAO effect in my game engine (DirectX 11, C++), based mainly on gamedev.net tutorial by José María Méndez. Unfortunately, it doesn't cover texture-creating problem (normals, ...
0
votes
1answer
95 views
How to pass a big (60+) amount of variables to an HLSL pixel shader?
I am in trouble at trying to pass a big amount of variables needed for my pixel shader computations.
After trying and failing to link my struct to a cbuffer (data alignement mismatch) I tried passing ...
2
votes
2answers
282 views
C++ struct doesn't align correctly to a pixel shader cbuffer
To expand from my previous question, I must add I can't correctly map my C++ structs to a corresponding cbuffer inside the pixel shader. When outputing random colors defined in the struct C++ side, it ...
0
votes
1answer
28 views
Getting mouse movement value with DirectX Tool Kit
today I want to ask a question about how to get mouse movement value with DirectX Tool Kit.
While I can certainly use Mouse::SetMode(MODE_RELATIVE), to do this, I want to be able to get the mouse ...
4
votes
2answers
447 views
Mapping a C++ struct to an HLSL cbuffer
Out of curiosity (and peace of the mind...) I wondered how DirectX decides which attribute from a struct corresponds to the right variable inside an HLSL cbuffer-register(x) (apart from the order/type ...
1
vote
1answer
39 views
How to correctly pass multiple light structures to shader stage?
I'm having some problems when passing multiple light structures to a shader stage. I'm using an array of point lights that is updated each frame.
This is my code for creating the buffer
...
1
vote
0answers
53 views
How do you fix wobbling shadow edges?
I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
2
votes
0answers
41 views
How do I sample a cubic shadow map in DirectX 11?
I've implemented a cubic shadow map for dealing with omni-directional light sources in my scene. By defualt it produces hard shadows
Obviously a shadow map with higher resolution (currently using ...
1
vote
2answers
53 views
DDS files with DirectX Tk, Some work, some don't
I am learning DirectX with the DirectX Tool Kit library and everything seems to be going smoothly but I have run in to a tiny little hiccup.
I am currently trying to load DDS textures from file ...
0
votes
1answer
27 views
Viewport and debug session
I define and set viewport using this piece of code:
D3D11_VIEWPORT viewport;
viewport.Width = (FLOAT)pBspWindow->GetWidth();
viewport.Height = (FLOAT)pBspWindow->GetHeight();
viewport.TopLeftX ...
0
votes
0answers
91 views
Speed up the DirectX game - how else can I boost the fps with typical triangle drawing?
I am writing my own c++/DirectX engine. I've made the basic framework and here comes the time for optimizations.
I don't want to focus on optimizing the resources themselves right now (meshes, ...
0
votes
0answers
48 views
Sphere texture mapping using Directx 11
I have a spherical panoramic image which I would like onto a sphere and centre it around the camera so I can look around the image, how should I best go about this?
I will be using DirectX11.
...
1
vote
1answer
74 views
Map a normal image to a cubemap
How can I map a normal non T form image to a cube map?
and if there is no manner with which to do this, is it possible to, via DX11, split the image, as the image may be generated on the fly?
...
0
votes
0answers
31 views
Update part of dynamic Vertex Buffer. SharpDX
I'm creating application to draw simple 2D charts in a fast way.
Updating my VertexBuffer is implemented as below:
Device.ImmediateContext.MapSubresource(_signalVertexBuffer, ...
0
votes
0answers
25 views
Directx11 Shadow Mapping Not Rendering
I'm reading luna directx11 book,i want to implement shadow mapping using it but i'v got a problem with it here is the image from my scene(at bottom right you can see shadow map,why is it in red color? ...
1
vote
1answer
58 views
DX11 Mixing 2D and 3D
So I am somewhat new to working with DirectX rendering, and I have done some 2d and 3d work. I am planning on working on a new application where I will be rendering a bunch of 3d scenery, and then ...
0
votes
1answer
55 views
Transformation problems with hardware instancing in DirectX 11
I'm getting some wonky geometry in my application when trying to use instancing. I'm not sure if I'm doing the mapping of my per instance data wrong. This is how my mapping looks like:
XMMATRIX scale ...
0
votes
2answers
30 views
How to handle mesh update in its vertex buffer
suppose i have a mesh, it can undergo any kind of changes - bend, stretch, even been torn. How should i update vertex buffer in DirectX for this mesh. For now i recreate it every time, and i don't see ...
0
votes
0answers
126 views
Using a Unity RenderTexture in a native plugin (4.6.1)
I am trying to create a RenderTexture in unity, but I want to update it using a plugin. I am doing this on Windows 7 Pro 64bit and I wrote the plugin using VS2010 professional.
Here is the code in ...
0
votes
1answer
25 views
DirectX 11 throws out my pixel shader when I multiply verts by MVP
Been following some tutorials online for DirectX 11. I was able to successfully get a triangle to render in screen space. But the moment I add a MVP matrix, my triangle disappears!
Looking at it in ...
0
votes
1answer
57 views
Will DirectCompute run this HLSL code
I found a sample about how to run a HLSL code with DirectCompute.
https://code.msdn.microsoft.com/windowsdesktop/DirectCompute-Basic-Win32-7d5a7408
This is the HLSL script I want to run
...
0
votes
0answers
55 views
Animations in games
I wonder how skeletal animations in games work.
I am Writing my own Graphics Engine for "fun", and I have come across several problems with animations.
Here is how I do it right now:
1: Load the ...
0
votes
0answers
64 views
DirectX 11, Render vertices as points in Unity
I'm attempting to asses what is the most efficient manner to render vertexes as points in Unity with DirectX 11.
I'm attempting to create a point-cloud instancing shader, that creates vertices in ...
0
votes
0answers
48 views
Buffer resource as shader resource view
I am trying to build a shader that change the output color according to something that happen in my c++ code
In my code I create a buffer with four element(each element containe four float - RGBA)
...
0
votes
0answers
23 views
Rotating a directional light about y axis (DirectX11)
I have 2 fixed objects in a scene and a directional light which I am rotating on each update but I am not sure if I am doing it correctly after looking at the results. Here is the code:
rot += ...
0
votes
1answer
139 views
How to access raw texture data in DirectX 11?
I want to get access to a texture's pixel color data on the CPU. When trying to map the texture, I get E_INVALIDARG in return from ID3D11DeviceContext::Map.
ID3D11ShaderResourceView* resourceView; ...
0
votes
1answer
78 views
VS Graphics Diagnostic Tools and IDXGIFactory::EnumAdapters()
I have the following constructor for my main application class where i enumerate all adapters, that looks something like this:
CApplication::CApplication()
{
IDXGIFactory* factory;
...
0
votes
2answers
144 views
Native vs Desktop Resolution
I have code set up that finds the native resolution of a monitor and uses that to determine the resolution for (DirectX exclusive) fullscreen mode, using SetupAPI:
HRESULT ...
0
votes
2answers
100 views
Disable/Remove Warning about a not bound Render Target View
So to render into my shadow map depthstencil buffer i only bind a DepthStencilView to the Output Merger. Like this
m_pContext->OMSetRenderTargets(0,0, m_pShadowMapDV);
...
0
votes
0answers
22 views
In HLSL pixel shader, why am I getting [-256.0, 256.0] values in SV_POSITION input?
My question is basically in my DirectX11 pixel shader, why am I getting a range of values from -256.0 to 256.0 in the SV_POSITION input instead of the supposed values from 0.0 to ViewportWidth and 0.0 ...
0
votes
2answers
133 views
Directional light and finding relevant shadow casters
Right now when culling the models to render for the directional light shadow map pass I just do a view frustrum culling using the main camera. At some angles, the objects will be outside the view but ...
0
votes
1answer
58 views
Sample() returns (0, 0, 0) for normal map 90% of frames
I'm having some trouble reading the values from my Normal map in my lighting fragment shader.
The relevant part of the shader code is as follows:
Texture2D NormalGB : register(t0);
Texture2D ...
1
vote
1answer
225 views
DirectX11 Equivalent of OpenGL code
I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11.
glEnable(GL_BLEND);
...
-1
votes
1answer
134 views
How do i load, render and trasnform 2D images using Direct3D 11 API? [closed]
In my small game project using DirectX 11 API, I created a Direct3D device, and can draw 3D meshes, using web tutorials and a book. But I cannot figure out how to load, transform (rotate, scale, ...
1
vote
2answers
87 views
Directx displaying selectable text
I am new to direct x and following this tutorial : brayzarsoft (part 14) I was able to display text. However, using this method the text is rendered to a texture.
When you look at games that have ...
0
votes
1answer
64 views
How do i draw depth complexity(overdraw) in directx 11?
I want to read the stencil value in the shader so I can set colors for different depths.
What I understand. Make a loop after the scene is rendered but before is is presented.
so a loop with the ...
2
votes
1answer
140 views
How do I draw a full screen quad in DirectX 11?
How do I draw a full screen quad that shows red on the screen?
0
votes
1answer
128 views
How to load in meshes efficiently into DirectX11
I wanted to know if there was a standard and efficient method to load meshes from a file into DirectX11. Currently, I'm loading .obj's by parsing them in and storing their information into a vertex ...
1
vote
0answers
137 views
Directx 11 full screen
I build simple directx 11 application in c++ that draw square to screen.
Also check in the end of the program when I close the last peace of directx the number of free reference.
This work great in ...
2
votes
1answer
106 views
Since D3DX utility library is deprecated, what can I do about this legacy code?
D3DX Structures utility library is deprecated for Windows 8 and its not supported for Windows Store apps. So my question is, Does anyone know what to replace this legacy code with..
...