direct3d

Pow implementation for double

China☆狼群 提交于 2019-12-03 20:21:09
I am developing a code that will be used for motion control and I am having a issue with the pow function. I am using VS2010 as IDE. Here is my issue: I have: double p = 100.0000; double d = 1000.0000; t1 = pow((p/(8.0000*d),1.00/4.000); When evaluating this last function, I don't get the better approximation as result. I am getting a 7 decimal digits correct, and the consequent digits are all trash. I am guessing that pow function only casts any input variable as float and proceds with calculation. Am I right? If so, is there any code I can get "inspired" with to reimplement pow for a better

Direct3D Line thickness

情到浓时终转凉″ 提交于 2019-12-03 19:11:23
问题 How do I change the thickness of lines when drawing line lists using Direct3D? This post says that line width is not supported and goes on to provide a workaround. Other options? While we are on this topic, do shaders allow one to draw lines with dash patterns? 回答1: You can use a geometry shader that will take as an input a segment of your line and output a quad (a triangle strip made of two triangles) so that the width of the quad is constant in screen space and matches the desire line

OpenGL flickering/damaged with window resize and DWM active

僤鯓⒐⒋嵵緔 提交于 2019-12-03 14:41:50
问题 I have a wxWidgets application that has a number of child opengl windows. I'm using my own GL canvas class, not the wx one. The windows share their OpenGL context. I don't think the fact it is wxwidgets is really relevant here. The opengl windows are children of a windows that are siblings of one another, contained within a tab control. Kind of an MDI style interface, but it is not an MDI window.. Each one can be individually resized. All works lovely unless Aero is enabled and the DWM is

D3D11: Creating a cube map from 6 images

一曲冷凌霜 提交于 2019-12-03 13:44:13
问题 How do I create a cube map in D3D11 from 6 images? All the examples I've found use only one .dds. Specifically, how do I upload individual faces of the cube texture? 回答1: It works like this: D3D11_TEXTURE2D_DESC texDesc; texDesc.Width = description.width; texDesc.Height = description.height; texDesc.MipLevels = 1; texDesc.ArraySize = 6; texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; texDesc.CPUAccessFlags = 0; texDesc.SampleDesc.Count = 1; texDesc.SampleDesc.Quality = 0; texDesc.Usage = D3D11

How to get current display mode (resolution, refresh rate) of a monitor/output in DXGI?

落花浮王杯 提交于 2019-12-03 11:18:01
I am creating a multi-monitor full screen DXGI/D3D application. I am enumerating through the available outputs and adapters in preparation of creating their swap chains. When creating my swap chain using DXGI's IDXGIFactory::CreateSwapChain method, I need to provide a swap chain description which includes a buffer description of type DXGI_MODE_DESC that details the width, height, refresh rate, etc. How can I find out what the output is currently set to (or how can I find out what the display mode of the output currently is)? I don't want to change the user's resolution or refresh rate when I

OpenGL still better than Direct3D for non-games? [closed]

最后都变了- 提交于 2019-12-03 07:43:41
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . The standard model has been that OpenGL is for professional apps (CAD) and Direct3D is for games. With the debacle of openGL 3.0, is openGl still the natural choice for technical 3D apps (cad/GIS)? Are there scenegraph libraries for Direct3D? (Of course Direct3D is windows

Struggling With Vertex And Index Buffers In Direct3D

好久不见. 提交于 2019-12-03 07:36:48
问题 I've tried for many months to learn how IDirect3DVertexBuffer9 and IDirect3DIndexBuffer9 work. I've read multiple books, e-books and forums and I still can't get the hang of how they work. Can somebody help me understand how they work and how they link together? PS: I've tried searching through the related questions but nothing interested me. Thanks. 回答1: IndexBuffers are used for memory & speed optimizations. A indexBuffer is a list of indices that index the vertices in the vertexBuffer. So

OpenGL flickering/damaged with window resize and DWM active

╄→尐↘猪︶ㄣ 提交于 2019-12-03 05:29:23
I have a wxWidgets application that has a number of child opengl windows. I'm using my own GL canvas class, not the wx one. The windows share their OpenGL context. I don't think the fact it is wxwidgets is really relevant here. The opengl windows are children of a windows that are siblings of one another, contained within a tab control. Kind of an MDI style interface, but it is not an MDI window.. Each one can be individually resized. All works lovely unless Aero is enabled and the DWM is active. Resizing any window (not even the opengl ones) causes all of the opengl windows to flicker

D3D11: Creating a cube map from 6 images

走远了吗. 提交于 2019-12-03 03:42:10
How do I create a cube map in D3D11 from 6 images? All the examples I've found use only one .dds. Specifically, how do I upload individual faces of the cube texture? It works like this: D3D11_TEXTURE2D_DESC texDesc; texDesc.Width = description.width; texDesc.Height = description.height; texDesc.MipLevels = 1; texDesc.ArraySize = 6; texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; texDesc.CPUAccessFlags = 0; texDesc.SampleDesc.Count = 1; texDesc.SampleDesc.Quality = 0; texDesc.Usage = D3D11_USAGE_DEFAULT; texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; texDesc.CPUAccessFlags = 0; texDesc.MiscFlags

Struggling With Vertex And Index Buffers In Direct3D

回眸只為那壹抹淺笑 提交于 2019-12-02 22:32:19
I've tried for many months to learn how IDirect3DVertexBuffer9 and IDirect3DIndexBuffer9 work. I've read multiple books, e-books and forums and I still can't get the hang of how they work. Can somebody help me understand how they work and how they link together? PS: I've tried searching through the related questions but nothing interested me. Thanks. IndexBuffers are used for memory & speed optimizations. A indexBuffer is a list of indices that index the vertices in the vertexBuffer. So say I'm going to render a Flat Quad on the screen with 2 triangles. Each triangle takes up 3 vertices, so to