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
0answers
72 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 ...
0
votes
1answer
173 views

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

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
52 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
94 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 ...
2
votes
0answers
70 views

How can I load an image into the back buffer? [closed]

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
150 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 ...
1
vote
1answer
92 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 ...
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
91 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 ...
1
vote
2answers
315 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, ...
3
votes
2answers
226 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 ...
0
votes
2answers
69 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 ...
1
vote
1answer
77 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 ...
2
votes
1answer
142 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 ...
3
votes
1answer
122 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 ...
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
3answers
116 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 ...
0
votes
1answer
76 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
87 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
112 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 ...
0
votes
1answer
67 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 ...
0
votes
0answers
77 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 ...
0
votes
1answer
274 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 ...
2
votes
1answer
163 views

Is there a penalty to using render targets versus textures?

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
137 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, ...
-1
votes
1answer
75 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
130 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.
1
vote
2answers
205 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
52 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 ...
0
votes
2answers
98 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
2answers
222 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( + ...
1
vote
2answers
175 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 ...
1
vote
1answer
51 views

Repeat or wrap texture (DirectX 9)

Sure there's something I'm missing about wrap/repeat textures in D3D 9. I've tried setting the sampler in the shader, i.e. : sampler DiffuseSampler = sampler_state { Texture = ...
1
vote
1answer
203 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 ...
0
votes
1answer
84 views

Tangent plane vectors smoothing with vertex normals [closed]

I'm trying to find a way to smooth out normals obtained from cross product of tangent and bitangent vectors calculated per face basis. I've already asked a similar question on SO, however with no ...
1
vote
1answer
60 views

How can I programatically determine if I can create a hardware D3D device?

I have a D3D 11 application to which I would like to add support for software rendering. This is because in some circumstances it will be run on over remote desktop or on machines without GPUs. From ...
0
votes
1answer
141 views

moving first person camera with the mouse on right click

I am new to game development and I am trying to get the game input working. I have successfully got all the movement keys for walking/running/looking around working; however, I am having a terrible ...
0
votes
1answer
145 views

Rendertarget and alphablending problem (Offscreen particle rendering)

Today, I have implemented soft particles by rendering them to a separate render target and blending that with the scene, which worked as expected with additive blended particles. In that case I render ...
4
votes
2answers
281 views

Is Batching Geometry Every Frame Always Slower Than Individual Draw Calls

I'm currently have an application that has ~10k draw calls. I implemented a batching scheme where I group all objects that share material, vertex format, etc and pre-transform them by their world ...
0
votes
0answers
69 views

Skinning mesh with Hermite Interpolation

I'm trying to implement an skinning mesh and I use Hermite Interpolation for evaulating frame's position. When I use the normal interpolation t*p1 + (1-t)*p2, it run well, but when I change to ...
0
votes
1answer
66 views

Triangular grid and rendering to a texture (Direct3D 11)

Is it possible to render vertex data from a triangular grid into a texture with a same size (i.e. 3x3 vertices to 3x3 pixels - each pixel is representing one vertex)? Consider following situation. I ...
0
votes
2answers
176 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: ...
0
votes
1answer
149 views

When should rendering be performed during a frame?

When working with OpenGL or DirectX, should draw calls be done all at once, at the end of the update loop, or is it better to have draw calls occur during the update loop rather than just at the end?
0
votes
1answer
106 views

How to share matrix in HLSL?

I am trying to share this across multiple effect files: matrix worldMatrix : register(vs_4_0, b0); If I set this from one effect file, will it effect every effect file which has the same type of ...
1
vote
1answer
99 views

Reuse VertexBuffer or new VertexBuffer object?

I'm trying to render bitmap fonts in directX10 at the moment, and I want to do this as efficiently as possible. I'm having a hard time getting a start on my design because of this question though. So ...
9
votes
3answers
689 views

How can I create a glitter effect?

I am trying to create a glittering effect for my realtime shader but I don't know how. Here is one example, and another example. What technique can I use to implement this?
0
votes
1answer
158 views

Rendering Textured Terrain With SharpDX Toolkit [closed]

So i recently moved from XNA to SharpDX Toolkit and started with some basics. The 2d part was easy since nearly nothing has changed but im really struggeling with the 3d part. For example i wanted to ...
0
votes
0answers
40 views

IndexedInstanced logic

I'm using SharpDX.Toolkit with three buffers: two vertex and one index buffer. The first vertex buffer is bound to slot 0 for per-vertex data with following data: static VertexPosition[] vertexData = ...
0
votes
1answer
55 views

DXUT getters are always null using DLL

I'm struggling with a problem for a while and I hope some of you can help me out. The title for this question is vague, so I will try to explain my problem as best as I can! I'm am creating a project ...
0
votes
1answer
78 views

Changing the maxDepth of viewport

Whenever I change the maxDepth of the viewport from 1.0 to say 300.0f (just for kicks), everything on my screen disappears. Why is that? Is there anywhere else I have to account for this change in ...