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)

0
votes
2answers
1k views

Fullscreen + Vsync = Stuttering

In my research for a stuttering problem in my game engine, I think, I have found the problem, but don't have any idea why this is happening, that's why I ask you if you have an idea ! The situation : ...
0
votes
0answers
29 views

World, View, Projection concept - history [on hold]

I've got some unusual question, actually I would like to know something about the history of the World-View-Projection concept. Where did it come from? When was it used first? Does it exist since DX ...
0
votes
0answers
37 views

Deferred Rendering Optimization [on hold]

I've followed http://www.catalinzima.com/xna/tutorials/deferred-rendering-in-xna/ for my little renderer(using sharpDX - Toolkit) and everything went good, until i noticed some problems: If I'm ...
-1
votes
0answers
76 views

Serious Memory leak using SlimDX Texture.FromMemory() [closed]

I am new to stackoverflow and new to DirectX. I'm considering using the C# Wrapper slimdx. After a lot of researches, I found out how to load a texture and Draw on the screen.The below code is c# ...
2
votes
4answers
237 views

Why would you use software rendering over hardware rendering, today?

As opposed to CPU or software rendering I assume? Wouldn't generally all current rendering be GPU based, seeing as you would be using OpenGL or Direct X? Could someone give me some info here, can't ...
2
votes
2answers
53 views

What is the advantage of wrapping D3D in a class versus a namespace?

Almost all the tutorials and books use a class wrapper for Direct3D. But I haven't found any scenario in which using more than one instance of Direct3D system (the "device" and state, et cetera) is ...
0
votes
2answers
70 views

SharpDX.Toolkit setting constant buffer

I am trying to use a constant buffer in a program using SharpDX.Toolkit. I use the Toolkit because it has nice font support for writing on the screen. The problem I face is in assigning data to the ...
2
votes
1answer
795 views

Reading from a staging 2D texture array in DirectX10

I have a DX10 program, where I create an array of 3 16x16 textures, then map, read, and unmap each subresource in turn. I use a single mip level, set resource usage to staging and CPU access to read. ...
0
votes
0answers
36 views

Could not load sound (MonoGame) [on hold]

I am using the Window Project (in MonoGame 3.2) which is uisng DirectX instead OpenGL. If I run a game, so its show me: "Could not load wind asset as a non-content file" I think, that is no ...
1
vote
1answer
72 views

How do I determine color resolution of an output in DXGI/D3D?

i'm was revising some code i wrote some time ago when working on the window wrapper for my rendering framework. The framework is based off DirectX, but it wasn't really using any D3D-related facility. ...
0
votes
0answers
25 views

Bilinear filter in repeating texture, HLSL

I have a repeating texture that I'm using as a scroll surface. The idea is that as I pan the surface I adjust the texture coordinates, filling in what gets wrapped on the right as it disappears from ...
2
votes
1answer
69 views

Using normals in DirectX 10

I've got a working OBJ loader that loads vertices, indices, texture coordinates, and normals. As of right now it doesn't process texture coordinates or normals but it stores them in arrays and creates ...
1
vote
1answer
295 views

Fog shader camera problem

I have some difficulties with my vertex-fragment fog shader in Unity. I have a good visual result but the problem is that the gradient is based on the camera's position, it moves as the camera moves. ...
0
votes
1answer
98 views

OpenGL: How to improve the performance of rendering context [on hold]

I have written a benchmark program that compares the performance of OpenGL and DirectX libraries. The problem is that OpenGL gets much lower performance than Direct3D. At the end the program generates ...
0
votes
1answer
40 views

Direct3D: should I use MIXED_VERTEXPROCESSING?

Yesterday on Youtube I watched a video tutorial about creating Direct3D stuff. On that tutorial there was a part about VERTEXPROCESSING compatibility with older video cards. The guy said that the ...
0
votes
1answer
79 views

Why do I have to switch T(v) texture coordinates while importing OpenGL to Direct3D?

