DirectX 11 is the latest release of Microsoft's collection of APIs which contain features to aid in game development.

learn more… | top users | synonyms (2)

0
votes
0answers
137 views

Directx 11 not drawing scene despite all math being correct

I have a graphics engine that i writing in Directx11 and I changed the way objects are drawn, and the way assets for the game are loaded. Everything in my draw call is set correct and I thought that ...
2
votes
1answer
356 views

Directx 11: emulating palette swapping with shader 5.0 and c++

i'm trying to swapping the colors using a texture as index and a second one as palette. Here is the full listing of the code: #include <windows.h> #include <windowsx.h> #include ...
1
vote
1answer
264 views

Why does switching to fullscreen produce this graphical glitch?

I followed this tutorial and things were looking good. However, when switching to Fullscreen from 800x600 using alt-enter, I noticed an error in debug output: DXGI WARNING: IDXGISwapChain::Present: ...
0
votes
1answer
136 views

Why divide by w makes the pixel shader look better?

I'm writing a shader in HLSL (Direct3D11 with SharpDX) and after some computations I was trying to make a test and print the depth z of a specific point in my pixel shader, like this: myZ = ...
1
vote
1answer
702 views

Rendering a image with some transparency has removed all black pixels and makes full texture transparent

I am writing a program where with Directx11 I am rendering a texture to a flat rectangle something along the line a of 2D engine. Now parts of this image need to be transparent, to this effect I ...
0
votes
1answer
713 views

Directx 11 , problem positioning a 2D quad , center starting at bottom left and not top left

I'm following some tutorials of directx 11,and i was able to draw a quad, but my problem began when i was applying transforms , for some reason, my quad at position 0,0, start at bottom left of my ...
0
votes
0answers
158 views

When should I set a texture as a shader resource in order to read it?

I'm writing a Direct3D 11 HLSL shader with SharpDX. What I want to do is write the depth to a texture in one pass and read it in the next one. After declaring the texture, do I have to set the depth ...
1
vote
1answer
144 views

How do I draw an isoline in a shader with a triangle topology?

I have some problems with my displacment. So I would like to have a simple little isoline starting in every triangles face center of the mash pointing in the direction of the corresponding faces ...
0
votes
1answer
211 views

Creating a 2D texture array for depth view

Following my question here, I decided to create an 2D texture array for all of my depth screen texture so that I can use them for shadows for all my lights. I'm having an issue setting it up, I'm ...
1
vote
1answer
405 views

How to create and populate a 2D Texture Arrays in DirectX11

I have generated a bunch of ID3D11ShaderResourceView that are a 2D textures that have a depth map screen shot for my lights shadows. I would like to take all of these textures and put them into a ...
3
votes
3answers
152 views

How do I deal with timeout detection and recovery in D3D?

What is exactly measured when checking TDR in Windows? What do I need to do in my D3D11 app to tell TDR that long rendering is okay? I've already split the workload into smaller batches, but how do I ...
0
votes
3answers
96 views

how do I modify Texture2DArray values in shader

I'm using HLSL Shader Model 5.0. I'm using a Texture2D with the vertex positions for a mesh. In the Shader I'm trying to displace patchepositions along the normal of the patches I'd like to actualize ...
1
vote
2answers
388 views

What is the depth that a pixel shader may output? Is it necessary to write Depth?

In DirectX11, what does the depth that a Pixel Shader can output mean? Does a pixel shader need to output a depth so that we "write" the depth? If not, why would we output it? For any doubts, I'm ...
3
votes
1answer
238 views

Multiple pixel shader passes

I currently have a pixel shader that calculates the texture and I have another that calculates the light. I want another shader that does both. What I would ideally like to do is instead of creating a ...
1
vote
0answers
49 views

Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation

I'm trying to implement the approach (http://research.microsoft.com/en-us/um/people/cloop/sga09.pdf). Unfortunately I'm not quite clear regarding the formulas in chapter 3, I am hoping to get some ...
0
votes
1answer
328 views

How to print Depth to a Texture2D and then read it in the next pass on a shader in DirectX11

I'm programming a two-pass effect in DirectX 11 (SharpDX). It's supposed to write the depth to a texture in the first pass and then use that texture to extract data on the second one in the pixel ...
0
votes
1answer
321 views

Difference between texture.Load() and texture.Sample() methods in DirectX?

