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.
229 questions
5
votes
1
answer
1k
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
1
answer
2k
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:
...
1
vote
1
answer
417
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 ...
5
votes
2
answers
4k
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
1
answer
217
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 ...
3
votes
2
answers
3k
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 ...
2
votes
1
answer
1k
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
1
answer
251
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 ...
0
votes
1
answer
215
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
1
answer
195
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 ...
5
votes
2
answers
2k
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 ...
6
votes
2
answers
3k
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
1
answer
3k
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 ...
3
votes
1
answer
1k
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 overestimates triangle coverage. I need perfect emulation of ...
2
votes
1
answer
4k
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 ...
1
vote
0
answers
365
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
2
answers
242
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);
PDevice->SetRenderState(D3DRS_DESTBLEND,...
6
votes
1
answer
3k
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
1
answer
795
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 ...
0
votes
1
answer
157
views
What does this FVF value in the FVFData block of an .X file equate to?
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
2
answers
2k
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
1
answer
2k
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
1
answer
581
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 ...
4
votes
1
answer
3k
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
1
answer
610
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
1
answer
655
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 reference:...
3
votes
3
answers
9k
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 ...
2
votes
2
answers
4k
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
2
answers
7k
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
0
answers
695
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
1
answer
174
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
1
answer
5k
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
2
answers
2k
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
1
answer
885
views
2
votes
2
answers
1k
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
1
answer
257
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 :
...
1
vote
1
answer
503
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
vote
1
answer
504
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, ...
1
vote
1
answer
2k
views
Flip the whole Directx output horizontally (mirror the output)
I would like to flip the whole fullscreen directX output horizontally so that the final output is presented mirror inverted.
Is there a way to create a ...
3
votes
2
answers
1k
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 ...
-1
votes
1
answer
808
views
Changing map 0,0 origin to top left while using D3DXMatrixOrthoLH
Thanks to Tetrad (for pointing out D3DXMatrixOrthoLH ) I have figured out how to set it up in DirectX9. However, the problem I am now facing is my 0,0 mouse position is now in the middle.
What I ...
1
vote
1
answer
437
views
Select display adapter in D3D9
I have a notebook that has 2 graphics card one Intel and one nvidia graphics cards.
When I want to start my game I right click on the exe file and select run with graphics processor->Nvidia but my ...
1
vote
0
answers
186
views
changing resolution in game on Playground SDK
I'm trying to make resolution change in my game based on Playground SDK. Now it looks so:
...
5
votes
3
answers
3k
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 ...
1
vote
2
answers
2k
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 ...
0
votes
1
answer
740
views
How do I make multiple instances of an object?
In a game I am working on, I am having an issue with making the player's ship shoot multiple bullets. The bullets have individual X and Y coordinates and velocity for X and Y. When I press "SPACE" to ...
-2
votes
1
answer
386
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)?
0
votes
2
answers
1k
views
Problem reseting device when using render target
How can I reset the device when I am rendering to a surface, and then stretching that surface to the back buffer. If i don't change the render target everything goes well, but when i change the render ...
0
votes
2
answers
482
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 ...
-1
votes
1
answer
1k
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.