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)

2
votes
2answers
208 views

Why does matrix multiplication lead to different result if it's done on CPU, compared to GPU(shader)?

If I'm calculating a "camera space" on the CPU, by multiplying the view with the projection matrix on the CPU , and afterwards multiplying the world to the result my vertices do not pass to the pixel ...
3
votes
1answer
364 views

Matrix in constant buffer on the GPU contains NaNs but not on the CPU

I've got a shader with the following constant buffer: cbuffer ShaderParameters { matrix inverseViewProjectionMatrix; float4 cameraPosition; }; When using Visual Studio 2012's graphic ...
1
vote
0answers
182 views

Converting Animation data from Maya to DirectX in C++

I am currently trying to export an animation from Maya and import to a program I am working on. One of the problems I currently have is that when imported, the mesh and animation data looks reversed ...
10
votes
2answers
447 views

Managing graphic state and components?

I often tend to do a lot of premature optimazation when dealing with graphics. There are a few principles I always try to follow: Keep the number of D3D components to a minimum. (Render states, ...
4
votes
1answer
358 views

What happens to data between vertex shader and pixel shader?

Short version: What can happen to the output of a vertex shader that leads to no(or very few) pixels being drawn, especially in relation to a perspective matrix. Long version: My problem refers to ...
3
votes
1answer
617 views

creating a UI menu in c++

Im currently working on a 2D Game where the users can interact with specific nodes and are able to edit certain bits of information and I also plan for the users to be able to click buttons to set ...
0
votes
1answer
137 views

Strange rendering in Direct3D 10 [closed]

I'm writing an application which renders graphics on the screen. The application can switch between Direct3D9 and Direct3D10 graphics modules (I wrote DLLs that wrap both D3D9 and D3D10). When trying ...
4
votes
1answer
360 views

Applying an outline effect to primitives

I am trying to draw an outline on a collection of quads in Direct3D. I have three intersecting quads on the same plane in the following configuration: (The different colors here are just to ...
3
votes
1answer
879 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
311 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
138 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
382 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
208 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
612 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
172 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
127 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
294 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
429 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
367 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
102 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
350 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
121 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 ...
-2
votes
1answer
700 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
193 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
1k 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
238 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
1k 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
331 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
237 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
369 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
804 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
130 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
3k 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 ...
1
vote
0answers
44 views

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

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
325 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
196 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
286 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
399 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
226 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
149 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
732 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
188 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
374 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
279 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
3k 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
186 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
1k 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
467 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 ...