Questions tagged [directx9]

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
44 views

How to fx low FPS in a single threaded Directx9 3D game

We're having issues with low FPS in a third-person shooter 3D game. This happens when you have too many polygons on screen. The FPS is locked to 60, and the gameplay is fine, but the moment when you ...
0
votes
1answer
32 views

Directx9 - Generate mesh from vertex and index buffer

I've got a single vertex buffer and an index buffer for a cube in Directx9. I now want to generate a LPD3DXMESH object from them, so that I can manage mouse picking and other stuff with the cube ...
1
vote
0answers
36 views

How do I get the proper swapchain enumeration for getting the backbuffer?

I have code that I'm trying to update from DirectX 8, and so far I have been doing just fine until I reached this line of code: ...
1
vote
1answer
88 views

Which DirectX Version to use for a low poly game?

Which DirectX Version (10, 11 or 12) is recommended to use, if you want to have a low-poly game with shaders, shadow and aliasing. But not normal or height maps. Moreover my question is, because once ...
1
vote
0answers
168 views

Is there a quick-reference card for HLSL (DX9 or DX11)?

Does anyone know of a DX9 or DX11 counterpart to the GLSL quick-reference card from Khronos? The GLSL card is pages 8-11 here, and lists preprocessor directives, operators, types, and builtin ...
0
votes
1answer
62 views

Why does my palette swapping code in D3D9 not have any effect?

I want to do palette swapping in my game, in a fast way and without shaders, so I couldn't replace pixels in a texture, then I tried to use the SetPaletteEntries and SetCurrentTexturePalette method, ...
0
votes
1answer
327 views

Failed LockRect of IDirect3DSurface9

I have hooked Present method of the IDirect3DDevice9 interface, and I want to be able to start video capturing. Taking a screenshoot like this work ...
1
vote
0answers
85 views

dx Shader Model 3.0 break, continue, and loop attributes not recognized

I've been stuck on this problem for just too long. Long story short, the compiler returns "syntax error: unexpected token" for break, continue, [loop], [unroll] and pretty much every other attribute. ...
-1
votes
1answer
471 views

DirectX poor Sprite Performance

I render an animation with 100+ frames. (Direct X9,Sprites / Pngs) I load them all in an array and render them. How i do it: Load all frames in an array of bytes. When i need the frame x, i create ...
1
vote
1answer
117 views

Direct3D - ways to retrieve world position from depth buffer without matrix information

For an existing game (VBS3) I'd like to write a plugin which exports all the rendered pixels with their world position (basically something like a LIDAR point cloud). Actually I don't need the ...
0
votes
1answer
120 views

Unresolved external symbols

I have installed direct SDK and I have visual studio 2010 , I started to write code and compile and when I run I get error of unresolved external symbols or some sort of this , I searched and I found ...
0
votes
1answer
108 views

D3D9CAPS gives unusual maximum shader instructions value

I'm trying to implement a vertex and pixel shader on a piece of hardware we're developing a game for which uses the DirectX 9.0c runtime. The shaders are for boned mesh animation and is a bit more ...
1
vote
1answer
464 views

How to correctly reference a texture bound using SetTexture in Direct3D 9

In Direct3D 9, after assigning a few textures to samplers using SetTexture, what is the correct way to access/create the samplers in the relevant pixel shader? Previously I was creating samplers like ...
0
votes
1answer
174 views

Retrieving DirectX9 Shader Input Parameters (vertex Input Layout)

Is it possible to retrieve the vertex input layout from an effect file in Direct3D9? In Direct3D11 I can achieve this by using ...
0
votes
0answers
244 views

Using DirectWrite to write text on a IDirect3DTexture9

I'm trying to write text using the DirectWrite API on a IDirect3DTexture9. I've heard that people were capable of doing this but I do not see directly how I can glue these two APIs together. It seems ...
0
votes
1answer
52 views

Is the 'partially checked' build sufficient to run the debug version of Direct3D 9?

To run Direct3D 9 in debug, it is necessary to "install a 'checked' version of the OS". The checked version of Windows comes in both full and partial flavors. It seems that the partial version is ...
1
vote
1answer
327 views

