direct3d

Direct3D rendering 2D images with “multiply” blending mode and alpha

混江龙づ霸主 提交于 2019-11-30 15:52:55
问题 I'm trying to replicate the Photoshop filter multiply with Direct3D. I've been reading and googling about the different render states and I've got the effect almost working. The problem is that it's ignoring the alpha value of the textures. Here's an image that explains the sitution: http://www.kloonigames.com/petri/stackoverflow_doesnt_allow_.jpg I found one solution to this, which was to save the images with no transparency and white background. But I'm not satisfied with this solution. The

fastest method to capture game screen shots in c#?(more than20 images per second)

隐身守侯 提交于 2019-11-30 15:37:49
How can i make screenshoots to the entire game screen very fast? Somthing like 20-30 per second?(i want to convert them to video) [[1]] I've tried WMEncoder.Results were that WMEncoder can capture the screen and regions of screen only in a video format (wma) using a set of preconfigured codecs. (29 fps best encode result).WMEncoder can not make screenshots. [[2]] I've tried DirectX : Surface s = device.CreateOffscreenPlainSurface( Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.SystemMemory); device.GetFrontBufferData(0, s); SurfaceLoader.Save("c:\

Direct3D rendering 2D images with “multiply” blending mode and alpha

被刻印的时光 ゝ 提交于 2019-11-30 15:19:39
I'm trying to replicate the Photoshop filter multiply with Direct3D. I've been reading and googling about the different render states and I've got the effect almost working. The problem is that it's ignoring the alpha value of the textures. Here's an image that explains the sitution: http://www.kloonigames.com/petri/stackoverflow_doesnt_allow_.jpg I found one solution to this, which was to save the images with no transparency and white background. But I'm not satisfied with this solution. The problem is that I really need to use the alpha value. I want to fade out the images gradually. And I

New to Direct3D programming: 11 vs 12

柔情痞子 提交于 2019-11-30 13:54:56
For a newbie in D3D programming, should one just learn D3D12 directly or is D3D11 necessary before diving into D3D12? Assuming starting from scratch and decent knowledge of C++, which way should I go? I've answered this question before so you should take a look at that post. In short, Direct3D 12 should be thought of as "DirectX Extreme Pro". It assumes you are already an expert in how the Direct3D 11 runtime works to the point that you can basically write it yourself. It is designed to allow middleware engines and low-level graphics developers to have maximum control over the behavior of the

Windows D3D渲染到纹理

亡梦爱人 提交于 2019-11-30 12:03:24
D3D渲染到纹理 1 #include <d3dx9.h> 2 3 //----------------------------------------------------------------------------- 4 // Desc: 全局变量 5 //----------------------------------------------------------------------------- 6 LPDIRECT3D9 g_pD3D = NULL; //Direct3D对象 7 LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; //Direct3D设备对象 8 LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL; //顶点缓冲区对象 9 LPDIRECT3DTEXTURE9 g_pTexture = NULL; //纹理对象 10 11 LPDIRECT3DTEXTURE9 g_pRender2Tex = NULL; 12 LPDIRECT3DSURFACE9 g_pRenderSur = NULL; 13 LPDIRECT3DSURFACE9 g_pBackupSur = NULL; 14 15 //----------------------------------------------------

Requirements for target application for Visual Studio 11's Graphics Debugger

半城伤御伤魂 提交于 2019-11-30 07:22:19
I was super happy when the "Graphics Debugger" feature was announced for Visual Studio 11, I immediately attempted to get it working on various projects I had, unfortunately I've only managed to get it working for Windows 8 Metro applications! Specifically the C++ Metro project templates run and capture all expected information correctly. With Developer Preview versions of Visual Studio, and on Windows 7, any attempt to launch applications under the Graphics Debugger (Alt-F5) crash on D3D11CreateDeviceAndSwapChain(), even if they work fine. On my Visual Studio 11 Beta on Windows 8 Consumer

How to query GPU Usage in DirectX?

旧城冷巷雨未停 提交于 2019-11-30 05:30:12
问题 How to query GPU Usage in DirectX? Specifically DirectX 11. If someone ever did it, could you provide me the code snippet? 回答1: Process Hakcer is able to do this. See here: http://processhacker.svn.sourceforge.net/viewvc/processhacker/2.x/trunk/plugins/ExtendedTools/gpumon.c?revision=4927&view=markup A similar question has been asked here: How do you calculate the load on a nvidia (cuda capable), gpu card? 来源: https://stackoverflow.com/questions/16376218/how-to-query-gpu-usage-in-directx

3 index buffers

限于喜欢 提交于 2019-11-29 17:26:41
问题 So, in both D3D and OpenGL there's ability to draw from an index buffer. The OBJ file format however does something weird. It specifies a bunch of vertices like: v -21.499660 6.424470 4.069845 v -25.117170 6.418100 4.068025 v -21.663851 8.282170 4.069585 v -21.651890 6.420180 4.068675 v -25.128481 8.281520 4.069585 Then it specifies a bunch of normals like.. vn 0.196004 0.558984 0.805680 vn -0.009523 0.210194 -0.977613 vn -0.147787 0.380832 -0.912757 vn 0.822108 0.567581 0.044617 vn 0.597037

How to install D3D11 SDK Layers for Windows 10 offline

烈酒焚心 提交于 2019-11-29 15:42:51
问题 I got the following error when I was debugging my D3D application in VS2015. D3D11CreateDevice: Flags (0x2) were specified which require the D3D11 SDK Layers for Windows 10, but they are not present on the system. These flags must be removed, or the Windows 10 SDK must be installed. Flags include: D3D11_CREATE_DEVICE_DEBUG I know I need to enable Graphics Tools in Win10 or run Dism /online /add-capability /capabilityname:Tools.Graphics.DirectX~~~~0.0.1.0 to enable it. But the machine I am

Calculate clipspace.w from clipspace.xyz and (inv) projection matrix

喜你入骨 提交于 2019-11-29 10:34:46
问题 I'm using a logarithmic depth algorithmic which results in someFunc(clipspace.z) being written to the depth buffer and no implicit perspective divide . I'm doing RTT / postprocessing so later on in a fragment shader I want to recompute eyespace.xyz, given ndc.xy (from the fragment coordinates) and clipspace.z (from someFuncInv() on the value stored in the depth buffer). Note that I do not have clipspace.w, and my stored value is not clipspace.z / clipspace.w (as it would be when using fixed