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
211 views

How do I set up a depth buffer in SharpDX?

I draw some instanced cubes, but when i rotate the camera (or the world) some cubes that should be behind other cubes are drawn before the cubes. I already had this issue a long time before and i ...
0
votes
1answer
112 views

Frustum culling vs draw calls

In a more performance-sensitive environment than a desktop CPU/GPU (namely a mobile device) is there really a point in determining whether or not to skip drawing non-visible objects vs reducing the ...
0
votes
1answer
124 views

When should I use instancing versus a constant buffer?

I've heard something about instancing and understood it's useful for drawing the same object many times with slight changes. It's faster because you call the draw function once per frame and update ...
0
votes
2answers
49 views

Multiple colored textures vs Color Overlay

Let's say we're using DirectX 9/10/11. In our game we have a character wearing armor. The armor has 50 different color variations. So, if armor is red, the first method would load the red texture ...
0
votes
1answer
42 views

DepthStencilView and alphaBlendState

I have create a 2D game with directx11 and i want to use a depth buffer instead of a painter's algorithm to draw the sprites but i have a problem since i'm not really good with directx 3d programming. ...
0
votes
1answer
70 views

Getting access violation because of ID3D11Buffer [closed]

I try to create a simple class store my model variables vertex array and vertexbuffer. So I create an array of myclass to create and manage object dynamically. But when hr = ...
1
vote
2answers
95 views

Texture2DArray in Directx11 with different formats

I'm trying to create a texture2DArray from multiple of images, each of which has different formats, and I got the following error from the DirectX11 debug layer. D3D11 ERROR: ...
2
votes
1answer
224 views

Draw call optimization for multiple meshes in DirectX11

I have a large scene in a B3D model, which includes about 120 meshes as in the following pictures: Each mesh contain a vertex buffer and material information such as diffuse, specular, ambient... ...
0
votes
2answers
118 views

Can't read .cso files but I can read their .hlsl versions?

Well I've been trying to read a .cso file to use as a shader for a DirectX program I'm currently making. Problem is no matter how I implemented a way to read the file it never worked. And after ...
0
votes
1answer
39 views

How to create two objects from one vertices array with translate?

I have an object and I can render it but I want to use its vertices twice but I don't know how to. this is my code reading object from txt: fin.open("piyon.txt"); fin >> vertexCountpiyon; ...
0
votes
1answer
68 views

odd line artefacts on my screen? (C++ DirectX11)

I'm getting some odd lines on my screen in my program: They seem to be in a static location on the screen and occur at regular intervals. They are also on the horizontal too but are harder to see in ...
0
votes
0answers
47 views

2D Quads Depth Rendering (DirectX11)

Ok. Did the searches, found some answers that weren't related and a lot of answers telling people to search... Sooo, anyway, pretty simple question. Just looking for a simple answer, no need to go ...
4
votes
2answers
119 views

Should I use different input layout for meshes (vertices) with and without normal maps?

I'm writing an DirectX11 game. About 60% of my game models (or "of my vertices") have: Position Texture coordinate Some of them use: Position Texture coordinate Normals And few of them: ...
10
votes
3answers
2k views

How many active shaders at one frame in the game (should I typically use)? 5? Or more like 100?

I have a question: how many shaders are usually active at the same time in one scene in modern games? I mean: I know that multiple shaders are being used (switching between them in each frame). And ...
1
vote
1answer
115 views

DirectX 11 Updating Resolution

Searched for a while thinking this would have some obvious tutorials but I can't find anything... which makes me think I must be using the wrong wording because it seems obvious. Anyway, when I ...
1
vote
1answer
235 views

Quad Texture to Pixel Screen Space (DirectX 11)

I think I must be using the wrong wording for what I want, because I seached and just kept finding pixel shader questions. But this seems like something that anyone making a 2D game would want. ...
0
votes
1answer
66 views

How many views can be bound to a 2D texture at a time?

