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
1answer
711 views

DirectX11 Gamma Correction

I am writing a game using SharpDX with DirectX11 and I have been reading that it is important to apply gamma correction to my engine in order to perform correct linear lighting calculations. So I ...
5
votes
2answers
647 views

What range of values can HLSL's tex2D function return?

When using the tex2d function in a HLSL shader, as so: float height = tex2D(heightMap, IN.texCoord).r; What range of values can be returned to the height variable? Is it always a number between ...
2
votes
1answer
84 views

Can I create an offscreen plain surface with a pointer to pre-allocated surface data?

I thought I read somewhere that one could create a 'offscreen plain surface' from an existing system memory buffer, but I cannot seem to find the reference anymore. My use case is copying a frame ...
1
vote
0answers
81 views

3D Model Loading in DirectX 11 [duplicate]

At the moment I am trying to implement fbx model loading in my DirectX 11 code. This is old code I had create for use with DirectX 9 and I'm simply trying to bring it back up to date. Since I first ...
8
votes
1answer
537 views

2D Water top surface profile

I am trying to create the effect of the water surface thickness with a vertex-fragment shader. I am in a 3D game environment but It's a scroll view so a "2D" view. Here is a good tutorial of creating ...
5
votes
2answers
835 views

Is the “impossible object” possible in computer graphics?

This may be a silly question but I want to know the answer to it. I saw this thing called the "impossible object", while they're many different images of this online, it's suppost to be impossible ...
2
votes
2answers
265 views

3D Distortion Effect

I'm trying to make a distortion effect similar to this: However I'm not making a 2d screen space effect. I'm applying it to a 3d scene and I want it to be placed IN the world, so it can be blocked ...
-2
votes
2answers
181 views

Rendering structure [closed]

my question is "What is the best way to structure rendering code". Is it better to make a class with a render function that iterates through all game objects based on there name or type and have no ...
-3
votes
2answers
97 views

Can you use a struct instead of an array to hold vertices in directx?

So instead of using an array to hold vertices information use a struct instead. Is this possible, does the Idirect3dvertexbuffer allow it?
0
votes
1answer
1k views

Why DirectInput is not recommended?

I have read that the Windows messages are recommended way over DirectInput to control mouse and keyboard. From http://msdn.microsoft.com/en-us/library/windows/desktop/ee416842(v=vs.85).aspx The ...
3
votes
2answers
205 views

Extract smaller frustum from camera frustum?

Background: I was thinking of implementing multiselection by performing a frustum culling on a sub-part of the screen. Problem: Given total screensize, a rectangle on the screen (pos, size), and ...
1
vote
1answer
214 views

How should I setup my minecraft-like world rendering for the best performance?

I want to know what technique will give me most fps in game. I have minecraft-like world and I need to display it. Now I have only one cube, created as VBO and if i need to display cube I just display ...
1
vote
0answers
208 views

Why is my XInput gamepad press stamp not working?