texlod() is not supported on ps_4_0_level_9_3 , how can I do a similar operation in this case?

Ihave an interesting problem for you guys I am trying to compile a pixel shader that I ported from GLSL and I am having trouble with a texCUBElod() function that the compiler say's is not supported ...
1
vote
1answer
101 views

Texture with D3DUSAGE_RENDERTARGET failing to release before IDirect3DDevice9::Reset

Creating the texture: ...
0
votes
2answers
435 views

Why is my Direct3D 9 floating point texture clamping values 0–1?

I'm using Direct3D 9 to draw some primitives into a texture. The format used at texture creation is D3DFMT_A16B16G16R16F, and the primitives are drawn using additive blending. The additive blending ...
0
votes
1answer
161 views

Standard unit value for 3d game character height?

Basically I'm building a first person shooter game using DirectX9. And now, I'm working on the modeling side. But before I start modeling, I have to make sure that I create all the models with ...
0
votes
1answer
98 views

Picking a specific point of a map in Direct 3D

I'm trying to pick a specific point on a randomly generated terrain with bunch of tiny triangles. Right now, I'm just iterating through every triangle and picking a intersected triangle using ...
1
vote
1answer
127 views

D3DXLoadSurfaceFromResource failed to load bitmap image

I'm working on a small DX9 game project for learning purpose. I'm current dealing with resources manager file (*.rc) which i'm not used to (Because I have only worked with direct file until now). If I ...
4
votes
0answers
115 views

Flicker when drawing multiple shapes over image based texture

I'm rendering video frames with multiple color filled shapes over it using SharpDx and D3D11. Rendering seems to be fine when just rendering the video frame and is as expected. Now if i draw a ...
0
votes
0answers
121 views

Linear gradient shader ( Photoshop-like)

I'm searching a way to implement a linear gradient shader that behaves as the linear gradient in Photoshop (only the vertical case is necessary). It will be applied to 2D sprites. Currently I'm ...
0
votes
0answers
146 views

Weird Collisions in ODE

I'm trying to get a basic OBB/OBB Collision System working. For this I use ODE. My problem is: Whenever I use the dSpaceCollide and pass in my Space and my ...
0
votes
1answer
434 views

Why when releasing a DirectX Texture it fail

I have an instance where a class creates a DX9 texture via ...
3
votes
1answer
771 views

Converting ARGB surface to NV12 surface

I'm trying to use NVENC to encode some frames that I'm capturing from a game. I've hooked EndScene() and I can get the data from the backbuffer, which is in ARGB format. Unfortunately, NVENC only ...
1
vote
1answer
282 views

How to render IDirect3DSurface9 in my window?

I have some code that captures the screen and save data into a surface. g_pDirect3D_Device->GetFrontBufferData(0, pSurface); All is ok, now I want to display <...
1
vote
0answers
793 views

Loading FBX Files into a DirectX 9 Application

I'm having an extremely difficult time trying to convert an FBX file into a format that can be used with DirectX. I've read a lot of articles on forums all over the internet and have followed ...
1
vote
1answer
436 views

how to render to texture in single mip-level? [D3D9]

I'm trying to implement Hi-Z Screen-Space Cone-Traced Reflections using Direct3D9. I already know how to render to specific mip-level texture using Direct3D11, but not using Direct3D9. Has anyone ...
2
votes
2answers
4k views

Simple 3D OBB-Collision (DirectX9, C++)

I'm trying to implement a simple OBB vs. OBB collision detection! I don't need to know where the collision occures, I only want to know whether a collision occures. The problem is, that after lot of ...
1
vote
1answer
410 views

Texture being stretched when using D3DTADDRESS_CLAMP

I'm trying to create a skybox using a cube and using one of this textures: http://forum.unity3d.com/threads/mundus-skybox-pack-01-released.202748/ I've got it working well, but I noticed there are ...
1
vote
2answers
129 views

Direct3D9: How to switch from one full-screen monitor to another?

I know how to display my game in full-screen on a specific monitor by specifying an adapter number when the D3D device is created. However, I don't know how to switch from one monitor to another ...
4
votes
1answer
680 views