I am a newbie trying to learn on DX11.x. While reading about resources and views in MSDN, I thought this question For a given 2D Texture created with ID3D11Texture2Dinterface (or for that matter any ...
0
votes
2answers
175 views

2D Rendering in DX11. Texture Storage and Reference

I'm trying to think of the best way to manage textures in my 2D game. First, I am using DX11, so right now my "textures" are just pointers to a ID3D11ShaderResourceView created by ...
0
votes
1answer
93 views

Frustum culling + instancing

I've implemented instancing in my app and right now I have an instance buffer holding position data for all instances. But I'd like to also implement frustum culling which would cull some of the ...
1
vote
1answer
98 views

Is there any way to change texture filtering globally in Direct3D 11?

One of the major changes I have encountered between Direct3D 9 and Direct3D 11 is the new API for setting up texture sampling. In D3D9, it was sufficient to simply set a given value of a given ...
4
votes
1answer
164 views

Calculating normals after displacement mapping

I'm using C++, DX11 and tessellation. After tessellating a triangle I apply displacement mapping to the new vertices. But they still have the original triangle's normal so the lighting calculation ...
2
votes
1answer
55 views

How To Set Constants Using ID3DShaderReflection

I got to the point where I am tired of hardcoding shaders and decided that it was now time to look into using ID3D11ShaderReflection to get data from the shader and set my shader's constant buffer ...
0
votes
2answers
99 views

DirectX: Render the black bars

I'm still quite a beginner in the industry. I'm working on a game with some friends and I would like to add a cinematic between 2 levels like in the attached picture. My question is how can I render ...
2
votes
1answer
107 views

Is it ok to mix shader types?

The title might not be precise. Let's say I have one material consisting of vertex and pixel shader, another one consisting of vertex, geometry and pixel shader, and yet another one consisting of ...
0
votes
2answers
83 views

InputAssembler and emtpy/incomplete buffers

I was wondering what the InputAssembler does if the size of the bound buffers does not match the vertex count of the Draw() call. I've seen the example at ...
1
vote
0answers
38 views

DX11 ID3DX11FFT as post

I'm trying to implement bloom using FFT during post processing. But I have no experience with compute shaders and so far. DX11 has the ID3DX11FFT interface, which encapsulates compute shaders under ...
1
vote
3answers
205 views

How do I correctly multiply an XMMATRIX by a scalar?

Using DirectXMath and its XMMATRIX structure in C++ and Direct X 11, how does one multiply that matrix structure by a single float scalar? I want to implement the operation B = A * f; where A and B ...
0
votes
1answer
88 views

Getting invalid argument error on R32G32B32_FLOAT texture creation

D3D11_TEXTURE2D_DESC texDesc; texDesc.ArraySize = 1; texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; texDesc.CPUAccessFlags = 0; texDesc.Format = DXGI_FORMAT_R32G32B32_FLOAT; ...
4
votes
1answer
315 views

How to debug DXGI_ERROR_INVALID_CALL errors?

I am developping an application using SharpDX and on one of my machines the call _swapChain = new SwapChain(factory, _device, desc); fails with the error message HRESULT: [0x887A0001], Module: ...
0
votes
1answer
156 views

Rendering to specific face of a cubemap

I have working omnidirectional shadow maps for point lights. Rendering a shadow map for one point light consists of rendering the scene to 6 separate rendertargets, then send those render target ...
1
vote
1answer
142 views

Difference between texture arrays and multiple single textures?

I've just learnt that DirectX 10 and above have a feature called "texture arrays". Which, basically, is just a normal array of textures (shader resources) which in a shader is declared like: ...
0
votes
1answer
210 views

Why are my geometry-shader-generated billboards not showing up given the following code?

My program is a rain particle system. After processing a list of positions of rain particles, I passed them to the geometry shader for generating a billboard for each position. If I use a simple ...
2
votes
1answer
132 views

Passing Input to Compute Shader

I am using D3D11 on D3D10 hardware, trying to get a very simple compute shader to run (my hardware supports cs_4_0). What is the best way to pass data to the compute shader? I've seen some samples ...
0
votes
1answer
172 views

How can I check the multisample quality level count?

I can check it with ID3D11Device::CheckMultisampleQualityLevels(). So to use it I need to create the device: D3D11CreateDeviceAndSwapChain(). To call it I need to fill the DXGI_SWAP_CHAIN_DESC which, ...
1
vote
1answer
62 views

How do I change rasterizer state properly?

To set the rasterizer state I have to ID3D11Device::CreateRasterizerState() and then ID3D11DeviceContext::RSSetState. And then I should ID3D11RasterizerState::Release() it, right? How about when I ...
0
votes
1answer
92 views

Heightmaps with several textures

I got a full functioning heightmap loader, however I can only use one texture. Now I want to implement more textures (like diffrent textures depending on heights ect, Possibly a structure that makes ...
2
votes
1answer
96 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 ...
0
votes
1answer
148 views

Easiest way to smoothen coarse mesh with HLSL?

I've browsed through a couple of presentations and papers about DX11 tessellation and they all say that one of the most common usages of tessellation is to take a coarse (low poly) mesh, smoothen it ...
2
votes
1answer
51 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?
1
vote
1answer
179 views

Read part of texture using SharpDX

I have a Texture3D. I want to read a part of it from CPU side. (I'm using the SharpDX toolkit (v2.5.1).) My data is always 0, but the output shows no errors. This is the source texture: testTex = ...
3
votes
1answer
76 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, ...
1
vote
1answer
49 views

Vertexquads are not being drawn in 2D space

I started teaching myself DirectX a short time ago and have come across a problem which I can't figure out by myself unfortunately. I'm trying to build my own font system, so I can draw strings in 2D ...
0
votes
1answer
181 views

Rendertarget and alphablending problem (Offscreen particle rendering)

Today, I have implemented soft particles by rendering them to a separate render target and blending that with the scene, which worked as expected with additive blended particles. In that case I render ...
0
votes
2answers
327 views

DirectX11: Drawing multiple objects

How can I draw many different objects on screen at once, with multiple vertex buffers, using DrawIndexed()? (Drawing the same object is simple, and I'm not looking to instance) ...but I am looking ...
0
votes
1answer
263 views

Problem with Texture Array and billboards [closed]

It's my first post here. My name is Bruno and I'm from Brazil. I'm trying to learn DirectX 11, and I'm using Frank Luna's book. The problem is that he uses the Effects Framework to do everything, and ...
0
votes
0answers
188 views

Bullet Physics Raytrace Picking

I'm having trouble picking using bullet's raytrace code Here's what I have so far for creating the actual Ray float top = 1.f; float bottom = -1.f; float nearPlane = 1.f; float tanFov = (top - ...
-1
votes
1answer
77 views

problem with texcoord at post effect (quad rendering)

I have this shader: float4x4 View; struct VS_INPUT { float2 Position : POSITION; float2 TexCoord : TEXCOORD; }; struct PS_INPUT { float4 Position : SV_Position; float2 TexCoord : ...
2
votes
1answer
138 views

Finding out the “width” and “height” of my screen after projection added

In a 2d game, doing collisions with the edges of your screen is easy. Your textures are a 1:1 mapping of your screen resolution because your verities are too.. if your x position is > than ( screen ...
1
vote
1answer
167 views

How can I read texel data on a separate thread in D3D11?

In D3D10, I load a staging texture onto my GPU memory, then map it in order to access its texel data on the CPU. This is done on a separate thread, not the thread I render with. I just call the device ...
1
vote
1answer
180 views

DirectX11 pixel shader in pipeline is missing

I'm writing a program which displays a MS3D model using DirectX, and unfortunately, the result shows nothing on the screen. When I use the Graphics Debugger from Visual Studio 13, I notice that the ...