DirectX is a set of multimedia APIs from Microsoft aimed primarily at game developers. Popular APIs within the DirectX collection include Direct3D, XInput, and XAudio.

learn more… | top users | synonyms (1)

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 ...
2
votes
1answer
461 views

How to debug Direct3D resource leak?

When I close my application, I get the following errors in the Direct3D Debug output: Direct3D9: (INFO) :MemFini! Direct3D9: (ERROR) :Memory still allocated! Alloc count = 20 Direct3D9: (ERROR) ...
2
votes
2answers
161 views

How to correctly check for HW T&L on Direct3D?

In theory, to check for HW T&L in Direct3D, one calls IDirect3D9::GetDeviceCaps and checks for the HWTRANSFORMANDLIGHT flag to be set in the returned structed. However, the documentation states: ...
2
votes
1answer
488 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
241 views

Rendering a minimap from large bitmap

I'm trying to create a minimap for my game but am having an issue. I'm using Direct2D as the graphics API and have a ID2D1Bitmap* which contains the pixel data for the loaded area of the world. I'd ...
4
votes
4answers
693 views

Why do most game devs prefer OGL for OS X and D3D for Windows? [closed]

Today I decided to check what Diablo 3 developers used to do graphics: OpenGL or Direct3D? My mind was completely blown: For Windows, they've used D3D and for OS X they've used OGL. I did some ...
1
vote
1answer
202 views

Specular Maps, understanding cryengine hints

i am reading the cryengine documentation, but i don't understand the following hint. Is there any reference to know the logic behind it? "Create proper specular maps for the objects, and then store ...
1
vote
0answers
166 views

DirectX Effects Framework alternative [closed]

Now that the DirectX Effects framework has been axed, are there any other similar frameworks out there ? I now there's Nvidia CGFX, but does that work with the latest DirectX versions ? I'd rather not ...
0
votes
1answer
387 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 ...
1
vote
2answers
503 views

Tile-based game with DirectX - issues with transparency and StretchRect

In my current project I have a class which loads a map file and then it should load all associated tilesets (no transparent tiles - I used to work with magenta as a colorkey) and precreate a surface ...
0
votes
2answers
442 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
vote
1answer
115 views

How can I get a pointer to ID3DX11EffectShaderVariable from ID3DX11Effect

I'm using the DirectX Effects framework and I want to create an input layout automatically when compiling an effect. I've tried to call ID3DX11Effect->GetVariableByName() with the shader's name, to ...
1
vote
1answer
408 views

2D Matrix Transformation (with a Player and Ground)

I have a simple game that I'm trying to do for learning purposes, but Matrices are a bit hard, especially in DirectX. I currently have a tilesystem that renders tiles at the screen and a character ...
-1
votes
1answer
135 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 ...
-1
votes
1answer
887 views

How can I switch between DirectX and OpenGL renderer in my engine?

I am currently developing my engine with DirectX, but I want to make it cross-platform in the future, using OpenGL. How can I check which platform my engine is running on? And can I use an if ...
0
votes
1answer
205 views

Making a point light follow the camera

I'm applying phong shading onto a single giant triangle, and I'd like the light's coordinates to coincide with the camera's coordinates in 3D space. In order to do this, whenever I update the camera's ...
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
261 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
395 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
304 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 : ...
5
votes
1answer
455 views

What are the rest of the blending functions used for?

In general, I know of five ways to make use of blending functions (these are for OpenGL, but replace glBlendFunc() with SetRenderState(D3DRS_SRCBLEND) and SetRenderState(D3DRS_DESTBLEND) for DirectX): ...
7
votes
2answers
976 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 ...
5
votes
1answer
1k views

2D Line drawing with Pixel Shaders

Recently I asked a question, what is the fastest way to render 2D lines using DirectX, and one of the answers mentioned this paper on Fast Prefiltered Lines which uses Pixel Shaders to accomplish ...
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 ...
1
vote
1answer
4k views

Will DirectX 10.1 graphics card work with DirectX 11?

I just started learning DirectX, but I have a problem with its version. I have ATI Radeon HD 4830, this card supports only DirectX 10.1, but when I ran dxdiag it said that I have DirectX 11, then I ...
2
votes
0answers
53 views

resizing directx control so that more of my object's environment is visible [closed]

I'm very new in 3D. I have a DirectX control which I want to be able to resize. A 3D object is shown in the control. On resize, I would like that object to stay the same size, only more of its ...
2
votes
2answers
2k views

OpenGL vs DirectX difference from Graphics card perspective?

