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)

0
votes
0answers
10 views

beginner's ID3DXFont problem [closed]

In Direct X. Is there a rule that says I can't use more than one ID3DXFont per window or per application instance? There is an exception thrown at a method called getAppInst() which returns HINSTANCE ...
0
votes
1answer
77 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 ...
0
votes
0answers
14 views

SlimDX and Parsing .X Files

I'm trying to parse a .x file using SlimDX. I can create the XFile object and register templates but I'm having problems with the enumeration object. The enumeration object has a child count of 0 for ...
1
vote
1answer
35 views

Do I need to call Release() on D3D objects when I use them in another function?

For example, I have an IDirect3DSurface9 * Surface and IDirect3DSurface9 *BackBuffer. If I were to use them directly in the render_frame function, I would need to release them on the closeD3D ...
2
votes
0answers
30 views

Load an Image to the BackBuffer

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

How do I handle window resizing in SlimDX?

I'm considering the use of SlimDX in a managed Windows Forms Application. Available with DirectX is DXUT. I use DXUT to handle events such as window resizing and 'lost devices.' How well does SlimDX ...
1
vote
0answers
38 views

Why am I getting the wrong color with alpha blend enabled?

I can't understand the result about drawing a line. I've set source and destination blending to D3DBLEND_SRCCOLOR, but I get a black starting color from my source. What's wrong? ...
0
votes
2answers
71 views

How to draw multiple shapes in one draw call?

I have a misunderstanding about vertex buffers in DirectX. I'm trying to draw infinite vertices that they may represent a line or a circle or a rectangle in a single draw call. I can bind them all ...
4
votes
1answer
167 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 ...
0
votes
1answer
90 views

Converting Projected Vertex Positions to Normalized Device Coordinates

I'm using directx 9 and vertex shaders to rasterize triangles...I have vertex shader input structs like this: struct VS_INPUT_Quad { float4 Position : POSITION; float2 UV : TEXCOORD0; }; and ...
0
votes
0answers
20 views

D3D9: StretchRect() between multisampled surfaces/depth buffers

The D3D9 docs only state that StretchRect() can be used to downsample a multisampled render target. It's not clear on what happens if both involved surfaces are multisampled. In particular, I wonder ...
0
votes
0answers
12 views

Writing 2 instanced models into a 2x wide RenderTarget as a form of MRT: disadvantages?

Our graphics engine uses forward pipeline. The final data is being written into a R8G8B8A8 target (no HDR) and prost-processed afterwards. Alpha channel contains the power of bloom for the current ...
1
vote
1answer
47 views

SetFloat() in HLSL shader (effect) has no effect - variables stay at 0

I have a problem wherein I'm trying to set two simple float variables in my shader. I have a dozen other shaders in this project where it works fine, but for some reason, I've got a bug in this one ...
4
votes
2answers
212 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 ...
1
vote
0answers
27 views

WDDM Managing Memory in D3DPOOL_DEFAULT

In this question I saw that I was running out of memory in D3DPOOL_DEFAULT in DX9EX. After changing my usage from D3DUSAGE_DYNAMIC to 0 (static usage), everything runs wonderfully with no DX9 error. ...
2
votes
2answers
126 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 ...
0
votes
0answers
57 views

DirectX 9 Blank Screen after Window Loses Focus

I have an application that uses DirectX9. I have 2 viewports( device swapchains ) to which I render geometry. If, during runtime, I click on a different application's window and then later try to ...
2
votes
1answer
98 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 ...
1
vote
1answer
38 views

Is there a way to limit the size of the D3DPOOL_MANAGED pool?

I have over 2GB of textures that I need to put in D3D9's D3DPOOL_MANAGED pool. D3D9 charges the system copy of anything in the D3DPOOL_MANAGED to my process space. I'm working on a 32-bit system so I ...
0
votes
1answer
65 views

Why would I lose the D3D device during an HLSL unroll?

I have a pixel shader that downsamples a texture from one size to another. The downsample shader uses a nested 'for' loop to traverse the uv coordinates. When the for loop executes more than four ...
1
vote
1answer
39 views

Can I Use SetLOD with D3D9Ex?

I need to limit the mipmap level loaded onto the device for certain textures, but I'm using a D3D9Ex-based engine, so I can only use D3DPOOL_DEFAULT, not D3DPOOL_MANAGED. Microsoft's documentation ...
0
votes
0answers
53 views

Questions about alpha blending

Consider the following code: Device->SetRenderState(D3DRS_ALPHABLENDENABLE, true); //Open alpha blending Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); //Source factor ...
4
votes
2answers
130 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 ...
6
votes
2answers
258 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 ...
2
votes
1answer
224 views

