direct3d

SlimDX: Cannot see Direct3D debug output in Visual Studio 2010

我怕爱的太早我们不能终老 提交于 2019-12-10 11:28:50
问题 I've installed the June 2010 SDK Enabled the Debug Runtime in the DirectX Control Panel set the Debug Output Level to maximum (More) Enabled unmanaged code debugging. Result: The debug output from Direct3D is missing However if I start the application externally and use dbgview.exe, the output is shown there. What could be the reason for that? 回答1: After hours of trial and error I found a solution to my problem. Export your settings and check the value of the following setting: <PropertyValue

How to select the front triangles of a stl model or a triangular mesh?

淺唱寂寞╮ 提交于 2019-12-09 23:01:13
问题 There is a stl model(triangular mesh). I want to use a adjustable, rectangular shape to make selections. Like below picture. But I don't want the triangles on the other side are selected. That's to say only the visible triangles in the rectangular can be selected. AFAIK, there is a method to do this. First render each triangle with a specific and unique color. Then, retrieve the color of the pixels in the select rectangular, and convert those colors back to the original identifier. The

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

南楼画角 提交于 2019-12-09 00:15:11
问题 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

How to include Direct3D in a program?

喜欢而已 提交于 2019-12-08 10:39:56
问题 I am learning Direct3D from directxtutorial.com. I am including it through a preprocessor directive in the code below. #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "d3dx11.lib") #pragma comment(lib, "d3dx10.lib") This is not doing it, however. I am guessing it is because the library files aren't where its checking to find them. But could someone explain what's going on here? Thanks. The error message is: "Intellisense: could not open source file" 回答1: You'll need to download and

Direct3D c++ api how to update vertex buffer?

白昼怎懂夜的黑 提交于 2019-12-08 10:18:02
问题 So how can one update values in vertex buffer bound into device object using IASetVertexBuffers method? Also will changing values in this buffer before call to Draw() and Present() ? Also will the image be updated according to these new values in buffer? 回答1: To update a vertex buffer by the CPU, you must first create a dynamic vertex buffer that allows the CPU to write to it. To do this, call ID3D11Device::CreateBuffer with Usage set to D3D11_USAGE_DYNAMIC and CPUAccessFlags set to D3D11_CPU

Rotate a sphere so that its pole heads towards the camera

情到浓时终转凉″ 提交于 2019-12-08 07:52:55
问题 I have a sphere whose north pole is at (0, 0, 1) and center at (0, 0, 0). I also have a camera arbitrarily positioned in the scene and looking at (0, 0, 0). I want to rotate the sphere so that its north pole lies on the line from (0, 0, 0) to camera position. I am performing this task in a vertex shader and I would like it to be as simple as possible to avoid FPS drop. Does anyone know any simple method how to calculate the rotation matrix or even a simpler way how to perform the rotation of

Implementing Porter-Duff Rules in Direct3D

前提是你 提交于 2019-12-08 04:56:31
What Direct3D render states should be used to implement Java's Porter-Duff compositing rules (CLEAR, SRC, SRCOVER, etc.)? 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 porting some existing functionality? In that cause you may not care about other combinations...) Anyway,

Direct3D11: Flipping ID3D11Texture2D

一曲冷凌霜 提交于 2019-12-08 04:31:25
I perform a capture of Direct3D back buffer. When I download the pixels the image frame is flipped along its vertical axis.Is it possible to "tell" D3D to flip the frame when copying resource,or when creating target ID3D11Texture2D ? Here is how I do it: The texture into which I copy the frame buffer is created like this: D3D11_TEXTURE2D_DESC description = { desc.BufferDesc.Width, desc.BufferDesc.Height, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, // DXGI_SAMPLE_DESC D3D11_USAGE_STAGING,//transder from GPU to CPU 0, D3D11_CPU_ACCESS_READ, 0 }; D3D11_SUBRESOURCE_DATA data = { buffer, desc

Why can properties not be public inside a ref class sealed

醉酒当歌 提交于 2019-12-07 18:59:39
问题 The following code is illegal ( Visual Studio 2012 Windows Phone( Creating a windows phone direct3d app ) ) a non-value type cannot have any public data members 'posX' Header ref class Placement sealed { public: Placement( float rotX, float rotY, float rotZ, float posX, float posY, float posZ ); float rotX, rotY, rotZ, posX, posY, posZ; }; Cpp Placement::Placement( float rotX, float rotY, float rotZ, float posX, float posY, float posZ ) : posX( posX ), posY( posY ), posZ( posZ ) { this->rotX

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

微笑、不失礼 提交于 2019-12-07 15:55:15
问题 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 . Parts of the code i am using for one Rectangle using D3DPT_TRIANGLESTRIP is as follows: CUSTOMVERTEX recVertex[] = { { 10.0f, 10.0f, 0.10f, 1.0f, 0xffffffff,