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
262 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 ...
1
vote
1answer
200 views

Painter algorithm on transparant objects

Why do you have to use the painter's algorithm when drawing transparant objects ? Can't you just use a z-buffer, draw all non transparant/opaque objects, then draw all transparant/opaque objects last? ...
3
votes
1answer
177 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. ...
2
votes
1answer
481 views

How do you add rotation to particles?

Today I was working on a particle system and I can't figure out how to give the particle billboards a rotation (so to have them spinning clockwise or counter-clockwise while facing the player). I ...
2
votes
1answer
742 views

DirectX11 Gamma Correction

I am writing a game using SharpDX with DirectX11 and I have been reading that it is important to apply gamma correction to my engine in order to perform correct linear lighting calculations. So I ...
3
votes
1answer
151 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
1answer
96 views

Independent blending with DXGI_FORMAT_R16G16_SINT

I'm implementing direct volume rendering engine with volume bricking, but I'm stuck with this problem: For each volume brick I render to color render target [CRT] (for visualization) and to data ...
4
votes
2answers
316 views

Why is there a different set-constant-buffer function for every shader type?

Why are there VSSetConstantBuffers(), GSSetConstantBuffers(), PSSetConstantBuffers() (and so on) instead of just one SetConstantBuffers() for all shaders? Should I have completely separate constant ...
3
votes
3answers
935 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 ...
0
votes
1answer
505 views

Constant buffer content packing

I've read this: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476898%28v=vs.85%29.aspx#Shader_Constant_Buffer but there's not much information in it. When creating a constant buffer do I ...
5
votes
1answer
390 views

Multipass shaders and switching between passes

As mentioned here Effects should be avoided in DX11. If I understand correctly, that includes techniques and passes defined in *.FX files. So when doing a multipass shader (like the always-mentioned ...
1
vote
1answer
327 views

How to disable mipmapping?

I'm making a 2D game in which I create some textures dynamically for displaying as simple 2D quads. To achieve this, I call ID3D11Device::CreateTexture2D that requires a D3D11_TEXTURE2D_DESC. typedef ...
1
vote
1answer
412 views

Compiler cannot find some DX11 types (but can find DX10)?

my problem is probably trivial but I'm new to DX and have some trouble. I've found a code snippet (of a Shader class) with ID3D10Effect and ID3D10EffectTechnique types but I'm using DX11 so I changed ...
2
votes
1answer
99 views

Can I count all the allocated textures in D3D11?

Is it somehow possible to get the count of all texture objects on a device?
-2
votes
1answer
133 views

Does it matter where I initialize Directx11's shader constant buffer?

Should I initialize it before Map() or before `Unmap()? Does it make a difference?
-1
votes
1answer
201 views

Are there any open-source Direct X code-bases that I can look at to learn from as a beginning Direct X and graphics programming student? [closed]

I'm a third-year university student and I've recently begun studying Direct X 11. Mostly I've been following the samples from the SDK and reading a lot out of the MSDN. Although I have a decent ...
1
vote
1answer
117 views

When would a GPU need to write data to a vertex (or other) buffer?

I'm trying to understand why, when and how a GPU would need to write data to some buffer inside its own Video Ram. In Direct3D 11, there are two flags that concern this, which are ...
4
votes
2answers
355 views

How can I use shaders to make a square have a waving effect?

I'm new to using shaders to do some fancy effects and I'm struggling with them. I'm using DirectX 11 and HLSL. I have this square in the middle of the screen: It's just a square that I've created ...
1
vote
1answer
232 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
206 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
317 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
207 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 ...
7
votes
1answer
834 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
173 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
143 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
3k 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
380 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
550 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
318 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
504 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
118 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
503 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
398 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
447 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
140 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
450 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
263 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
401 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
310 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
167 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
998 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
150 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
260 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 ...