Questions which are specifically related to version 9.0 of DirectX SDK. If your question is not specific to this version of SDK (i.e. it could apply to DirectX 10 and 11 as well), use the 'directx' tag.

learn more… | top users | synonyms (2)

9
votes
3answers
2k views

Pixel-perfect rendering to a rendertarget with a fullscreen quad

I have some trouble rendering a bunch of values to a rendertarget. The values never end up in the exact range I want them to. Basically I use a fullscreen quad and a pixel shader to render to my ...
9
votes
1answer
186 views

Implementing invisible bones

I suddenly have the feeling that I have absolutely no idea how to implement invisible objects/bones. Right now, I use hardware instancing to store the world matrix of every bone in a vertex buffer, ...
8
votes
4answers
1k views

In a 2d tile based game, what is a good method for scrolling?

I am using Direct3D with the D3DXSPRITE wrapper to draw the tiles to the screen. I have a tile class which contains members such as collision and tile type, then i have an array of tiles e.g. Tile ...
7
votes
3answers
1k views

What is a better abstraction layer for D3D9 and OpenGL vertex data management?

My rendering code has always been OpenGL. I now need to support a platform that does not have OpenGL, so I have to add an abstraction layer that wraps OpenGL and Direct3D 9. I will support Direct3D 11 ...
7
votes
3answers
737 views

Isometric smooth fog

I'm working on a simple 2d game with direct3d 9. It's a isometric game with diamond tiles and a staggered map. This is what I have: As you see I have some kind of fog which is acomplished by having ...
6
votes
2answers
2k views

How to implement SSAO in Shader Model 3/ DX9?

Ive read a few articles about SSAO, and i would like to implement it in to 3d engine at work, which runs on top of DX9. Can you give me an tips on getting the simplest implementation possible up and ...
6
votes
2answers
420 views

Fixed Function vs Programmable Pipeline performance with many batches

In OpenGL 2.0 I can easily make 10,000 draw calls per frame (with state changes in between each call). However, if i try to do this in either OpenGL ES 2.0 or DirectX9 with shaders, my peformance is ...
6
votes
1answer
429 views

How do I get FEATURE_LEVEL_9_3 to work with shaders in Direct3D11?

Currently I'm going through some tutorials and learning DX11 on a DX10 machine (though I just ordered a new DX11 compatible computer) by means of setting the D3D_FEATURE_LEVEL_ setting to 10_0 and ...
6
votes
1answer
291 views

Hardcoding C++ shader interop code

When writing code that interacts with multiple shaders, is it best practice to hard code the use of each effect? I wrote a couple of hard-coded loops and then noticed that I accidentally ended the ...
6
votes
1answer
547 views

Partial Shader Signatures HLSL D3D11 C++

I had been debugging a problem I was having in a single shader file with 2 functions in it. I'm using DirectX 11, vs_5_0 and ps_5_0. I have stripped it down to its basic components to understand what ...
6
votes
1answer
436 views

What elements of D3DPRESENT_PARAMETERS MUST be set?

DIRECTX9... For ages, I've shipped games that only half-fill out the D3DPRESENT_PARAMETERS structure, and now I'm wondering if this is buggy. The items I'm worried about, and never set are: ...
5
votes
2answers
904 views

Different number of lights => different shader