I am importing my code from OpenGL to Direct3D. My D3DTS_PROJECTION uses D3DXMatrixPerspectiveFovRH, and my D3DTS_VIEW uses D3DXMatrixLookAtRH to set a view equal to OpenGL's view. My question is why ...
0
votes
1answer
52 views

Drawing .mtl files in Directx

So I've created my own obj loader and it loads normal's, UV's, vertices, indices and faces.. but it will only draw the whole obj a single color. I would like my loader to display the model as if it ...
2
votes
0answers
31 views

Load an Image to the BackBuffer

How can I load and display an Image?... I have tried something but it didnt.. worked.. this is what I've tried.. File : StrikeOps_main.cpp .. void : render_frame : Intro::DisplayIntro(d3ddev, ...
0
votes
0answers
139 views

How to make an Game Intro

How do I display my logo (a short video) before displaying the main menu? For example when you start Call of Duty, it displays the IW / 3ARC logo, Activision, and then a cinematic. I just need to ...
0
votes
1answer
91 views

How do I determine the look-at vector of a free-look camera?

I'm trying to create a free-look camera with DirectX 10. I've figured out how to get the directions for forward and back and left to right. However, I don't know how to rotate the look-at vector of ...
0
votes
1answer
100 views

Center directional light shadow to the cameras eye

I'm currently drawing my directional light shadow using this view and projection: XMFLOAT3 dir((float)pitch, (float)yaw, (float)roll); XMFLOAT3 center(0.0f, 0.0f, 0.0f); XMVECTOR lightDir = ...
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 ...
1
vote
1answer
54 views

DirectX Bullet Tracer Effect

I'm wondering if anyone knows some common and efficient ways to do a fast tracer for an instant bullet. I've seen people speak on forums of using primitive lines with DirectX, but I doubt this ...
1
vote
2answers
148 views

How do I handle DirectX mouse events?

I am a beginner making my second game (simple low graphics FPS), in Visual C++ 2010. So far, I only know how to use keyboard controls. I've had source files like keyboard.h and keyboard.ccp, ...
0
votes
2answers
60 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 ...
0
votes
0answers
22 views

merging meshes directx10 [duplicate]

Say I have a line of 10 cubes. Each side has 2 triangles that make up the face of each cube. If I want to reduce the number of triangles being drawn, how can I merge the 20 triangles into just 2 big ...
0
votes
2answers
112 views

Texture coordinates for a 3D box

