DirectX 11 is the latest release of Microsoft's collection of APIs which contain features to aid in game development.
3
votes
1answer
149 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
113 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
1k 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
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
278 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
810 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
112 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
1answer
124 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
326 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
955 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
0answers
55 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 ...
2
votes
2answers
300 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
242 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
446 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
2k 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 ...
2
votes
1answer
454 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
929 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 ...
2
votes
2answers
417 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
1k 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 ...
2
votes
1answer
120 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
909 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
588 views
Is the output from D3DCompile specific to one GPU, or not?
In Direct3D 11 there is a two-stage shader compilation process; you first pass the HLSL source code into D3DCompile, which outputs a "blob" of bytecode. You then take this blob and call ...
2
votes
1answer
926 views
Why can I not map a dynamic texture in D3D?
I am trying to map a Texture2D resource in DirectX11 via SharpDX.
The resource is declared as a ShaderResource, with Dynamic usage and the 'Write' CPU flag specified.
My call however fails with a ...
2
votes
1answer
1k views
I cannot update a shader constant via a constant buffer in DirectX 11
I've tried everything I can think of, but I cannot get a constant buffer to update a variable in my shader in DirectX 11. I followed the examples on msdn. I read and re-read the articles on constant ...
2
votes
1answer
59 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, ...
2
votes
1answer
116 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 ...
2
votes
1answer
85 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 ...
2
votes
1answer
180 views
How do you create a cbuffer or global variable that is gpu modifiable?
I'm implementing tonemapping in a pixel shader, for hdr lighting.
The vertex shader outputs vertices with colors. I need to find the max color and save it in a global.
However when I try and write ...
2
votes
1answer
625 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 ...
2
votes
1answer
160 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 ...
2
votes
1answer
364 views
Hemicube algorithm d3d9 or d3d11, float valued colors
The hemicube algorithm renders the scene to 5 sides of a half-cube, from the perspective of each polygon.
Assume you place the hemicube around me and render to the 5 sides. The idea is, we can see ...
2
votes
0answers
359 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
0answers
314 views
Geometry Shader and Stream Output with Directx11
I am having trouble trying to send verticies generated in the Geometry Shader to Stream Output. What I am trying to accomplish is to generate verticies from the Geometry Shader and store them to a ...
1
vote
2answers
209 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
61 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 ...
1
vote
1answer
72 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 ...
1
vote
1answer
62 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
182 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 ...
1
vote
1answer
1k 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 ...
1
vote
1answer
66 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
198 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?
1
vote
1answer
634 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 ...
1
vote
1answer
252 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 ...
1
vote
1answer
106 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 ...
1
vote
2answers
450 views
Why does calling CreateDXGIFactory prevent my program from exiting?
I'm using CreateDXGIFactory to get the graphics adapters and display modes. When I call it, it works fine and I get all the data. However, when I exit my program, the main Win32 thread exits, but ...
1
vote
3answers
432 views
How do you rotate a cube map?
I'm looking for suggestions on this
Say you have a cube map. You want to rotate it as efficiently as possible.
You can render the cube map, rotate the camera, and render the scene to another cube ...
1
vote
1answer
374 views
Marshalling C# Structs into DX11 cbuffers
I'm having some issues with the packing of my structure in C# and passing them through to cbuffers I have registered in HLSL. When I pack my struct in one manner the information seems to be able to ...
1
vote
1answer
775 views
Proper vertex buffer use
How're you supposed to use vertex buffers?
Say you have 500 distinct deformable shapes/models in the world (ie you want to be able to change/delete vertices from the models somewhat arbitraily as the ...
1
vote
1answer
59 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
2answers
110 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;
...
