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)

3
votes
1answer
4k views

What do these STATE_CREATION warnings mean in the DX11 debug output?

So I've been fighting my way through learning the DirectX 11 API with what little documentation there is out there and noticed some new D3D11 warnings in my debug output. (Atleast I think they are ...
3
votes
3answers
668 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 ...
3
votes
1answer
312 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 ...
3
votes
3answers
915 views

What are registers in HLSL for?

I've read this document about HLSL registers, but it's more of a syntax description and not a purpose explanation. What are registers in HLSL, actually? How and when do I use them? What happens if I ...
3
votes
2answers
5k views

Mapping a Vertex Buffer in DirectX11

I have a VertexBuffer that I am remapping on a per frame base for a bunch of quads that are constantly updated, sharing the same material\index buffer but have different width/heights. However, ...
3
votes
1answer
468 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 ...
3
votes
1answer
232 views

What happens to a D3D11 application when Windows hibernates?

In D3D9 there was the concept of a "device reset". When a device reset occurred textures created with D3DPOOL_DEFAULT had to be recreated, but textures created with D3DPOOL_MANAGED didn't, because, ...
3
votes
2answers
313 views

Having the same texture data in different ID3D11Texture2D

Sorry if this has been answered elsewhere - I'm rather new to DX. My question concerns conservation of resources - specifically textures in VRAM. I assume that upon returning from a call to ...
3
votes
3answers
714 views

How can I view an R32G32B32 texture?

I have a texture with R32G32B32 floats. I create this texture in-program on D3D11, using DXGI_FORMAT_R32G32B32_FLOAT. Now I need to see the texture data for debug purposes, but it will not save to ...
3
votes
1answer
2k views

What is the AlphaToCoverage blend state useful for?

Alright, just finished most of my early UI stuff and I wanted the windows to have some transparency. So I expanded my application to initialize and bind blend states so that my UI shader could ...
3
votes
2answers
6k views

Can't update DirectX11 shader constant buffer [closed]

Alright, I'm currently making the transition from DirectX 10 to DirectX 11 (with very little help from the MSDN documention) and recently ran into a snag with updating a shader's constant buffer. My ...
3
votes
2answers
121 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? ...
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 ...
3
votes
1answer
251 views

Using a switch command in one shader vs multiple shaders

If you have multiple shaders, could you instead of switching between shaders all the time just have one shader with a switch and each case will send you along to another shader function which you ...
3
votes
1answer
261 views

Per Instance Textures, and Vertex And Pixel Shaders?

How do you implement per instance textures, vertex shaders, and pixel shaders? Given: 1. Two different model templates in Vertex Buffer, Square & Triangle 2. Instance Buffer with [n] instances of ...
3
votes
1answer
166 views

Depth Stencil buffer mandatory?

If I disable depth and stencil buffering, do I have to create and set the depth stencil buffer?
3
votes
1answer
307 views

Mapping dynamic buffers in Direct3D11 in Windows Store apps

I'm trying to make instanced geometry in Direct3D11, and the ID3D11DeviceContext1->Map() call is failing with the very helpful error of "Invalid Parameter" when I'm attempting to update the ...
3
votes
1answer
3k views

SV_POSITION in pixel shader

What are the uses for SV_POSITION in the pixel shader? Previously this was the POSITION semantic and it wasn't readable in the pixel shader, but now that it is, what can it be used for? In an SM2 ...
3
votes
1answer
2k views

Why can't I write to my render targets?

Alright, been working on setting up my first deferred rendering attempt using a light prepass technique in Direct3D 11. Anywho, I've been having problems understanding and using render targets. Never ...
3
votes
1answer
2k views

Does the latest DirectX SDK support both Direct3D 9.0c and 11?

1) What is the latest version of DirectX SDK? 2) For my purposes I need DirectX 9.0c SDK and DirectX 11 SDK. Do I need to install these libraries separately or last DirectX SDK package contains both ...
3
votes
1answer
70 views

Why does my PixelShader ignore color but respond to alpha changes?

I started teaching myself some DirectX a short time ago and found something I'm confused about. For some reason, I can only get the color of the model I'm drawing to vary between black and white, ...
3
votes
1answer
233 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 ...
3
votes
1answer
361 views

Direct3D reducing DrawIndexed CPU usage

I am trying to optimise some of my rendering to get is useable on lower end machines (in my case a 2GHz i5 laptop with a GT 520M). A quick investigation showed that the GPU isnt actually getting to ...
3
votes
1answer
301 views

DirectX Unproject troubles

I have an orthographic projection and I try to unproject a point from screen space. Following are the view and projection matrices: var w2 = ScreenWidthInPixels/2; var h2 = ScreenHeightInPixels/2; ...
3
votes
2answers
137 views

How can I simulate multiple depth channels?

Here's what I'd like to achieve: Rendering a first pass of objects in my scene, using standard depth comparison Rendering another pass of objects in the same scene, but with the following rules: A ...
3
votes
1answer
2k views

D3D11 Multiple Render Targets

I wanted to try rendering to multiple render targets as a first step to deferred shading, but I'm getting somewhat peculiar behavior where the contents of all render targets are the same as the first ...
3
votes
1answer
1k views

DX11 StreamOut to Vertex Buffer from GeometryShader, can't clear Buffer?

