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
125 views

Do shader program compilers optimise divide-by-PoT-constants to bitshift operations?

So just to restate that, let's say we have this: float f = g / 2; Given the divisor is a constant, will the shader compiler auto-optimise this to a bitshift operation, as some language compilers are ...
3
votes
1answer
707 views

Spherical to Cartesian Coordinates

Well I'm reading the Frank's Luna DirectX10 book and, while I'm trying to understand the first demo, I found something that's not very clear at least for me. In the updateScene method, when I press A, ...
0
votes
2answers
363 views

How can I capture every frame in DirectX 9 using a shader

This is actually a follow up to this question How to capture the screen in DirectX 9 to a raw bitmap in memory without using D3DXSaveSurfaceToFile The proponent of the best solution suggested that I ...
4
votes
1answer
2k views

In HLSL pixel shader , why is SV_POSITION different to other semantics?

In my HLSL pixel shader, SV_POSITION seems to have different values to any other semantic I use. I don't understand why this is. Can you please explain it? For example, I am using a triangle with the ...
5
votes
1answer
510 views

Zooming into Mouse Position

I'm trying to implement my camera class for a simulation. But I cant figure out how to zoom into my world based on the mouse position. I mean the object under the mouse cursor should remain at the ...
1
vote
1answer
161 views

Direct3d - Code structure

I'm learning directx in a master's degree and they taught us to have a GraphicsLayer class which is the one connecting with the direct3d library. That way this class is completly independent from the ...
1
vote
1answer
163 views

How can I efficiently render a very large model?

I have a huge model I want to draw in my XNA application; due to its size I am experiencing a tremendous loss of performance. The model has about 50,000,000 edges and has a size on disk of 205 MB in ...
3
votes
1answer
499 views

Where is the Shader Designer in Visual Studio?

I have Visual Studio 2012 Ultimate and I've been trying to access the Shader Designer. I searched through MSDN's text and Channel9's videos, but they keep failing to mention how to access it. Can ...
7
votes
3answers
9k views

Does Windows 8 still support DirectX 9?

Is Windows 8 supporting DirectX 9? Because I was looking through some samples written in C++ and DirectX 9 made for Windows 8. It wasn't that, like I know it ( look here ...
-2
votes
1answer
296 views

Confusing Callbacks

I'm trying to programm now a "game", and started with the EmptyProject that's provided by the DirectX SDK. The problem is that the Callbacks are confusing me. Can please someone explain me? Edit: ...
1
vote
2answers
808 views

Optimal way to learn DirectX? [closed]

I am finding it very difficult to learn DirectX 11. The MSDN website is just full of unorganized information that doesn't seem to help at all. I am particularly looking for something that explains ...
2
votes
1answer
132 views

DirectX 9.0c Lights?

I'm still learning DirectX from a book. It says that a graphiccards can only handle 15 lights. I'm just a bit confused , there are a lot of games using more lights, or are this just some alpha ...
-1
votes
2answers
778 views

Game Engine Design

Is there any guide how to or better what a good Game Engine ( for DirectX ) must contain? I've been reading certain books, but I want to get sure. My own Engine ( called KaDI ) contains: ...
1
vote
1answer
100 views

Task Core dividing

How can I divide the tasks for diffrent cores? E.g. 4 Cores func1() -> core1 func2() -> core2 func3() -> core3 func4() -> core4 Is there special libary for this? Or do I have to use the old ...
2
votes
4answers
808 views

Do games use threads?

