direct3d9

Can StretchRect be used with DF24 or INTZ surfaces? Can DF24 or INTZ be multisampled?

Can you StretchRect from a DF24 into another DF24 (ATI specific)? Can you StretchRect from a INTZ into another INTZ (nVidia specific)? Can you create DF24 or INTZ as multisampled surfaces? ...

Compiling DX 9.0c app against March09SDK => Cannot run with older DX 9.0c DLLs => Problem :)

I'm unable to do a scenario from subject. I have DirectX 9 March 2009 SDK installed, which is 9, "sub"-version c, but "sub-sub"-version is 41, so libs (d3dx9.lib d3d9.lib) are linking exports to dxd3d_41.dll. What happens when I try to run my app on machine which has DX9.0c but not redistributable from march 2009 is now obvious :), it ...

Direct3D Texture Post-Processing/Copying

So I'm trying to implement some Direct3D post-processing, and I'm having issues rendering to textures. Basically, my program looks like this: // Render scene to "scene_texture" (an HDR texture)... ... device->SetRenderTarget(0, brightpass_surface); device->SetTexture(0, scene_texture); // Render "scene_texture" to "brightpass_texture...

Drawing targetting circle in 3d application

I'm working on a 3d game just for learning. I have a 3d world generated from a heightmap and various mesh based objects overlayed onto that world. I want the player to be able to target objects in the world which I can do, but I want to draw a targetting circle on the terrain or object that the targetted thing is standing on. If you've...

Unable to use SetTransform in D3D9

What might stop IDirect3DDevice9::SetTransform from working? I've looked at alot of tutorials for using transformation matrices in Direct3D9, including this one here. And as far as I can tell, they all do it the same way. I'm trying to write some code just to translate a texured polygon. I call SetTransform with a matrix initialized wit...

Bad behavior with Aero off in Vista

I have a directx9 application, which needs to run on a machine with Aero disabled. The app runs in windowed mode. When the window is first created, it looks just fine within a single screen. When I move the window in such a way that it spans two screens attached to the same graphics adapter (and GPU) the region on one screen seems to mir...

How to render formatted text in Direct3D9?

I'm writing an application which needs to draw a lot of text - several lines, maybe tens of lines - in Direct3D9. The text can be heavily formatted (i.e. different typefaces, styles, sizes) and can contain unicode symbols from different charsets. Worst of all, it can change on the fly, so it needs to be dynamic (render once display alway...

Enable AntiAliasing in Direct3D9 (MultiSample Render Target)

I am trying to enable AA in a D3D9 application, but am not sure how to set up the surfaces correctly. So far, I have: IDirect3DDevice9* m_pd3dDevice; IDirect3DSurface9* screen; IDirect3DSurface9* msaasurf; D3DPRESENT_PARAMETERS m_presentationParameters; Initialization: m_presentationParameters.Windowed = TRUE; m_presentationParameter...

HLSL and ID3DXFont/ID3DXSprite

I've started at the beginning, and my code will capably display the grand total of some text. I've been adding support for sprites. The trouble that I've run in to, is that it doesn't seem to recognize my HLSL. I set the technique, began it, began the pass, drew the sprites, flushed them, ended the pass, the technique. And D3D comes up w...

Cooresponding CopyResource method in D3D9

Hi, guys, I know it's easy to copy vertex/index buffer in D3D10 with IDirect3D10::CopyResource(...) interface. How to do the same work in D3D9? Is there any similar API for this? ...

HLSL - How can I set sampler Min/Mag/Mip filters to disable all filtering/anti-aliasing?

I have a tex2D sampler I want to only return precisely those colours that are present on my texture. I am using Shader Model 3, so cannot use load. In the event of a texel overlapping multiple colours, I want it to pick one and have the whole texel be that colour. I think to do this I want to disable mipmapping, or at least trilinear...

What are possible causes of IDirect3DVertexBuffer9::Lock failing?

In error reports from some I have quite often seen following behaviour: IDirect3DVertexBuffer9::Lock fails, returned error code is D3DERR_NOTAVAILABLE. Once this happens, quite frequently (but not always) it is followed by CreateTexture or CreateVertexBuffer failing with error D3DERR_OUTOFVIDEOMEMORY. What are possible reasons for vert...

Boggling Direct3D9 dynamic vertex buffer Lock crash/post-lock failure on Intel GMA X3100.

Hi, For starters I'm a fairly seasoned graphics programmer but as wel all know, everyone makes mistakes. Unfortunately the codebase is a bit too large to start throwing sensible snippets here and re-creating the whole situation in an isolated CPP/codebase is too tall an order -- for which I am sorry, do not have the time. I'll do my bes...

Clipplanes, vertex shaders and hardware vertex processing in Direct3D 9

Hi, I have an issue with clipplanes in my application that I can reproduce in a sample from DirectX SDK (February 2010). I added a clipplane to the HLSLwithoutEffects sample: ... D3DXPLANE g_Plane( 0.0f, 1.0f, 0.0f, 0.0f ); ... void SetupClipPlane(const D3DXMATRIXA16 & view, const D3DXMATRIXA16 & proj) { D3DXMATRIXA16 m = view...

Direct3D9 - is an address of system memory surface changeable?

I have a source code (which is not written by myself) that assumes an address of a D3D9 surface, which is created in system memory, will never change. In short, the code is like this; // the following code runs only once in initialization phase system_surface->LockRect(&lockinfo, blah blah..); void *pSurface = lockinfo.pBits; UnlockRec...

DirectX depth buffering not working

Hey, For some strange reason my depth buffer is not working, i.e. the triangles drawn later always overlap, regardless of their position. I have these presenter parameters D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = mWindow; d3...

Does Direct3D9 support quad primitives or not?

I read in the Direct3D9 help (emphasis mine) : Direct3D 9 supports points, lines, triangles, and grid primitives. These have been extended to support higher-order interpolation beyond linear. While triangles and lines have spatial extent, until now they were both rendered using linear interpolation. In Direct3D 9, Direct3D supports r...

Drawing sprites on D3D device

I have a hooked DirectX used in C++ code that draws text and sprite. I tested it and it drew well onto 2D application. However, when I tried it with 3D application (some complex game actually), only text was visible. From that I deduced the sprite is not being overdrawn by something else, hence the text would be too. I set flags Set...

Release Direct3D resources left behind by forcefully terminated application

I'm working on a Direct3D application and I sometimes need to terminate the application forcefully via the debugger. After the application has been terminated in this way a couple of times, Direct3D reports an "Out of video memory" error when attempting to create a new device. Presently I am working around this by switching my display re...

Does someone know of some fixed pipeline shader tutorial or samples?

I am making a game with 3d gamestudio a8 free edition. The free edition doesn't support shader, it only supports fixed pipeline shaders. There are some samples in the wiki of 3d gamestudio (click here) but I want to know of there are more samples or tutorials. ...