How to create texture using raw RGBA texture data without having to use LockRect

I was previously uploading textures to DirectX by creating texture in D3DPOOL_MANAGED and then calling LockRect to upload the texture data to DirectX. However, I have switched to using DirectX9 Ex, ...
2
votes
1answer
141 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
151 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 ...
0
votes
0answers
135 views

Radiosity using a hemisphere

I'm working on a radiosity processor. I'm projecting scene geometry onto a hemisphere at a high order of tessellation during a visibility pass onto a 1024x1024 render target. The problem is that the ...
2
votes
2answers
121 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); ...
5
votes
1answer
273 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 ...
0
votes
1answer
157 views

Why can a certain DirectX mode produce display lag?

I have written two small test games using DirectX 9. One uses presentParams.Windowed = false; presentParams.PresentationInterval = D3DPRESENT_INTERVAL_ONE; and the other one uses ...
0
votes
0answers
25 views

DirectX FVFData tags in X Files

I'm trying to read and ultimately write a mesh from/to file. This mesh has 2 sets of texture coordinates. The second set I know are held within the FVFData{} block of the .x file. The second set of ...
2
votes
1answer
196 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 ...
1
vote
1answer
282 views

Light Map Generation using DirectX

I'm trying to build lightmaps for an engine I'm working on. I'm using DirectX 9 w/c++ but my questions are related to the methodology behing the generation of light maps. I have a scene built from ...
1
vote
1answer
123 views

Efficient way to draw multiple separated quads

Let's assume I want to draw several separated (possibly textured) quads in Direct3D 9, each consisting of two triangles: How should I draw these for maximum performance, i.e. which of the following ...
3
votes
1answer
343 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 ...
1
vote
1answer
154 views

How to set a global alpha-blending value in Direct3D 9?

Is it possible to set an alpha value globally in Direct3D 9, which modulates the pixel alpha values of every subsequent draw? I would like to let a whole scene fade in/out. I know that for example ...
1
vote
1answer
108 views

Whats the point of this LPDIRECT3DDEVICE9 reference?

I'm going through the DirectX 9 MSDN documentation Which lead me to something rather peculiar, do you need a class reference in DirectX 9? Can someone tell me what the point of the class ...
3
votes
3answers
904 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 ...
1
vote
2answers
268 views

how to set image resource path for D3DXCreateTextureFromFileEx method?

I try to merge all the image resources to a folder called resource. So, set image path as "resource/" but my directX framework only works if I compile at VS 2010. If I run from the debug folder it ...
0
votes
2answers
540 views

FPS limit function

I try to cap the animation at 30 fps. So I design the functions below to achieve the goal. Unfortunately, the animation doesn't behave as fast as no condition checking for setFPSLimit() function when ...
1
vote
0answers
212 views

2D Camera transformation sidescroller

i am currently trying to dive into 2D programming with DirectX, especially bulding a tile based sidescroller. I have worked with some chapters from a book (Advanced 2D Game Development) but always ...
-3
votes
1answer
111 views

Undefined fireball movement behavior

Demonstration video I try to do after the player shoot 10 times of fireball, then delete all the fireball objects and recreate a 10 new set of fireball objects. I did it but there is a weird bug ...
1
vote
1answer
610 views

How to set orthgraphic matrix for a 2d camera with zooming?

I'm using ID3DXSprite to draw my sprites and haven't set any kind of camera projection matrix. How to setup an orthographic projection matrix for camera in DirectX which it would be able to support ...
1
vote
2answers
356 views

How to blend the sprite into background?

I try to blend the character into game but I still cannot remove the blue color in the sprite sheet and discover that the white area of sprite is semi-transparent. Before that, the color ...
1
vote
1answer
156 views

How can I compile SM 3.0 effects in D3D11 in SlimDX?

var bytecode = ShaderBytecode.CompileFromFile("shaders\\testShader.fx", "fx_5_0", ShaderFlags.None, SlimDX.D3DCompiler.EffectFlags.None, null, null, out str); var effect = new ...
2
votes
2answers
136 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 ...
1
vote
1answer
206 views

Sharing the effect [closed]

my problem is : If I load 2 models ( the same model zombie ) and give them the same effect I got the following error : for(int i =0 ; i<2 ; i++) { dwarfModel[i].model ...
1
vote
1answer
150 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 ...
0
votes
1answer
104 views

Are there alternatives to Vertex Tweening?

Now that I'm getting into animating 3D entities in my game, I was wondering what the best approach for this would be. I did some research and came across something called "Vertex Tweening". However, ...