I'm trying to add basic gamepad input to my c++ DirectX game but i'm having some trouble creating a press stamp (registers the press only the first time it's pressed if button held down). The entire ...
1
vote
1answer
177 views

Texture Shaders vs. Pixel/Fragment Shaders?

My question is a simple one. Functionally, practically, and performance-wise, what are the differences between using a D3DX Texture Shader, and using a Pixel/Fragment Shader rendered with a full ...
-1
votes
1answer
201 views

Are there any open-source Direct X code-bases that I can look at to learn from as a beginning Direct X and graphics programming student? [closed]

I'm a third-year university student and I've recently begun studying Direct X 11. Mostly I've been following the samples from the SDK and reading a lot out of the MSDN. Although I have a decent ...
1
vote
1answer
59 views

PIX and Metro apps

I would like to use Pix on a Metro (Win 8) app. However, Pix wants the path to the application, something that Metro apps don't have. Has anybody been able to get Pix working with Metro?
6
votes
2answers
1k views

In DirectX 11, batching primitives for performance, how does this actually work?

I don't seem to be able to understand this. Microsoft says that one of the possible optimizations of for a Direct3D 11 if to batch primitives draw calls. For example in order to draw say 300 triangles ...
1
vote
1answer
463 views

Can not enable IME to capture Chinese characters in SharpDX

Just found that direct integration of IME is blocked in Windows 8, moving on to TSF now. By now, there is lack of Microsoft's Document about TSF, this will be hard. I am using SharpDX and the ...
-3
votes
1answer
808 views

Which should I learn: DirectX or XNA? [closed]

I've worked with the Microsoft Foundation Classes(MFC) and now I want to enter the world of game development.But should I start with directX or XNA? I'm hesitant towards DirectX because I feel it ...
0
votes
1answer
238 views

Render just the pixel under mouse cursor in DirectX

I'm having difficulties rendering just a single pixel which is on the defined coords of viewport. I'm using D3DXMatrixPerspectiveOffCenter function, but the result is not what I expected. Here is ...
1
vote
2answers
345 views

DirectX How to Gernerate Vertices for Diamond Shape and Render it?

How to generate vertices for 3D Diamond Shape in DirectX? EDIT: I am creating an application which receive DIAMETER, CROWN, GIRDLE and PAVILION as parameter and render a model of diamond according to ...
3
votes
2answers
106 views

using DirectX to generate a sprite sheet

I am building a site in HTML5 for my client and it must run on the iPad/iPhone (i.e. Safari on iOS). They want a 3D effect where they have a simple, yet, specific product they want to show on the ...
-1
votes
1answer
135 views

simple win32 window wont show [closed]

The program compiles and runs successfully but does not show a window, it simply ends immediately. #include <Windows.h> LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, ...
0
votes
1answer
75 views

Sprite rotation and question about sampler state

I'm not an expert in creating game engines, but I'm doing fine for now. Recently I reached a point that I couldn't solve any of my problems. I have two questions: I'm using ...
-2
votes
1answer
123 views

How to use D3DXIntersectTri function to find intersected point?

How to calculate direction for D3DXIntersectTri function to find intersected point? And after getting the result in Distance how to get that coordinate(XYZ)?
1
vote
1answer
214 views

Passing multiple colors to a pixel shader in DirectX

I have a pixel shader that sets the output color based on the interaction of an input texture, sort of like: if (case1) { output.Color = float4(0, 0, 0, 0); } else if (case2) { output.Color = ...
2
votes
0answers
132 views

Best approach to depth streaming via existing codec [closed]

I'm working on a development system (and game) intended for games set mostly in static third-person views. We produce our scenery by CG and photographic techniques. Our background art is rendered ...
0
votes
1answer
206 views

How do I implement my old OpenGL-based gfx_render_triangle_list using DX11?

I am working at a game that has lots of procedural content. I had built a game engine using OpenGL that handles everything needed for creating a basic 2D game, sprites, primitives, blending, polygons ...
0
votes
1answer
677 views

Latency difference between DirectSound and XAudio2

As far as I understand the WDM, DirectSound drivers cannot be hardware accelerated on Windows Vista and newer. Is XAudio2 affected as well? Or in other terms: in latency terms is it definitely better ...
0
votes
2answers
252 views

D3DXCreateEffect Performance

Current performance analysis shows that D3DXCreateEffect is called many times with different shaders. Between each call, the D3DCompile DLL is being loaded and unloaded. Is there an easy way to keep ...
2
votes
1answer
141 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, ...
-1
votes
1answer
315 views

How to Render Cylinder with built in function D3DXCreateCylinder in Directx9 with Delphi-Xe2 and JEDI? [closed]

I'm new to Directx and i want to render Cylinder using "D3DXCreateCylinder" function. I using Delphi Xe2 and JEDI for DirectX9.
3
votes
1answer
546 views

Rotation matrix from OpenGL to DirectX

I have an application which uses openGL and i have to port it to DirectX. To sum up my issue : How can I port rotation matrix based on a right-handed coordinate system to a left-handed coordinate ...
2
votes
2answers
574 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 ...
0
votes
3answers
693 views

Using DirectX9 within Visual Studio 2012 in Windows 8?

Asking the question here simply because my PC is down for the count for a while and wasn't able to stave a curiosity before that happened. I picked up a few books about programming Games in DirectX, ...
-4
votes
1answer
135 views

My 2d Shader in XNA falls apart the second I put it into Farseer [closed]

I wrote a simple light shader that I tested in a simple 2d spaceship shooter and it worked fine. Once I imported it into my friend's farseer project with rotatable shapes, it doesn't seem to work ...
0
votes
1answer
246 views

How do I create a camera for a strategy game?

How do I make a camera for a strategy game? Think something in the style of Warcraft 3, so you can lower the camera angel and view the world in a somewhat 3D format. Do I need to have some coordinate ...
1
vote
2answers
161 views

One or multiple VertexBuffers

I'm currently working on a personal project where I'm trying to load the levels and all of the geometry from the game "Medal of Honor Allied Assault" into my own C# code-base based on SharpDX. I ...
3
votes
2answers
498 views

Implementing multithreaded loading screens

Ok, I have fairly little multi-threading experience, but i have done a similar thing before without issue...but this has me stumped. This is in C++, Directx9 Visual Studio... My game basically runs ...
3
votes
1answer
301 views

How do I improve terrain rendering batch counts using DirectX?

We have determined that our terrain rendering system needs some work to minimize the number of batches being transferred to the GPU in order to improve performance. I'm looking for suggestions on how ...
2
votes
1answer
166 views

Geometry shaders on Surface RT

Can anyone tell me if geometry shaders are supported on the Microsoft Surface RT? On one hand, MSDN makes it sound like the Surface RT supports only feature level 9_1, and geometry shaders are only ...
1
vote
1answer
629 views

How can I render multiple windows with DirectX 9 in C++?

I'm trying to render multiple windows, using DirectX 9 and swap chains, but even though I create 2 windows, I only see the first one that I've created. My RendererDX9 header is this: #include ...
2
votes
2answers
219 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
428 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
218 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
555 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
425 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
691 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
143 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
433 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 ...