direct3d

Displaying a video in DirectX

What is the best/easiest way to display a video (with sound!) in an application using XAudio2 and Direct3D9/10? At the very least it needs to be able to stream potentially larger videos, and take care of the fact that the windows aspect ratio may differ from the videos (eg by adding letter boxes), although ideally Id like the ability to...

Rendering formatted text in a direct3d application

I need to render some formatted text (colours, different font sizes, underlines, bold, etc) however I'm not sure how to go about doing it. D3DXFont only allows text of a single font/size/weight/colour/etc to be rendered at once, and I cant see a practical way to "combine" multiple calls to ID3DXFont::DrawText to do such things... I look...

How to embed shader information in a .x file

I'm writting a small graphics program using directx9 which imports some model files created using blender from .x files. So far so good. The models have materials which have textures and it's simple to get the texture names and properly render the objects however I'd like to use different effect (shader) files on some of the materials b...

Direct3D9 Rendering a D3DFMT_A8 texture

I have a texture using the D3DFMT_A8 format. I want to render this as if the colour is white (ie the RGB components are all 255) and use the texture data for alpha blending. I would like to do this without having to write a pixel shader if possible (as to work with existing shaders without changes, and also the fixed function pipeline)....

Best way to update a Direct3D Texture

I need to render some CPU generated images in Direct3D 9 and I'm not sure of the best way to get the texture data onto the graphics card as there seems to be a number of approaches. My usage path goes along the following lines each frame Render a bunch of stuff with the textures Update a few parts of the texture (which may have been u...

Detecting full-screen Direct3D applications

Is there any way to detect - through the Direct3D API - Direct3D applications running in full-screen mode? SHQueryUserNotificationState, which can indicate such applications, is only supported on Vista and up. It also only works when the Explorer shell is running. ...

Aspect ratios - how to go about them? (D3D viewport setup)

Allright - seems my question was as cloudy as my head. Lets try again. I have 3 properties while configuring viewports for a D3D device: - The resolution the device is running in (full-screen). - The physical aspect ratio of the monitor (as fraction and float:1, so for ex. 4:3 & 1.33). - The aspect ratio of the source resolution (source...

SlimDX (DirectX10) - How to change a texel in Texture?

Hi, I try to change the texels of a Texture which is already loaded. My assumption was to use the Texture2D::Map and UnMap functions, but there is no change when I change the data of given DataRectangle. I need a simple example like, creating a texture of 128x128 with a gradient from black to white from each side. Thx ps: A Direct3D...

WPF window resizing - no preview / show rubber band

Is there a way to force a WPF window to use a rubber band (no live preview of contents during resize) when resizing? I realize this is usually a user preference on Windows but my application uses D3D windows and there is significant flicker when resizing (particularly from the top left corner outward). -- I should have mentioned I am ...

HLSL Compiler error?

float4x4 matInvViewProj; float4 GetPointPosition(float2 Tex0) { float4 PosImageSpace; PosImageSpace.xy = float2(Tex0*2-1); PosImageSpace.z = tex2D(DepthTextureSampler,Tex0).r; return mul(PosImageSpace,matInvViewProj); } That's a part of my pixelshader. Why is there a compiler error? I'm compiling it in ps_3_0. Without ...

Fastest way to draw an overlay on an image in windows forms

What is the fastest way to draw an on an image in .net? I'm trying to draw an image on top of another image that have in a windows form control. I know that when I try to draw it directly using loops it takes an Eon. Options I have heard tossed around are GDI+, Direct Draw, or DX10. I start with a bitmap of a fixed size and after apply...

What are all the different HLSL sampler types for?

I'm working with DX9/SM3 at the moment, and the MSDN documentation on HLSL samplers seems to be sorely lacking in explaining how to use the different sampler types. What's worse is they try to cover DX9 and DX10 in a single article, so they jumble together all the keywords: sampler Name = SamplerType { Texture = <texture_variable>; [...

Videomemory/DirectX: How to get amount of shared and real memory?

Possible Duplicate: Report Direct3D memory usage I want to know how much video memory a graphic card has. I want to preload textures based on that information. There are many cards which don't have own memory (or very little) and share systems RAM. Those cards sometimes return gigantic numbers (>1GB) but that is misleading becau...

Combining Direct3D, Axis to make multiple IP camera GUI

Right now, what I'm trying to do is to make a new GUI, essentially a software using directX (more exact, direct3D), that display streaming images from Axis IP cameras. For the time being I figured that the flow for the entire program would be like this: 1. Get the Axis program to get streaming images 2. Pass the images to the Direct3D ...

Adjust brightness/contrast/gamma of scene in DirectX?

In a Direct3D application filled with Sprite objects from D3DX, I would like to be able to globally adjust the brightness and contrast. The contrast is important, if at all possible. I've seen this question here about OpenGL: http://stackoverflow.com/questions/139012/tweak-the-brightness-gamma-of-the-whole-scene-in-opengl But that do...

How to Draw Two Detached Rectangles in DirectX using the D3DPT_TRIANGLESTRIP Primitive Type

I am new to DirectX and I am trying to draw two rectangles in one scene using D3DPT_TRIANGLESTRIP. One Rectangle is no problem but two Rectangles is a whole different ball game. Yes i could draw them using four triangles drawn with the D3DPT_TRIANGLELIST primitive type. My curiosity is on the technic involved using D3DPT_TRIANGLESTRIP. P...

Most basic transformed vertex-drawing with Direct3D

I'm absolutely new to DirectX and I'd like to draw some untransformed primitives with the most basic Direct3D configuration (for learning purposes). I already drew some primitives with transformed vertices, that is vertices with the D3DFVF_XYZRHW flag set. Now I'm trying to get the same output with untransformed vertices, but I don't ge...

Recommended books for Direct3D programming

What good books are there for learning 3D graphics programming (DirectX 9) ? I'm also interested in a book about pixel/vertex shaders. I've done some 3D graphics about two years ago using WPF, but I don't think this would help much. I'm pretty good at C++ and optimization (assembler, SSE, metaprogramming), so I don't think this would be ...

Why is duplicate text being rendered onto the Z buffer of a different texture when using D3DXFont::DrawText?

I've been stumbling over this for a while and was wondering if anyone has run into this problem before. The application I'm working on is divided into multiple data plots and a single timeline at the bottom of the screen. Each plot (which is actually multiple textures layered on top of each other) as well as the timeline is rendered to...

Does WPF rely on Direct3D calls even for standard controls?

As a follow up tho this and this other question, I am now trying to understand (out of curiosity) if WPF totally/mostly relies on Direct3D calls (and not 2D DirectDraw ones) even for standard controls, such as buttons or even the container window itself. Wikipedia states: All graphics, including desktop items like windows, are based...