Tagged Questions

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)

1
vote
1answer
286 views

Do textures that are inside a shader resource need to be explicitly released too? (DirectX 11)

I have a ID3D11Texture2D (that I've created manually) inside a ID3D11ShaderResourceView. When I want to Release() the resource view, do I need to Release() the texture that it is inside too? Or is it ...
1
vote
1answer
230 views

changing depth stencil state in DirectX11

An example from Frank D Luna's 3d Game Programming with Dx11 shows the following effect technique: technique11 DrawTech { pass P0 { SetVertexShader( CompileShader( vs_5_0, DrawVS() ) ); ...
1
vote
1answer
329 views

Driver error when using multiple shaders

I'm using 3 different shaders: a tessellation shader to use the tessellation feature of DirectX11 :) a regular shader to show how it would look without tessellation and a text shader to display ...
0
votes
1answer
214 views

How do I implement my old OpenGL-based gfx_render_triangle_list using DX11?

I am working at a game that has lots of procedural content. I had built a game engine using OpenGL that handles everything needed for creating a basic 2D game, sprites, primitives, blending, polygons ...
8
votes
1answer
986 views

DirectX11 without window attached?

I just wonder, if it's possible to initialize and use DX11 or DX9 for offscreen rendering only - meaning with no attached window. My intention is to do some GPU benchmarking before opening actual ...
2
votes
1answer
177 views

How can I render the whole faces instead of only the vertices? [closed]

I'm doing my master thesis in comparing DX9 LoD with DX11 Tesselation LoD. Therefore I use a ShaderManager that calls either the shader for the DX9 implementation, where the model is exchanged by the ...
2
votes
1answer
149 views

Emulate border color texture address mode efficiently

In WinRT the border color texture address mode is not supported. The best I came up with in emulating the border address mode, is doing this in my pixel shader: float4 tcol = tex.Sample(texSampler, ...
1
vote
1answer
4k views

Creating a simple 2d engine (C++), best way to create an Sprite class?

Since MS announced that they are not give more support to XNA , for me was an opportunity to start to learn DirectX , so i wanted to learn DX11, i was following this tutorials ...
3
votes
1answer
441 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 ...
1
vote
2answers
639 views

How to obtain a pointer to the compiled shader in D3D11

My shader creation code looks like this. std::shared_ptr<IRenderUtility::IVertexShader> D3D11RenderUtility::CreateVertexShader(IShader::INIT_DESC & desc) const { HRESULT result; ...
4
votes
2answers
340 views

Geometry shader worldviewprojection

I'm writing a simple geometry shader to create 3D "primitives" in place of a single point. I am performing all of the world-view-projection conversions within the geometry shader after creating the ...
2
votes
1answer
533 views

Creating Input layouts for different vertex types

I'm still in the planning phase for a hobby abstract renderer, and i'm wondering how i should handle multiple vertex types and different shader inputs. (This is my first graphics project, so cut me ...
-1
votes
2answers
2k views

Problem rendering cube using DirectX 11

I'm toying with DirectX 11 and am trying to render a simple cube, but I can't seem to get anything to show (except the clear color, which is a good sign I suppose...) Everything seems to be working, ...
6
votes
1answer
2k views

Different shaders for different objects DirectX 11

I am learning Direct3D 11, and in all basic tutorials I found on shader writing, Vertex and Pixel shaders are written so they transform whole scene same way. Tutorials like render cube with texture... ...
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 ...
0
votes
1answer
119 views

Rendering an object more than once

Right now I'm facing the issue of rendering the same objects more than once in Directx 11, as the object has: A diffuse shader A directional lighting shader A texture shader Now the final color ...
2
votes
1answer
582 views

Render video from file to DirectX11 texture

Is there a way to render a video from file (avi, mp4, etc...) to a texture in a directx11 environment? If so, how?
0
votes
1answer
1k views

Loading a vertex shader compiled by Visual Studio 2012

I've got an extremely simple vertex shader that Visual Studio 2012 compiles into a .cso file. Now I want to load this file and create a vertex shader on the graphics device using the ...
0
votes
1answer
450 views

Stencil buffer and transparent pixels

Do transparent pixels cause a stencil buffer operation (increment, decrement, etc.) to be executed? My understanding was that only opaque pixels cause a stencil buffer operation, transparent pixels ...
0
votes
2answers
493 views

Multipass shader in DirectX 11

As far as I understand for DirectX11 it is recommended to have multiple single pass shaders, so the the method with multiple passes in one shader file is deprecated. Is my understanding correct and ...
-1
votes
1answer
145 views

How To Buffer Many Vertex, Geometry, and Pixel Shaders

What is the best way to buffer Vertex Shaders, Pixel Shaders, etc into the Device/Device Context without having to reload them from the filesystem every time? ID3D11Device::CreateVertexShader ...
3
votes
1answer
512 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
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
274 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 ...
2
votes
1answer
2k views

DirectX / Instance Buffer - How To Use Instance Buffers To Enable Reuse of VertexBuffer Data?

I created a simple Model framework in C++ 11 so that the same model can be rendered in different parts of a scene. What I am trying to figure out is how to reference VertexBuffer data already "set" ...
1
vote
1answer
462 views

DirectX post-processing pipeline

I'm trying to make a simple post processing pipeline, depicted as follows with 3 effects in this case: |------| |------| |------| I ...
0
votes
1answer
342 views

Weird shader compiler error

I am trying to draw a full screen quad without a vertex buffer. SV_VertexID should do the trick, although I get a weird error in my shader on the following line: PS_IN VS(uint VertexID : ...
3
votes
1answer
170 views

Depth Stencil buffer mandatory?

If I disable depth and stencil buffering, do I have to create and set the depth stencil buffer?
7
votes
2answers
1k views

D3D/DXGI handle fullscreen transition

I have a D3D11 application, and I want to add proper fullscreen suport. Now I can let DXGI switch my window to fullscreen for me, and I'm under the impression that DXGI will take care of everything ...
1
vote
1answer
1k views

DX11 application running on Windows XP using only DX9?

I'm developing an application that utilizes DX11. I know that DX11 is only available on Windows 7 (and Vista with SP). I wonder if there is some way to run the application on Windows XP and use only ...
2
votes
1answer
157 views

Does the feature level affect multisampling?

I'm using DirectX 11 with the feature level 9_3 even though my computer could run 11_0, but I want to support older hardware as well. I'm using CheckMultisampleQualityLevels to check whether multi ...
0
votes
2answers
285 views

HLSL compiler specification (optimizations)

Can I read somewhere about optimizations that HLSL compiler performs? For example, in some codes I have different variables that get a constant value (just to let myself adjust the shader with other ...
1
vote
1answer
210 views

Is my idea of how to use matrices to layer 2D on top of 3D correct?

I'm new to using matrices, so I'd like some input on whether I've understood the use of them in the context described in the title. Right now I have a small Direct3D 11-based game engine which ...
0
votes
1answer
120 views

How do I get buffers from another class for CreateBuffer

I believe this is not strictly specific to DirectX but just to pure c++ language problem. I have a class (simplified): class A { public: ID3D11Buffer* getVBuffer() const { return ...
1
vote
2answers
513 views

Should the world transformation matrix be stored in a constant buffer when rendering?

Generally when rendering objects you would: Apply world transformation to go from object space to world space Apply view transformation to go from world space to camera space Apply perspective ...
1
vote
1answer
278 views

How can I render primitives to pixel coordinates?

I'll emphasize that I am very new to graphics programming. I've been using XNA up until now and I've been looking for a way to build simple 2D functionality with textured quads. I'm sort of starting ...
2
votes
1answer
177 views

Nine Patch Images in DirectX

In Android development I found nine patch images very useful to draw images that have a fixed border. When the image is scaled the inner part scales, but the border stays at a fixed size. I was ...
4
votes
1answer
810 views

How do I use threads together with DirectX11?

I have only found the documents on MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476884(v=vs.85).aspx Although it doesn't say anything about creating them, it mentions that device is ...
1
vote
1answer
970 views

Why can't my .exe find my .fx file?

I'm having a problem with my .fx file in my D3D 11 application. I can run the application just fine from Visual Studio, but when I run the .exe it fails when trying to load the .fx file. I've ...
0
votes
1answer
212 views

Running advanced floating point calculations on the GPU?

I want to learn how to use AMD Stream and NVIDIA CUDA (PhysX) to calculate things such as locations. I have not yet found where to get the SDK for these (I can't test the CUDA things because I have a ...
0
votes
0answers
67 views

Transform a Screen Delta

I have a delta in screen coordinates that I want to transform to a 3d delta in world space. The delta is in this case a movement across the (x,y) coordinates in screen space on the near projection ...
3
votes
1answer
245 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, ...
2
votes
0answers
1k views

VS2012 C++: Unable to ID3D11Device::CreateVertexShader when loading compiled CSO file

I have been trying to get a tutorial Direct X 11 application running for some time now. I'm being stymied when I try to create the vertex shader. Setting the Direct X Debug setting reveals that I am ...
2
votes
1answer
139 views

Direct3d Techniques and Windows 8

Under Windows 8, what is the alternative to this code: technique11 Light0Tex { pass P0 { ... technique11 Light1Tex { pass P0 { ... And: Light1Tech = ...
2
votes
1answer
324 views

DirectX11 CreateWICTextureFromMemory Using PNG

I've currently got textures loading using CreateWICTextureFromFile however I'd like a little more control over it, and I'd like to store images in their byte form in a resource loader. Below is just ...
3
votes
1answer
335 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; ...
5
votes
1answer
677 views

Tessellation Texture Coordinates

Firstly some info - I'm using DirectX 11 , C++ and I'm a fairly good programmer but new to tessellation and not a master graphics programmer. I'm currently implementing a tessellation system for a ...
5
votes
2answers
1k views

ConsumeStructuredBuffer, what am I doing wrong?

I'm trying to implement the 3rd exercise in chapter 12 of Introduction to 3D Game Programming with DirectX 11, that is: Implement a Compute Shader to calculate the length of 64 vectors. Previous ...
1
vote
1answer
133 views

Texture the quad with different parts of texture

I have a 2D quad. Let say it's position is (5,10) and size is (7,11). I want to texture it with one texture, but using three different parts of it. I want to texture the part of quad from x = 5 to x ...
3
votes
1answer
334 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 ...