The question is simply that: What is the difference between texture.Load() and texture.Sample() in DirectX? I've used a Texture2D to store the depth in a pass of a DirectX Shader (with SharpDX), and ...
0
votes
2answers
123 views

Alpha interpolation in a pixel shader

How does the interpolation in a fragment shader work when it comes to the alpha parameter? I'm programming a shader with SharpDX, DirectX11. My idea is to interpolate 2 3d points of a segment, so ...
1
vote
1answer
88 views

How can I find a position between 4 vertices in a fragment shader?

I'm creating a shader with SharpDX (DirectX11 in C#) that takes a segment (2 points) from the output of a Vertex Shader and then passes them to a Geometry Shader, which converts this line into a ...
2
votes
1answer
286 views

DirectX11 Swap Chain RGBA vs BGRA Format

I was wondering if anyone could elaborate any further on something that's been bugging me. In DirectX9 the main supported back buffer formats were D3DFMT_X8R8B8G8 and D3DFMT_A8R8G8B8 (Both being BGRA ...
1
vote
3answers
157 views

What is the minimum of shader I need to use to run basic calculation on GPU?

I read, that the Hull Shader, Domain Shader, Geometry Shader and Pixel Shader can be used optional. So, is the Vertex Shader optional too? If no: What does a basic Vertex Shader look like? Just like a ...
0
votes
1answer
659 views

Direct3D11 and SharpDX - How to pass a model instance's world matrix as an input to a vertex shader

Using Direct3D11, I'm trying to pass a matrix into my vertex shader from the instance buffer that is associated with a given model's vertices and I can't seem to construct my InputLayout without ...
1
vote
2answers
153 views

How do I reverse the playback of an animation (instead of restarting it)?

I have created a sprite sheet of which consists of six frames of a character whose legs move each frame. Now I have written code so that the animation is running successfully from frame one to frame ...
0
votes
0answers
25 views

Why isn't one of the constant buffers being loaded inside the shader?

I however got the model to load under tessellation; only problem is that one of the constant buffers aren't actually updating the shader's tessellation factor inside the hullshader. I created a ...
0
votes
1answer
122 views

An issue with tessellation a model with DirectX11

I took the hardware tessellation tutorial from Rastertek and implemended texturing instead of color. This is great, so I wanted to implemended the same techique to a model inside my game editor and I ...
2
votes
1answer
186 views

First Person Camera strafing at angle

I have a simple camera class working in directx 11 allowing moving forward and rotating left and right. I'm trying to implement strafing into it but having some problems. The strafing works when ...
2
votes
1answer
282 views

Resource management