I'm trying to use a geometry shader to continuously modify the positions of vertices, and save the modfied verts in a buffer. I have two vertex buffers, one is bound to the IA stage / the vertex ...
3
votes
2answers
1k views

Understanding DeviceContext and Shaders in Direct3D/SlimDX

I've been working through this tutorial about drawing triangles with SlimDX, and while it works, I've been trying to structure my program differently than in the tutorial. The tutorial just has ...
3
votes
1answer
221 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 ...
3
votes
1answer
1k views

Proper use of Dynamic Vertex Buffers for rapid update

I am creating a C#/SharpDx/DirectX10 application to plot line charts in a fast way. I have a prototype which uses Dynamic Vertex Buffers and fills a fixed-size buffer, say 1M vertices, with new data ...
3
votes
1answer
445 views

Constant Buffer size mismatch on PS, fine on VS and GS

I have the following C/C++ struct: struct ShadowMapCB { Math::Matrix4 cropMatrix[4]; Math::Matrix4 textureMatrix[4]; float splitPlane[4]; }; and my HLSL constant buffer: ...
3
votes
1answer
2k views

What are the valid DepthBuffer Texture formats in DirectX 11? And which are also valid for a staging resource?

I am trying to read the contents of the depth buffer into main memory so that my CPU side code can do Some Stuff™ with it. I am attempting to do this by creating a staging resource which can be read ...
3
votes
1answer
174 views

Mesh objects and a draw function

I'm currently working with a mesh class so I can easily create mesh objects. Now I want a draw function in my mesh class so when ever i want draw it to the screen I can just call it without any fuss. ...
3
votes
1answer
371 views

DXGI and 2+ full screen displays on Windows 7

I am developing a program that needs two full screen Direct3D dispalys. According to the documentation I should create the swap chains in windowed mode and then switch to full screen mode. While this ...
3
votes
3answers
2k views

How to Bind Multiple Shapes/Models to One Vertex Buffer?

If I have two Vertex Arrays, one for Square, and one for Triangle; what is the best way to bind them to the VertexBuffer? What are the patterns used to write multiple vertices to the VertexBuffer? ...
3
votes
1answer
2k views

DirectX11, how to properly update a staging buffer with a structured buffer's count using CopyStructureCount

Alright, I'm not quite sure what is going on with my code at the moment. I'm currently getting around to defining behavior for my particle system, and to better do this I need to know how many ...
3
votes
3answers
140 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 ...
3
votes
1answer
147 views

Implement Displacement Mapping: Gaps along seams

I am implementing Displacement mapping using DirectX 11 with its new tessellation stages. Diffuse map and displacement map are generated by xNormal. The result after I applied displacement mapping is ...
2
votes
2answers
382 views

handling errors in a framework

I'm writing a D3D11 framework and I'm trying to clean it up a little, and I'm unsure how to handle errors and return codes in my classes/code. What is the "best" and cleanest way to implement error ...
2
votes
1answer
286 views

Why does my game not update unless I'm moving the mouse?

I'm pretty confused by what's happening. Now that I've finally put something moving on my screen, I notice it doesn't update unless I move the mouse, or press a key, or trigger other events. Using ...
2
votes
2answers
467 views

Should I start to use DX11 [duplicate]

Possible Duplicate: learning Direct3D 9, 10 or 11 ? I have just started game dev and was wondering should I use DX11 or version 10? I know AMD/nVidia now have DX11 cards but there are not ...
2
votes
1answer
1k views

Direct3D11 feature level

If I set the directx feature level to D3D_FEATURE_LEVEL_9_3 but I have a graphics card which supports D3D_FEATURE_LEVEL_11_0 does that prevent directx11 features from working even though my graphics ...
2
votes
1answer
165 views

How should I prepare for migration from D3D9 to D3D10 or D3D11?

I'm considering a Direct3D9 texture streaming solution, but my company will eventually be going to D3D11 in the future. I wanted to make my solution as forward compatible as possible, so I was hoping ...
2
votes
2answers
238 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 ...
2
votes
1answer
1k views

Loading textures with SharpDX in Metro

I have converted my C# game from OpenTK (OpenGL) to SharpDX (DirectX) and have it up and running from Visual Studio 2010. I also have it up and running from Visual Studio 11 in Metro, in the Windows 8 ...
2
votes
2answers
691 views

How do I keep a triangle strip between geometry shader invocations?

I'm using a small geometry shader to build a "ribbon" from a set of points. For each point, I create 4 vertices that represent a section of the ribbon: [maxvertexcount(4)] void GS( point GS_Input ...
2
votes
1answer
46 views

D3D11 Can only Pixel Shader and Compute Shader stages write to buffers?

I am reading Practical Rendering and Computation with Direct3D 11. In the book the D3D11 pipeline is often described with this image: In the Chapter about resources, Paragraph about buffers, I ...
2
votes
1answer
83 views

Do the predefined HLSL semantics carry any meaning?

I'd say there are 3 kinds of HLSL semantics: SV_* group - these are "system value" semantics which DO carry special meanings (e.g. assign special input/output data to/from shader stages) predefined ...
2
votes
1answer
49 views

What does the hull shader attribute “patchsize” do?

What does the hull shader attribute [patchsize(12)] do? MSDN fails to mention it. Do I have to use it? Should I use it?
2
votes
1answer
244 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 ...