I have a shader that computes lighting for each light. PointLight PointLights[10]; uniform const float NumPointLights; for(int i = 0; i < NumPointLights; i++) { lightVec = ...
5
votes
4answers
210 views

Is there any guarantee about the graphical output of different GPUs in DirectX?

Let's say that I run the same game in two different computers with different GPUs. If for example they are both certified for DirectX 10. Is there a guarantee that the output for a given program ...
5
votes
2answers
1k views

How can I render text above a mesh in DirectX 9?

I want to render some text over a mesh in my DirectX app. It will have a similar application to health bars for units in games, just as text rather than a bar. I'm looking for the simplest way to do ...
5
votes
2answers
1k views

3D primitive rendering library

I am looking for a library which would easily allow me to render shapes (cubes, spheres, lines, circles, etc.) in 3D3 and OpenGL if possible. I want to be able to rapidly design visual debugging tools ...
5
votes
1answer
383 views

What does HLSL's tex2D return at (0,0)?

I'm trying to understand the mapping of texels to pixels, especially in the context of pixel shaders. I already found out the following: When I define a standard quad with vertices at integer ...
5
votes
3answers
521 views

DirectX9 thread lock problem with “present” and background loading new textures

Given: Selfmade 3D engine based on DirectX9 written in C++ Task: While render loop runs load additional textures in a background thread Current Implementation: - Create device with ...
5
votes
1answer
882 views

Rendering a Sprite with an Effect… how?

gettings tuck doing some 3d Rendering and I think you guys may have a lot more knowledge in it. I am tasked with basically rendering a texture onto a screen, preparing the way to apply graphical ...
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 ...
4
votes
2answers
4k views

2D graphics with Direct3D

I'm trying to work with 2D graphics using Direct3D 9, but am not sure where to start. Right now I'm using a texture as the "draw buffer", and drawing that texture to screen. For the simplest things, ...
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 ...
4
votes
2answers
188 views

Why am I running out of memory in D3DPOOL_DEFAULT?

When trying to using my company's D3D9 renderer and allocating everything in D3DPOOL_MANAGED I would run out of memory in the 32-bit process space. I tried using our D3D9Ex renderer and allocating in ...
4
votes
4answers
2k views

How to implement transition between screens

Last night I showed my game to my friends and they said it was a bit jumpy. The example he gave was in the pokemon games when a battle starts music plays, the screen flashes then pixels out then the ...
4
votes
2answers
268 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 ...
4
votes
1answer
208 views

Radiosity: Integrating Hemicubes

I'm working on a radiosity processor in DirectX 9. I have efficiently rendered hemicubes from the perspective of texels within a lightmap. Now, as I try to integrate the hemicubes (to sum the incident ...
4
votes
2answers
3k views

Rendering skinned model with DirectX

I'm learning character animation with DirectX 9, and I'm new to 3D programming too. I'm trying to use examples with my model that I'll be working with. They are from the book Character Animation with ...
3
votes
5answers
988 views

How do I convert DirectX's .X from binary encoding to text encoding and back

As far as I know, .X format can be text encoded and binary-encoded. I basically want to look into the model I'm playing with, get a better understanding of .X, possibly make some changes in it and ...
3
votes
1answer
441 views

Vertex Buffer Sharing between DirectX11 and Directx9

In my d3d9 engine i want to take benifit of compute shader of d3d11. So firstly I created a vertex buffer in d3d11 with D3D11_BIND_UNORDERED_ACCESS and then tried to create the d3d9 vertex buffer ...
3
votes
3answers
1k views

How to implement marching cube algorithm for rendering clouds

I would like to render clouds using C#, directX9.0 using Microsoft.DirectX.Direct3D; using Microsoft.DirectX; Now I have roughly add and render the vertex as per below: As you can see, the ...
3
votes
1answer
1k views

Direct3D Error Code 80070057

I'm getting a failure returned when calling Direct3DDevice->CreateDepthStencilSurface(). But rather than returning one of the values that the documentation says it should return (D3DERR_NOTAVAILABLE, ...
3
votes
3answers
627 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
1answer
2k views

Does the latest DirectX SDK support both Direct3D 9.0c and 11?

1) What is the latest version of DirectX SDK? 2) For my purposes I need DirectX 9.0c SDK and DirectX 11 SDK. Do I need to install these libraries separately or last DirectX SDK package contains both ...
3
votes
1answer
636 views

Why do Pool.Default D3D volume textures take memory from my process?