I 'understand' that the concept of how a game runs i.e while (game_loop = true) { //handle events // input/output/sound etc } But it has come to my attention while programming in another ...
0
votes
1answer
193 views

Player Movement DirectX

I'm reading on a Book that's about Gamedevelopment with C++ and DirectX 9. There is something that interrests me: It says that playermovements are increasing with the power of the CPU. Becouse a ...
1
vote
1answer
111 views

Consistency of DirectX models

Is there a way to check the consistency of a DirectX model (.x) ? Whilst compiling .x files with XNA GameStudio 3.1 compilation is aborted with the following error message: Error 2 Could not read ...
4
votes
3answers
3k views

How to capture the screen in DirectX 9 to a raw bitmap in memory without using D3DXSaveSurfaceToFile

I know that in OpenGL I can do something like this glReadBuffer( GL_FRONT ); glReadPixels( 0, 0, _width, _height, GL_RGB, GL_UNSIGNED_BYTE, _buffer ); And its pretty fast, I get the raw bitmap in ...
5
votes
3answers
206 views

Depth is disabled - How to turn on?

In XNA 3.1 is there any other way to disable depth in 3D Worlds using DirectX models other than GraphicsDevice.RenderState.DepthBufferEnable = false; ? The reason for my question is I have quite a ...
2
votes
1answer
538 views

SharpDx: using maximized RenderForm

I'm trying to learn DirectX via SharpDX, very new to this. What I want to do is be able to draw 2D shapes for a game I'm trying to make. So I started with the demo "MiniRect" that came with SharpDX. ...
2
votes
4answers
2k views

DirectX 11 Constant Buffers vs Effect Framework

I'm having some trouble understanding the differences between using constant buffers or using the effect framework of DirectX11 for updating shader constants. From what I understand they both do ...
0
votes
3answers
437 views

How do I switch from XNA to C++? [closed]

So, I heard somewhere that Microsoft intends to phase out XNA in favour of using the DirectX method. I've always wanted to learn, but all I ever did in XNA was simple 2D games. I was wondering if ...
12
votes
2answers
424 views

Best practice for setting Effect parameters in XNA

I want to ask if there is a best practice for setting Effect parameters in XNA. Or in other words, what exactly happens when I call pass.Apply(). I can imagine multiple scenarios: Each time Apply is ...
4
votes
4answers
487 views

Game programming and quantity of timers

I've made a simple 2D game engine using C# and DirectX and it's fully functional for the demo I made to test it. I have a Timer object that uses QueryPerformanceCounter and I don't know what's the ...
-1
votes
1answer
165 views

Rendering projectiles [closed]

I'm working on a simple game that has the user control a space ship that shoots small circular projectiles. However, I'm not sure how to render these. Right now I know how to make a LPDIREC3DSURFACE ...
17
votes
3answers
2k views

What's the difference between mesh and a model?

Which one is created first? For example if a team worked on a graphical asset of a car, what would be a model and what would be a mesh of the car?
10
votes
1answer
970 views

Information about rendering, batches, the graphical card, performance etc. + XNA?

I know the title is a bit vague but it's hard to describe what I'm really looking for, but here goes. When it comes to CPU rendering, performance is mostly easy to estimate and straightforward, but ...
3
votes
3answers
624 views

CreateRenderTarget returns 0x80070057 in big surface resolution

I have created the SLI merged desktop of three 1920x1680 monitors, so the desktop resolution is 5760x1080. There is a 0x80070057 error, while calling CreateRenderTarget to create the RT_Surface: ...
3
votes
2answers
2k views

Pix for visual studio express 2012 (Desktop)

(Originally asked on stackoverflow) Using visual c++ express 2010 for direct3d you have to download the directX sdk and there is a tool called pix for debugging shaders, looking at 3d resources etc. ...
0
votes
1answer
288 views

Possible / How to render to multiple back buffers, using one as a shader resource when rendering to the other, and vice versa?

I'm making a game in Direct3D10. For several of my rendering passes, I need to change the behavior of the pass depending on what is already rendered on the back buffer. (For example, I'd like to do ...
3
votes
1answer
354 views

D3DXMatrixDecompose gives different quaternion than D3DXQuaternionRotationMatrix

In trying to solve this problem, I tracked down the problem to the conversion of the rotation matrix to quaternion. In particular, consider the following matrix: -0.02099178 0.9997436 -0.008475631 0 ...
3
votes
2answers
306 views

Having the same texture data in different ID3D11Texture2D

Sorry if this has been answered elsewhere - I'm rather new to DX. My question concerns conservation of resources - specifically textures in VRAM. I assume that upon returning from a call to ...
2
votes
1answer
180 views

Problem with D3DXMatrixReflect

Currently I am trying to reflect a sky sphere into a flat piece of geometry which is acting as water. The sphere is very small, it follows the camera on all 3 axis and the z-buffer is turned off so it ...
1
vote
0answers
338 views

Managing many draw calls for dynamic objects

We are developing a game (cross-platform) using Irrlicht. The game has many (around 200 - 500) dynamic objects flying around during the game. Most of these objects are static mesh and build from 20 - ...
10
votes
6answers
21k views

Visual Studio 2012 and Game Development [closed]

Alright, I think it's a simple question, but I got difficulties to find some answers around. I already read that XNA wouldn't be in Visual Studio 2012. I recently learned to use XNA, but since I ...
1
vote
1answer
472 views

ERROR #342: DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND

I've stared at this for at least half an hour now and I cannot figure out what directx is complaining about. I know this error normally means you put float3 instead of a float4 or something like ...
2
votes
1answer
270 views

Regarding cel-shading of existing games

Is it possible to cel-shade existing games through API interception? I would assume yes. If done properly, could cel-shading be used as a rendering optimization technique? This means, rather than ...
3
votes
2answers
330 views

How to reconcile depth ordering with minimal shader context changes?

We generally want to minimise shader-program switches (glUseProgram and all associated context changes) for the sake of performance. AFAIK it is not uncommon to render by shader program, i.e. group ...
-1
votes
1answer
140 views

DirectX UV Coordinates not responding?

My UV coordinates never respond to me for some reason. It is just UV mapping itself in the smallest way possible. It's a tile-able texture and the program is subdividing so much I can't even zoom in ...
0
votes
2answers
1k views

OpenGL matrix vs DirectX matrix

I'm working on an animation and model exporter from Maya to use within my game. Currently, models work perfectly, and animations have some issues with the joints. Since Maya works in an OpenGL ...
-1
votes
1answer
176 views

Desktop twist, does anyone know how to implement this effect in DirectX?

http://my.tv.sohu.com/u/vw/26933139 I didn't know what the exactly name for this effect, so I just paste the link of the video here, I want to know what is the knowledge background needed if I want ...
1
vote
2answers
233 views

How does my program know which variables to link to the shader?

I am using DirectX and C++. I never understood how my VertexDeclaration knew what variables were the UV map and which were linked to the position. I have in my shader Position : POSITION and Texture : ...
2
votes
1answer
740 views

Multi-textured Terrain?

How would I accomplish multi-textured terrain? I need to know how to write the HLSL shader for it. The world already UV maps itself and I can get it to do 1 texture at a time. But I want more than 1 ...
1
vote
1answer
310 views

Highlight edge on 3d cube in directx

I want to make a 3d editor in DX9/XNA for a project I'm working on. I'm just thinking through how I would go about certain tasks and I'm stuck on one particular thing, which is crucial to making the ...
0
votes
1answer
146 views

How would I write a shader that supports 2 different texture coordinates?

Hi I am not very good with writing shaders. How would I make a shader that simply supports 2 texture coordinates so I can load up 2 different textures to be used at the same time but on different ...
1
vote
1answer
332 views

How would I get this to UV map correctly?

Alright so I have my code to draw out a big landscape using C++ and DirectX. I had it textured with one texture and then needed to add more. I saw people doing it where they had 1 texture image and ...
0
votes
1answer
344 views

XNA Multisampling only for 3D

I am working on a game which consists of 3D elements and a 2D GUI. I have it working properly, but I want to enable multisampling for only the 3D parts, and not the 2D Textures. Otherwise, the GUI ...
4
votes
1answer
517 views

Simplex Noise flat land and hills

I'm using the simplex noise to create Minecraft like terrain. I can only achieve hills like this. Does anyone know how to use simplex to make more dynamic landscapes?
0
votes
1answer
413 views

Taking MSAA screenshot using D3DX10SaveTextureToFile()

I have some screenshot code (pasted below) which was working fine until I enabled MSAA. The first time I tried to use this code, it complained that the texture I'm creating needed to match the sample ...
1
vote
2answers
2k views

Sharing a texture resource from DX11 to DX9 to WPF, need to wait for DeviceContext.Flush() to finish

I'm following these instructions on TheCodeProject for rendering from DirectX to WPF using D3DImage. The trouble is that now that I have no swap chain to call Present() on -- which according to the ...