directx

DirectX Image texture quad displays underlying controls color where it is transparent

柔情痞子 提交于 2019-12-22 01:08:17
问题 I'm trying to draw a texture on texture as show in the image below. Yellow circle Image: Green circle Image: As shown in the above image of penguins, i'm trying to render another image as texture which is shown by green and yellow circles. The image is transparent where purple is shown. Purple is color of the underlying control on which the texture is drawn. The order of rendering is: 1. render penguins 2. Render green circle 3. render yellow circle 4. render green circle Now I'm not sure as

How to normalize a mesh into -1 to 1, then revert from normalized mesh to original one?

两盒软妹~` 提交于 2019-12-22 00:34:48
问题 I have a mesh model in X, Y, Z format. Lets say. Points *P; In first step, I want to normalize this mesh into (-1, -1, -1) to (1, 1, 1). Here normalize means to fit this mesh into a box of (-1, -1, -1) to (1, 1, 1). then after that I do some processing to normalized mesh, finally i want to revert the dimensions to similar with the original mesh. step-1: P = Original Mesh dimensions; step-2: nP = Normalize(P); // from (-1, -1, -1) to (1, 1, 1) step-3: cnP = do something with (nP), number of

Offscreen Rendering in OpenGL or Directx

风格不统一 提交于 2019-12-21 23:32:10
问题 I want to be able to render complex 2D and 3D images using hardware acceleration on a server with no user context or logged in user. The best thing I could do so far is Mesa3D, but because it is pure software 3D rendering it is slow and does not take advantage of the video hardware acceleration. Could be Windows or Linux. Most of my work I have done so far in Windows. Any suggestions on how to do this with OpenGL or DirectX? 回答1: For Linux, EGL + MESA_platform_gbm should let you get a

Directx 11 Front Buffer

时光毁灭记忆、已成空白 提交于 2019-12-21 20:55:49
问题 I am hoping this is a easy answer to an easy question which I cannot find an answer to. How do I access the front buffer in Directx 11 / DXGI? I have found in Directx 9 you can use GetFrontBufferData() and you can use GetBuffer() in Directx 11 to get access to the backbuffer but there are problems with this. The backbuffer doesn't have calculations done to it that the front buffer does. So I was wondering if there is something I am missing. I could try using GetDisplaySurfaceData and unless I

DirectX: World to view matrix - where is my misconception?

拜拜、爱过 提交于 2019-12-21 20:32:34
问题 I'm starting with DirectX (and SharpDX, therefore programming only in C#/hlsl) and am trying to build my own camera class. It should be rotatable, allow forward and backward moving and also "sideways" movement (the classical first person movement often mapped to A and D, plus up and down in my case). For easier bugfixing model and world space are the same in my case, perspective projection is not yet implemented, as is rotating the camera, and my camera is supposed to look in the positive Z

How to enable Hardware Percentage Closer Filtering?

夙愿已清 提交于 2019-12-21 20:23:06
问题 I am trying to implement PCF filtering to my shaow maps, and so modified the GPU Gems article ( http://http.developer.nvidia.com/GPUGems/gpugems_ch11.html ) so that it could be run on current shaders. The modification includes replacing tex2Dproj function with Texture2D.Sample() function so it accepts Sampler States which are created in DirectX11. Then I compared the offset values with a normal shadow map comparison: float2 ShTex; ShTex.x = PSIn.ShadowMapSamplingPos.x/PSIn

Load a .obj model with ASSIMP in DirectX9

偶尔善良 提交于 2019-12-21 17:30:00
问题 This is my first time posting. I have this issue with this 3d model loading library called ASSIMP. I am trying to integrate it in a sample Direct3d9 app. and it is not going so well. I am an experienced C++ programmer so it shouldn't take too much hassle to help me :). So i have in the past made several d3d9 apps and rendered manual primitives. but now i am trying to render an obj model loaded with ASSIMP. when i try to render it, NOTHING is rendered at all. this is very weird, not even one

Bilinear interpolation - DirectX vs. GDI+

别等时光非礼了梦想. 提交于 2019-12-21 11:34:31
问题 I have a C# app for which I've written GDI+ code that uses Bitmap/TextureBrush rendering to present 2D images, which can have various image processing functions applied. This code is a new path in an application that mimics existing DX9 code, and they share a common library to perform all vector and matrix (e.g. ViewToWorld/WorldToView) operations. My test bed consists of DX9 output images that I compare against the output of the new GDI+ code. A simple test case that renders to a viewport

How to convert quadratic bezier curve code into cubic bezier curve?

有些话、适合烂在心里 提交于 2019-12-21 06:39:07
问题 So I've recently picked up graphics programming and I wanted to compute a cubic Bézier curve. I found this excellent answer on quadratic Bézier but I don't know how to convert this to a cubic Bézier curve. 回答1: For cubic Bézier curve, as you see in the link you shared, the green lines are obtained from the same procedure as the quadratic one. the differences are: you have two green lines, and then you need to calculate a blue line based on them. So the for loop changes as: for( float i = 0 ;

DirectX Game hook

孤者浪人 提交于 2019-12-21 04:48:58
问题 I'm trying to simulate mouse events in a game. The games uses DirectInput so you can't use SendMessage to send mouse events/keyboard events to it, that's basically why I have to hook in to the game. Also I don't want to use SendInput/mouse_events, the game must run on the background and make mouse events. I already managed to make a DLL hook in the game but now the next problem is that I have to make the mouse events and keyboards (probably the main problem). Thanks in advance. 回答1: Instead