I am working on a Direct3D rendering application that uses a lot of texture RAM. I notice that if I allocate a Pool.Default volume texture: _texture = new VolumeTexture(device, size.Width, ...
3
votes
3answers
1k views

DirectX 9 - model rendering from .obj files issues

Well I can clearly tell that what rendered is close to what I wanted, but there seems to be a few problems. The .obj files contained values like "f", "v", "vt". Image Of Problem: ...
3
votes
2answers
400 views

Clipping a windows draw area - Direct x 9 and c++ - 2D using D3D

DirectX 9, C++... Let me set the scene: I have a 16:9 image. I have a 16:10 screen. I want the 16:9 image to be drawn so that it is vertically centred within my 16:10 screen. My 16:9 image is 1920 x ...
3
votes
2answers
502 views

How to check Early Z efficiency on AMD GPU with Windows 7

I have a game using DirectX 9, and a development station using Win 7 x64. I am still able to get access to another station with Vista x64 / dual booted with WinXP x86. I wanted to check early Z ...
2
votes
2answers
1k views

Rendering with Direct3D

I'm slightly confused about how Direct3D rendering works. Basically, as long as I render to one surface, everything is fine. But when I try rendering to multiple surfaces, it seems like everything is ...
2
votes
3answers
770 views

Rain effect using DirectX 9 capabilities

Is it possible to achieve something similar to nVidia's rain demo using only shader model 3.0 capabilities? If yes, could you point out a few documents/web resources that are suitable candidates and ...
2
votes
2answers
184 views

Direct3D9 depth write without depth test

In OpenGL and Direct3D11 depth write is disabled if depth test is disabled. To enable depth write with out depth test in gl you must enable depth test with depth func always. OpenGL Even if the ...
2
votes
1answer
440 views

D3D9 Effects- variable parameters

I've created some simple Phong shading code from a sample. The issue is that the sample only handles one light. If I wanted a variable number of lights set at the start of each frame, how could I ...
2
votes
1answer
155 views

How should I prepare for migration from D3D9 to D3D10 or D3D11?

I'm considering a Direct3D9 texture streaming solution, but my company will eventually be going to D3D11 in the future. I wanted to make my solution as forward compatible as possible, so I was hoping ...
2
votes
2answers
136 views

Replacing 4 additive sprite layers with a single shader. Just can't get it right

I'm using directx9 and have 4 textures I want to draw on top of each other. if I do this: PDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA); ...
2
votes
1answer
450 views

What are the GPU requirements for XNA 4.0?

I tried to build a sample application using XNA, but I got an error saying that Pixel Shader 1.1 was required, so I got a used Radeon X300 GPU that supports Pixel Shader. I tried to build it again, ...
2
votes
1answer
178 views

How does the Direct3D 9 rasterizer determine triangle coverage?

I'm working on a software rasterizer to use in my project. I have implemented one that works well, however, often my rasterizer under or over estimates triangle coverage. I need perfect emulation of ...
2
votes
1answer
215 views

DirectX11 Swap Chain RGBA vs BGRA Format

I was wondering if anyone could elaborate any further on something that's been bugging me. In DirectX9 the main supported back buffer formats were D3DFMT_X8R8B8G8 and D3DFMT_A8R8G8B8 (Both being BGRA ...
2
votes
2answers
768 views

About Alpha blending sprites in Direct3D9

I have a Direct3D9 application that is rendering ID3DXSprites. The problem I am experiencing is best described in this situation: I have a texture that is totally opaque. On top of it I draw a ...
2
votes
1answer
243 views

UV Atlas Generation and Seam Removal

I'm generating light maps for scene mesh objects using DirectX's UV Atlas Tool( D3DXUVAtlasCreate() ). I've succeeded in generating an atlas, however, when I try to render the mesh object using the ...
2
votes
1answer
769 views

Omni-directional shadow mapping

What is a good/the best way to fill a cube map with depth values that are going to give me the least amount of trouble with floating point imprecision? To get up and running I'm just writing the raw ...
2
votes
1answer
522 views

DX9 sprite / font draw depth order

I need the ability to order the drawing of sprites and fonts. Some sprites need to be drawn behind and some in front of text. My problem is that my sprites and fonts use separate Begin() End() calls ...
2
votes
2answers
245 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 ...