direct3d

How to draw vertices in a vertex buffer in another color

谁都会走 提交于 2019-12-24 14:00:24
问题 I'm using Direct3D 9 to draw lines. The vertices I am using now have the format D3DFVF_XYZ|D3DFVF_DIFFUSE and are stored in a vertex buffer. They are drawn with DrawPrimitive as D3DPT_LINELIST . How do I change the drawn color of a the whole drawn vertex buffer or even a specific vertex without locking the vertex buffer to modify it's content? This has to be done every frame. Is this possible with a vertex buffer? I would prefer a solution without a custom shader (using the default direct3d 9

Direct3d/C# - Blur area under a rectangle drawn on a sprite

女生的网名这么多〃 提交于 2019-12-24 08:09:43
问题 Any idea how to do it? I am drawing a rectangle that is supposed to be a half-transparent window. I managed to do the transparency by drawing a half-transparent texture, but I also want to blur whatever is under the window. Normally (eg. using GDI) I would create a bitmap of the area, blur it and paint it as the background of my window. With Direct3D I don't even know how to get the area with whatever is already rendered on it. Or even there can be a different approach, can't it. Please help.

DirectX capabilities on different graphics cards

大城市里の小女人 提交于 2019-12-24 07:59:05
问题 I'm writing a Direct3D application, using DirectX 9. Although it works on my PC, I need to make it work on a wide range of systems. I need to know what capabilities I can expect to see on other systems. Is there a list of the DirectX capabilities that graphics cards support? I've found one site, which I'll post as an answer, but it's a bit out of date. Edit #1: Of course I will test for all the capabilities before I use them. But there are two different approaches to a missing capability:

AcquireNextFrame not working (Desktop Duplication API & D3D11)

大兔子大兔子 提交于 2019-12-24 02:15:10
问题 I've put together this code that takes a screenshot of the desktop and maps it for raw pixel data access, but the output is all zeros. I have no idea what i've done wrong. After looking at many examples of the Desktop Duplication Api online I don't see any differences between them and mine. This is my method to initialize everything, and no errors are raised. BOOL init() { CHECKHR(D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, gFeatureLevels, gNumFeatureLevels, D3D11_SDK

Implement API to wait for d3d10 commands to finish

China☆狼群 提交于 2019-12-23 12:35:24
问题 I am implementing some functionality which requires me to implement an API to wait for d3d10 to finish rendering.Basically i am trying to implement synchronize access to a shared texture such that i can update a texture after d3d10 is successfully able to present to backbuffer. By calling this black box api i think this can be achieved and i think it will be something similar like glfinish().I have read we can use ID3D10Query queries for implementing synchronize access. D3D10_QUERY_DESC

DirectX 9 or 10 Overlay

梦想的初衷 提交于 2019-12-23 06:15:21
问题 How is it possible to draw an overlay over an game with DirectX 9 or 10? I found code with deprecated DirectShow code, but it will not run. 回答1: If this is what you have already found then ignore it, but try this: Direct3D Hooking Example 来源: https://stackoverflow.com/questions/1421487/directx-9-or-10-overlay

DX12 Descriptor Heaps management

前提是你 提交于 2019-12-23 06:06:15
问题 So after watching the dx12 binding videos and reading through some docs, I'm not 100% sure if I understood correctly how to manage my heaps. Let me explain what I wan't to achieve in my application: During the initialisation, I'll be filling two heaps, one holding Samplers and the other one holding SRV, CBV and UAV. Those heaps will contain all the resources the application will be using during its life time. Now starts the interesting part. To build the Root Signatures, I'll be using for the

Implementing Porter-Duff Rules in Direct3D

試著忘記壹切 提交于 2019-12-23 01:44:12
问题 What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)? 回答1: I'm haven't used Java too much, but based on the white paper from 1984, it should be a fairly straightforward mapping of render state blend modes. There are of course more that you can do than just these, like normal alpha blending (SourceAlpha, InvSourceAlpha) or additive (One, One) to name a few. (I assume that you are asking about these specifically because you are

draw over opengl/D3D with GDI?

烈酒焚心 提交于 2019-12-23 01:13:55
问题 I'm wondering if it's possible to draw over an opengl/direct3D surface with GDI? and if so, how might it be done? The reason I ask is because I'm writing a simple app to draw a few things in games. Such things would all be 2D or text such as framerate info, custom crosshair, clock, etc. I know the best way is to hook in and use whatever the renderer/game is using natively, be it opengl or direct3d, but I'm looking at GDI as AFAIK both opengl and D3D sit on device contexts which I'm hoping can

draw over opengl/D3D with GDI?

早过忘川 提交于 2019-12-23 01:13:01
问题 I'm wondering if it's possible to draw over an opengl/direct3D surface with GDI? and if so, how might it be done? The reason I ask is because I'm writing a simple app to draw a few things in games. Such things would all be 2D or text such as framerate info, custom crosshair, clock, etc. I know the best way is to hook in and use whatever the renderer/game is using natively, be it opengl or direct3d, but I'm looking at GDI as AFAIK both opengl and D3D sit on device contexts which I'm hoping can