I've come across a strange thing in DirectX 11: I'm trying to implement large scale volume visualization engine. My approach is like this: if the volume is HUGE (could not fit to GPU memory ...
2
votes
1answer
387 views

Compute Shader Memory Sharing

Ok guys I have had some pretty good success on this site but I feel that this is a pretty complex question. I am trying to do tile based deferred lighting using DirectX 11 and the compute shader. ...
2
votes
0answers
116 views

1:1 mapping of texels to pixels with DX11 and multisampling and linear interpolation

Is it possible to get a 1:1 mapping of texels to pixels on a multisampled target in DX 11 with interpolation? It seems to me that the texture coordinate used in the shader is always one of the ...
3
votes
3answers
774 views

Working With D3D11/OpenGL Shader Reflection

I've been working in my off-time to do some system design for a game engine as a fun and challenging project, and i've hit a bit of a wall. I've made an interface which is a renderer that i try to ...
0
votes
1answer
112 views

Storing few values in an int - small gain

This might be a bit hard-to-answer question, but... I had a DirectX::XMFLOAT3 as a vertex attribute. I have changed it to just an int by placing the 3 floats into int (using only 8 bits per float). In ...
0
votes
2answers
868 views

SharpDx how to detect if Mouse Button is pressed?

I'm wondering how it's possible to detect if a mousebutton is pressed or released. var di = new DirectInput(); _mouse = new Mouse(di); _mouse.Acquire(); _mouseState = _mouse.GetCurrentState() All I ...
1
vote
3answers
512 views

One index buffer with multiple vertex buffers?

I noticed that there's IASetVertexBuffers() to set multiple vertex buffers at once but there's only IASetIndexBuffer() to set one index buffer. So I assume that I can simultaneously only have one ...
3
votes
1answer
341 views

Can I change vertex buffer's size?

Maybe it's a stupid question but I actually don't know - is it possible to change vertex buffer's size after it's been already created (with CreateBuffer())? If so, how do I update its data (with both ...
1
vote
1answer
167 views

D3D11 Deferred Context CommandList Reset

a rather quick question, I am starting on implementing rendering with deferred context into my game engine, and came across a heavy memory leak when recording command lists on my deferred contexts. ...
3
votes
2answers
122 views

Unused constant buffers in shaders

If you define a constant buffer in a shader, for example cbuffer test : register(c2) { float4x4 data; } But never actually use the data in the shader, does that incur any runtime cost at all? ...
0
votes
1answer
51 views

How can I check the shader model capabilities of an adapter?

I'm writing an application that targets Direct3D11 (through SlimDX) and shader model 5. When I'm running it on a system that doesn't have SM5 capable hardware, I will get a NullReferenceException ...
2
votes
2answers
279 views

Is it possible to update constant buffers/textures/variables by name?

When I was learning OpenGL (some old version), the way to update variables in shader was to find their index or whatever by name (string) and then use that index to actually update them. And I've seen ...
1
vote
2answers
1k views

How to use UpdateSubresource and Map/Unmap?

From what I understood (from reading various pages) there are 2 ways to update a buffer: UpdateSubresource() (when buffer is created with DEFAULT usage) Map(), copy the new data, Unmap() (when ...
3
votes
1answer
515 views

Vertex Buffer Sharing between DirectX11 and Directx9

In my d3d9 engine i want to take benifit of compute shader of d3d11. So firstly I created a vertex buffer in d3d11 with D3D11_BIND_UNORDERED_ACCESS and then tried to create the d3d9 vertex buffer ...
1
vote
0answers
135 views

Box Zoom - Fit to rectangle

I want to box select a section of my screen and then zoom in that selection. So I have four corner points (my rectangle which I can drag with the mouse) in pixel coordinates. I have a perspective ...
3
votes
1answer
243 views

Adding false if statement to pixel shader produces a lag

One of lines in pixel shader produces a lag (lower fps). I can't understand why. if (TextureEnabled) color *= texDiffuse.Sample(texDiffuseSam, input.UV); Interesting fact is: TextureEnabled is ...
0
votes
3answers
691 views

XNAMath: Question on types XMFLOAT3/4, XMVECTOR (D3D 11)

I don't want to use XMVECTOR which i currently use in my DirectX 11 C++ game code. Because it is too much for me in memory. I want to use XMFLOAT3 or 4, but the problem is there is no matrix/vector ...
0
votes
2answers
501 views

First person camera: problem

I have created a simple camera class, moved it from my C# (XNA) source to C++ for d3d. Commonly it is okay, but something is wrong with rotation. If i increase its pitch/yaw values, according to ...
2
votes
1answer
357 views

Early Z-test / depth-test in DirectX 11

As a DirectX noob i'm trying to wrap my head around depth buffers and specifically how pixel shaders are called for obscured pixels. From what i understand, the rasterizer calls the pixel shader for ...
0
votes
1answer
643 views

Direct3D11 + Assimp imported model corrupted/failed

I use Assimp library to import vertex and index data from model file. I don't know how to correctly create index buffer from mFaces array of aiMesh. Or something wrong, because i my model is ...
1
vote
1answer
332 views

Which coordinate space is the canonical default for each shader pipeline stage?

I'm working with Direct3D 11 and HLSL. I use four different shaders (vertex, hull, domain and pixel). I always have troubles using the right coordinate space in my shaders. Could somebody identify ...
4
votes
2answers
331 views

Calculate mipmap level in a loop with varying iteration?

How can I calculate the correct mipmap level in a shader? It needs to be used in a loop which runs a variable number of times so the compiler will not allow me to use Sample or the derivative ...
0
votes
1answer
281 views

Game only runs at 60fps in windowed mode with a 120hz monitor?

In fullscreen the game will run at 120fps fine, the correct refresh rate for the monitor, but in windowed mode it only runs at 60fps. If I disable VSync then it runs at thounsands of fps so it's not ...
3
votes
1answer
3k views

C++ FBX Animation Importer Using the FBX SDK

Does anyone have any experience using the FBX SDK to load in animations. I got the meshes loaded in correctly with all of their verts, indices, UV's, and normals. I am just now trying to get the ...