directx

SlimDX: Cannot see Direct3D debug output in Visual Studio 2010

北慕城南 提交于 2019-12-06 09:02:40
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? 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 name="OutputOnOutputDebugString">1</PropertyValue> I had 0 there. The most likely reason for this is that I

How to read vertices from vertex buffer in Direct3d11

放肆的年华 提交于 2019-12-06 08:09:49
问题 I have a question regarding vertex buffers. How does one read the vertices from the vertex buffer in D3D11? I want to get a particular vertex's position for calculations, if this approach is wrong, how would one do it? The following code does not (obviously) work. VERTEX* vert; D3D11_MAPPED_SUBRESOURCE ms; devcon->Map(pVBufferSphere, NULL, D3D11_MAP_READ, NULL, &ms); vert = (VERTEX*) ms.pData; devcon->Unmap(pVBufferSphere, NULL); Thanks. 回答1: Where your code is wrong: You asking GPU to give

How does one make function calls or trigger events from a Native component into a C#/XAML component?

会有一股神秘感。 提交于 2019-12-06 08:09:08
I am developing a WP8 application with a Native (DirectX/D3D) component and a C#/XAML component. The Native component draws to a UI element and the C#/XAML component has the controls of the app (and other things) surrounding it. Usually, I send information from the C#/XAML component down to the Native component. But there are certain times when I would like to trigger events in the C#/XAML component based on when processing is done in the Native component. In one planned feature, I envision a C#/XAML progress bar that is kept up to date by events triggered in the Native component.

Strange behavior with rotation matrices

﹥>﹥吖頭↗ 提交于 2019-12-06 08:08:30
I am trying to render a spaceship directly in front of a camera, with the model rotating with the camera's view. This works, as long as the player only yaws or rolls. If he does both, it goes into a tumble. A video of the problem is here: http://youtu.be/voKTsdy5TFY The relevant code follows, edited for clarity: D3DXMatrixRotationAxis(&playeryaw, &up, yawangle); D3DXMatrixRotationAxis(&playerpitch, &right, pitchangle); playerrot = playeryaw * playerpitch; D3DXMatrixTranslation(&playertrans, pos.x, pos.y, pos.z); D3DXMatrixScaling(&playerscale, 0.05 / ((float)i + 1), 0.05 / ((float)i + 1), 0.05

sphere texture mapping error

為{幸葍}努か 提交于 2019-12-06 07:47:39
i use D3DXCreateSphere method to create sphere mesh. and i want to apply an earth texture on it. i calculate the texture coordinate in pixel shader with following code: sampler ShadeSampler = sampler_state { Texture = (ShadeTex); AddressU = Mirror; AddressV = Mirror; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; }; PS_OUTPUT PSMain(VS_OUTPUT input){ PS_OUTPUT output = (PS_OUTPUT)0; vector uv; uv.x = 0.5 + atan2(input.normal.z, input.normal.x) / piMul2; uv.y = 0.5f - asin(input.normal.y) / pi; vector b = tex2D(ShadeSampler, uv.xy); output.diffuse = b * input.diffuse; return output

api-ms-win-core-libraryloader-l1-2-0.dll missing when d3dcompiler_47.dll is redistributed

扶醉桌前 提交于 2019-12-06 07:18:30
问题 As per instruction from the Windows 8.1 DirectX SDK, d3dcompiler_47.dll is to be redistributed with any Direct3D program from now on. When I try and run my program on a Windows 7 machine with this dll in the same folder, I get a "api-ms-win-core-libraryloader-l1-2-0.dll missing" error. A quick google search suggests this is because of a version mix-up somewhere - is d3dcompiler_47.dll incompatible with this machine? I've checked to make sure it has DirectX 11 installed, which is the version

How to enable VSYNC in D3D windowed app?

淺唱寂寞╮ 提交于 2019-12-06 07:18:18
问题 So, Im using D3D in a windowed application. I inited D3D with the following parameters: windowed: true; backbufferformat: D3DFMT_X8R8G8B8; presentinterval: D3DPRESENT_INTERVAL_ONE; swapeffect: DISCARD Each time OnPaint is called, I render the image to the backbuffer and present it to front. As far as I know (and so does MSDN say), once I set D3DPRESENT_INTERVAL_ONE , vsync will work. But in this case, the image is teared when dragging horizontally. (It seems there's a line across the image,

DirectX::XMMATRIX __declspec(align('16')) won't be aligned

折月煮酒 提交于 2019-12-06 06:48:27
问题 I am using DirectXMath in building my 3D simulation project void SetConstantBuffer(ID3D11DeviceContext*_device_context, DirectX::XMMATRIX _world, DirectX::XMMATRIX _view, DirectX::XMMATRIX _projection) { ConstantBuffer const_buffer; const_buffer.View = DirectX::XMMatrixTranspose(_world); const_buffer.World = DirectX::XMMatrixTranspose(_view); const_buffer.Projection = DirectX::XMMatrixTranspose(_projection); _device_context->UpdateSubresource(m_const_buffer, 0, NULL, &const_buffer, 0, 0); } I

Shader - Simple SSS lighting issue

故事扮演 提交于 2019-12-06 06:29:31
I am trying to create a simple subsurface scattering effect using a shader but I am facing a small issue. Look at those screenshots. The three images represents three lighting states (above surface, really close to surface, subsurface) with various lighting colors (red and blue) and always the same subsurface color (red). As you might notice when the light is above the surface and really close to this surface its influence appears to minimize which is the expected behavior. But the problem is that is behaves the same for the subsurface part, this is normal according to my shader code but in my

FFMPEG: While decoding video, is possible to generate result to user's provided buffer?

倖福魔咒の 提交于 2019-12-06 06:11:39
问题 In ffmpeg decoding video scenario, H264 for example, typically we allocate an AVFrame and decode the compressed data, then we get the result from the member data and linesize of AVFrame . As following code: // input setting: data and size are a H264 data. AVPacket avpkt; av_init_packet(&avpkt); avpkt.data = const_cast<uint8_t*>(data); avpkt.size = size; // decode video: H264 ---> YUV420 AVFrame *picture = avcodec_alloc_frame(); int len = avcodec_decode_video2(context, picture, &got_picture,