I have a box model in my DirectX application, stored as 8 vertices: MyVertex vertices[] = { { DirectX::XMFLOAT3( - 1.0f, + 1.0f, - 1.0f ), /*,tex coord...*/}, //0 { DirectX::XMFLOAT3( + ...
2
votes
2answers
129 views

Implementing Geometry Instancing in DirectX

I have a project that I'm doing in Managed DirectX (DX9) where I want to render lots of grass. My current method (many draw calls) is slow, but I've heard Geometry Instancing can fix that. I know ...
0
votes
2answers
33 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 ...
3
votes
2answers
193 views

Is there any reason why there isn't a cross-platform implementation of DirectX?

Similar to how Mono can compile C# to various platforms, why isn't there an API that conforms to DirectX's specifications but can produce binaries for all platforms? I understand that there is OpenGL ...
2
votes
1answer
113 views

HLSL float4 addition returning all 0.0f vector, unexpected result

Edit: Added images at the bottom to show the current issue. I have the following few lines in my hlsl pixel shader where color and specular are both float4. color = color * textureColor; // Add ...
1
vote
1answer
56 views

Which nodes of the Collada DAE are most relevant for game object/character use?

I'm really new to game dev / D3D. And I was looking to choose an intermediary format to work with and convert to my internally used format. Collada DAE seems to be good as it can export animation too ...
0
votes
0answers
12 views

how to attach normals to my mesh in d3d10 [duplicate]

so ive got a working OBJ loader that loads vertices, indices, tex coords, and normals.. as of right now it doesn't process tex coords or normals but it stores them in arrays and creates a valid mesh ...
1
vote
2answers
63 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 ...
-1
votes
1answer
68 views

Should I reuse vertex buffers for multiple draw operations? Would this be more efficient?

I am constructing the game scenario and buttons using Vertex Buffers. I am making a v_buffer for each item, and then releasing them. I don't like my method. Should I reuse my vertex buffer for ...
0
votes
1answer
51 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; ...
2
votes
1answer
40 views

Compare world space distance to shadow map depth

I am rendering shadow maps to cubemaps (just rendering raw depth buffer) then projecting them to the scene to do omni-directional shadow mapping. The cubemap is sampled by the light direction vector ...
2
votes
1answer
96 views

Does Direct3D have hardware-dependant extensions like OpenGL?

I am not familiar with Direct3D and I want to know if it has hardware and vendor dependant functions like the extensions in OpenGL? A program written by a friend fails on certain computers while it ...
2
votes
2answers
1k views

How do I use D3DXVec3Normalize()?

It accepts two parameters, the first is an out parameter - a pointer type, so a referenced variable or a pointer to a variable - the second parameter is an in parameter of the same type but const. ...
0
votes
0answers
51 views

Sorting 3D particles by depth

This is a general particles question, but I use XNA/MonoGame so I looked at: http://xbox.create.msdn.com/en-US/education/catalog/sample/particle_3d for Particles 3D. I found the example not to ...
1
vote
0answers
56 views

Efficient scaling of images for multiple resolutions

I figured that the best way to ship 2D art for multiple resolutions is to instruct my artist to create the fullscreen background images sized for the highest resolution and then scale them down during ...
1
vote
1answer
62 views

Why are there different ways of building projection matrices?

Matrix.PerspectiveFovLH documentation page says that this method uses the following formula to build a perspective projection matrix. [w, 0, 0, 0] [0, h, 0, 0] [0, 0, zFar/(zFar - zNear), 1] [0, 0, ...
0
votes
2answers
73 views

How to draw non-triangulated mesh?

I am working with DirectX (C#/C++). I am wondering is it possible to do not triangulate meshes and what the difference between cases (in loading and rendering code)? If so, how to do this? I know ...
0
votes
1answer
67 views

How can I move the view in a DirectX game?

I'm making a game in C++ using Direct3D 9. How do I move the camera at constant rate? I'm making a Flappy Bird type game and I'd like to move the camera forward through the level.
0
votes
2answers
163 views

How to mix pixel colors in Shader?

I have a pixel that have a colour RGB. This color is calculated by the shader and can be anything. How can I override this color by a colour I choose. If my pixel is white it's simple, I can do this: ...
1
vote
2answers
113 views

Does installing the DirectX SDK add project templates to Visual Studio? [closed]

I have Visual Studio 2013 installed on my machine, and I have installed the latest DirectX SDK, but it doesn't seem to have added any DirectX project templates to VS. Should it have? Or do I need to ...
0
votes
0answers
30 views

Dealing with 2D tiled maps in DirectX

I'm new to DirectX. I'm pretty much to the point to where I can create some sprites and attach textures to them, but I'm not fully cognizant of the entire model of textures and sprites or exactly how ...
1
vote
1answer
97 views

Load texture from different thread

I am trying to load textures from a different thread but it fails everytime on this following method: D3DX10CreateShaderResourceViewFromFile Turning off my multithreaded routines make the textures ...
2
votes
2answers
489 views

Camera frustum calculation coming out wrong

I'm trying to calculate a view/projection/bounding frustum for the 6 directions of a point light and I'm having trouble with the views pointing along the Y axis. Our game uses a right-handed, Y-up ...
1
vote
1answer
74 views

Problem calculating normals for heightmaps

So far I have been using normal avering to calculate the normals for my vertices in my heightmap, with good graphical result (see picture), however it is terribly slow. With a incresing image size the ...