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
1answer
799 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
1answer
134 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
213 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
300 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
436 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
122 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
868 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
117 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
989 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
596 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
371 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
189 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
133 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
53 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
316 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
2answers
2k 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
575 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
140 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
251 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
806 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
544 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
418 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
675 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
374 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
355 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
328 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
4k 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 ...
2
votes
0answers
135 views

Stereo 3D: drawing 2D elements at apparent screen depth

I'm developing an application making use of DirectX11's stereoscopic features. At such I am not relying on nVidia's automatic implementation. That means I have to replicate a way to render 2d elements ...
1
vote
0answers
76 views

Directx Texturing problem [closed]

I've recently started exploring Directx 11. I'm almost done the introduction so I started making my own *.obj parser and it works beautifully. I accounted for the right-hand coordinate system of 3ds ...
3
votes
1answer
428 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 ...
4
votes
1answer
180 views

How do these Direct3D 11 components work together?

I am having a really hard time to understand how the following Direct3D components play together and what they do (or exist for) while creating a scene on the screen. render target view render ...
0
votes
1answer
157 views

Accessing and changing texture data in SlimDX

How can I access and change texture data in SlimDX? I have a Texture2D and a Texture3D and I need to be able to go in and change either a single or group of pixels.
0
votes
1answer
291 views

DirectX 11, using Tessellation & Geometry shader in a single pass

Before all, sorry for my poor english ! With DirectX 11, i'm trying to create a random map full with GPU. Using Hull shader stage, I'm managing LOD with tessellation. Using Domain shader stage, I'm ...
2
votes
1answer
695 views

Writing to a structured buffer with a compute shader (D3D11)

I have some problems writing to a structured buffer. First I create a structured buffer that is filled with float values beginning from 0 to 99. Afterwards a copy the structured buffer to a CPU ...
1
vote
1answer
260 views

How can I compile SM 3.0 effects in D3D11 in SlimDX?

var bytecode = ShaderBytecode.CompileFromFile("shaders\\testShader.fx", "fx_5_0", ShaderFlags.None, SlimDX.D3DCompiler.EffectFlags.None, null, null, out str); var effect = new ...
4
votes
1answer
142 views

Geometry Shader : points + Triangles

I have different Shaders and for each Shader a instance of the ShaderClass class, which initializes the Shaders, Renders the Shaders, etc. I use most of the Shaderclasses without Geometry Shader, but ...
0
votes
0answers
369 views

Convert OpenGL code to DirectX

First of all, this is kind of a follow up question on @byte56 excellent anwser on this question concerning picking algorithms. I'm trying to convert one of his code examples to directX 11 however I ...
-1
votes
1answer
436 views

Why was the DirectX mesh interface removed? [closed]

I'm currently working with D3D 11 and if I understood it correctly, D3D 10 had a mesh interface built in to it which was removed in 11. If this is correct, why was the mesh interface removed? It ...
2
votes
1answer
94 views

Why is it when I render a basic cube, my editor's grid changes too?

I have one HLSL file for DirectX11 that only has input layout for color and position. Then another HLSL file for the simple cube that has position, normal and textures. What I noticed is when I render ...
4
votes
1answer
463 views

How can I emulate point sprites in D3D11?

I have points which I pass to a vertex shader and then to a geometry shader, but now I want to get from the geometry shader a "bigger" point. So the point should get a "dadius" like it was possible in ...
3
votes
1answer
310 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
228 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
198 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
567 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
924 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
187 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
109 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
388 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
1k 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 ...