Where do you put the game window in fullscreen mode?

My game, like most games, supports running in fullscreen exclusive mode. And I'd like to give my players the choice of which monitor the game will display on. In order to prevent the player from ...
1
vote
2answers
104 views

Most efficient way to optimize based on gpu type?

So, I'm writing an optimization button that should optimize a game based on the type of hardware the user has. I know I can use d3dadapter_identifier9 to achieve this, but what would be the most ...
0
votes
1answer
725 views

Collisions between mesh (bounding-box) and Vertex/Index Buffer

I have a short Question: I'm trying to add Collisions in my 3D DirectX9 game and my World is Stored in a LPDIRECT3DVERTEXBUFFER9 and ...
8
votes
1answer
2k views

What is the easiest way to Implement a 3rd Person Camera in C++/DirectX9

I'm pretty new to C++ and DirectX9 and I want to Implement a Third Person Camera. After some reading about Quaternion-based Cameras I decided to try Implementing it. But it really blow my mind, so I ...
0
votes
1answer
100 views

Render time only equal half of fps

I'm working on a project that remakes mario 3 (NES). In my game loop, i face a strange thing. Here is my code: ...
1
vote
1answer
56 views

Modifying alpha of pixels in sufrace/texture

I have a texture who's surface I've loaded with an image. Some areas of this image are completely transparent (alpha = 0), some completely opaque, and some are somewhere in the middle. The issue I'm ...
4
votes
0answers
49 views

Combining two surfaces

I have two surfaces. One is the back-buffer, the other is a surface with some user-interface overlay graphics already rendered onto it. Both surfaces have identical properties (size, format...etc). I ...
1
vote
0answers
50 views

DirectX 9 Light projection

I am trying to see changes of component 'z' from light space. In vertex shader component 'z' divide 'w' is not 0. But after sending float4 with texcoord1 to pixel shader its 0. All matrices are good. ...
0
votes
1answer
68 views

3D space indexing for nearest neighbor searching

I am developing a CAD-like application where the user can draw (digitize) new geometries (points, polylines & polygons). While digitizing, I want the user to be able to (optionally) snap the ...
0
votes
1answer
1k views

How to Set HLSL Shader Input Textures?

Very simple question. With C++/Direct9, I'm creating a texture as RenderTarget with a full screen quad, creating a scene, setting a HLSL pixel shader, copying the image and then call Present. 1) How ...
2
votes
1answer
435 views

DX9 How to Apply HLSL Shader with StretchRect

Using DirectX 9,I'm trying to run a HLSL pixel shader on video frame data while copying it from one texture buffer to another texture buffer without displaying it. StretchRect at the end is what ...
1
vote
1answer
127 views

How to Create Device with D3DFMT_A32B32G32R32F

I'm trying to create a DirectX9 device to copy video frame data from one memory buffer to another while processing it through a HLSL shader. I will need half-float or float precision for each channel. ...
1
vote
1answer
454 views

Can DirectX9 be used without HWND handle?

I found an excellent code here that does almost everything I need: running an HLSL shader on memory texture to process video frames into another texture buffer without displaying it. http://www....
1
vote
1answer
2k views

Run Simple HLSL Pixel Shader with DirectX 9

I'm trying to run HLSL Pixel Shaders with DirectX 9 where I feed a texture in, run the HLSL code and copy the resulting texture back from memory. I think I'm getting pretty close, although a LOT of ...
3
votes
0answers
77 views

How can I simulate these two droplet? [duplicate]

Below is a two droplet merging together,in 2d. I want to simulate the behavior when I exert combination force(through mouse or fling force on touch screen) on one ...
1
vote
1answer
103 views

16-byte aligned matrix in DirectX9 and D3DX with Havok Physics 2012

I want to ask a question about D3DXMATRIX and D3DXMATRIXA16, and how to use them with Havok Physics. I'm using Visual Studio ...
-3
votes
1answer
135 views

How to draw a sprite without black transparency key?

I would like some help with the following. At the moment when I draw the sprite I want it to be full black with no transparency, i.e. 255 alpha channel. But what I get is half transparency. How can I ...