I want to know the difference in purely hardware level if there is any. For example the most simple question: Is there a chip for DirectX and another chip for OpenGL? What do hardware producers do to ...
2
votes
1answer
411 views

How slow is generating a new Vertex Buffer?

I am currently working on a project that does 2D sprite-like graphics on Windows 8 (Metro-style app). For that purpose I am using Direct3D with quads to act as sprites. My problem is that it get's ...
2
votes
1answer
230 views

Direct3D shader compilation fails with constant buffers

I've been particularly annoyed by a 'bug' for a couple days involving D3DCompile and vertex shaders with constant buffers. I'm assuming the bug is my fault (missing flag or small nuance of the poorly ...
8
votes
1answer
294 views

Curious Transparent Holes Render Artifact

So I'm trying to implement "smooth" terrain in my block engine by giving each surface block a heightmap. Basically, what I do to generate these "heightmaps" for each block is I generate the heights ...
0
votes
1answer
464 views

DirectX9 fullscreen, render immediately?

Is it possible, somehow to avoid the single frame of black that appears before a DirectX9 window is displayed in fullscreen? My code looks like this. INT WINAPI wWinMain( HINSTANCE hInst, ...
0
votes
2answers
230 views

Is it viable to wrap D3D to change its API style?

I have an interest in developing games professionally and have started learning DirectX 11 to that end. I come from a Java background, but with the recent changes introduced with C++11, I've come to ...
2
votes
1answer
170 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 ...
0
votes
4answers
764 views

At this point in time, avoid XNA? [closed]

XNA seemed like a valid option a few years ago, but XNA was never a real success, and now it seems like a footnote, even Microsoft seems to treat it that way. Should I just go the DirectX route ...
1
vote
2answers
209 views

Diffuse light direction

I'm learning a tutorial from Rastertek about diffuse light with DX 11, here's the shader code: float4 LightPixelShader(PixelInputType input) : SV_TARGET { float4 textureColor; float3 ...
0
votes
2answers
453 views

SharpDX (DirectX) - possible to measure Frame time?

I'm trying to benchmark various ways to draw 2D lines and have a snag. A D3D10Device that I draw with (and flush) doesn't appear to block, so I can't accurately measure frame rate (or time to render 1 ...
1
vote
1answer
313 views

Is using Sprites the most recommended way for doing 2d animations with Directx?

I am working on a game engine of my own and I was using Vertex buffers to create triangles and then draw textures on them. Now I want to extend it so I can do simple 2d animations using "sprite ...
12
votes
3answers
4k views

Fastest way to render lines with AA, varying thickness in DirectX

So I'm doing some DirectX development, using SharpDX under .NET to be exact (but DirectX/C++ API solutions are applicable). I'm looking for the fastest way to render lines in an orthogonal projection ...
3
votes
1answer
192 views

Why are some objects not rendering properly?

Here's a button I exported from Blender into a .x format: Now here it is in the game with BasicEffect applied to everything: And now with my custom shader: And there's the problem. While the ...
3
votes
2answers
2k views

Does Monogame on Windows Desktop use OpenGL or DirectX by default?

if i use monogame 3.0 beta on windows desktop, does it use the directx renderer (sharpdx) or the opengl renderer by default? if it uses directx is there away to make sharpdx call directly? thanks!
1
vote
3answers
528 views

Event Based Render / Update Loop

I'm working on a few game dev tools which use OpenGL or DirectX to render 3D models (viewing). Consider your favorite 3D modeling software package (Softimage, Maya, 3DS Max, modo, etc.). Note that ...
0
votes
2answers
736 views

Go to fullscreen and back in directX

I'm now learning how to use directX (10 - 11), and i use materials from SDK samples, http://www.rastertek.com/ and http://takinginitiative.net/category/graphics-programming/directx-10-tutorials. But i ...
3
votes
1answer
231 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, ...
7
votes
4answers
217 views

Game development for multiple Microsoft platforms

I intend to develop games for Microsoft's Windows Store, however, I'm confused between their platforms, so please clarify those questions: Is there any technology (XNA, DirectX), so a game can be ...
1
vote
1answer
236 views

DirectX procedural programming

Well I'm learning DX11 and I hope someday I can start a simple 3D engine. I'm following tutorial series and I realised that I have no need to create any class to mantain my code (the tutorials also ...
0
votes
1answer
134 views

Why and how should I cast DirectX function parameters?

I'm learning DX11 and I found that in some D3D functions, a parameter has to be cast just like in the GetBuffer function of the swapChain: the third parameter has to be of type void*, so when calling ...
2
votes
1answer
297 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
299 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; ...
4
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 ...