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.
2
votes
1answer
61 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
115 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
95 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
129 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
103 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
14 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
102 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
105 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
90 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
177 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
89 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
76 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
532 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
139 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
260 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
134 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
97 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
311 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
174 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
97 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
75 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
165 views
Sharing the effect
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
125 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
87 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
1answer
179 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 IDirect3DDevice9 instance which produces ...
3
votes
2answers
236 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
1answer
279 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
1answer
49 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
0answers
51 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:
TPlatform::GetInstance()->SetDisplay(width, height, fullScreen, letterbox);
...
5
votes
2answers
246 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
2answers
161 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
1answer
143 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
1answer
78 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
2answers
148 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 ...
1
vote
0answers
207 views
tex2dlod and tex2d giving different values [closed]
I've been having trouble with vertex texture fetch for a terrain system I am implementing. I'm using C++/DirectX9.
I have already implemented exactly what I want as a prototype in C#/XNA and now ...
0
votes
2answers
190 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
1answer
211 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.
0
votes
1answer
181 views
Making a DX9 game resolution independent
How can I change the resolution and stretch my entire game to the new resolution? I want my game to have a base resolution, and when I change it to stretch to that new resolution. I saw a few similar ...
0
votes
2answers
510 views
Using DirectX9 within Visual Studio 2012 in Windows 8?
Asking the question here simply because my PC is down for the count for a while and wasn't able to stave a curiosity before that happened.
I picked up a few books about programming Games in DirectX, ...
0
votes
1answer
111 views
Adding Shader Model 3.0 support to my Direct3D9 app
So far, we've only used pixel shaders because we never needed to do any custom processing at the vertex shader level. However, the 3.0 model shader forces you to define a vertex shader. And that's ...
0
votes
1answer
342 views
How can I render multiple windows with DirectX 9 in C++?
I'm trying to render multiple windows, using DirectX 9 and swap chains, but even though I create 2 windows, I only see the first one that I've created. My RendererDX9 header is this:
#include ...
1
vote
1answer
309 views
2D Matrix Transformation (with a Player and Ground)
I have a simple game that I'm trying to do for learning purposes, but Matrices are a bit hard, especially in DirectX.
I currently have a tilesystem that renders tiles at the screen and a character ...
3
votes
0answers
709 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 ...
1
vote
1answer
1k views
DX11 application running on Windows XP using only DX9?
I'm developing an application that utilizes DX11. I know that DX11 is only available on Windows 7 (and Vista with SP). I wonder if there is some way to run the application on Windows XP and use only ...
1
vote
2answers
99 views
In the Direct3D 9 Effect API, how do you find the texture variable linked to a sampler?
In Direct3D 9 effect files you can write a sampler state that specifies a texture variable to use, like
Texture2D g_texSkyDome;
SamplerState g_samplerSkyDome
{
Texture = <g_texSkyDome>;
...
3
votes
3answers
851 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: ...
7
votes
3answers
602 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 ...
0
votes
0answers
49 views
Source Rects For Rendering 3D Objects
I'm trying to render quads that use spritesheets, however I can't seem to figure out how to get certain parts of a single image. I know the DirectX9 SpriteManager has a srcRect that you pass in when ...
0
votes
2answers
275 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 ...
1
vote
1answer
140 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 ...