sharpdx

Strange smeared edges pattern using HLSL for YUV to RGB conversion

拥有回忆 提交于 2019-12-10 20:39:54
问题 I'm trying to write a YUV to RGB shader in HLSL. Specifically, it converts the Yuv420p format which consists of an N M plane of Y values, followed by an (N/2) (M/2) plane of U values and then an (N/2)*(M/2) plane of V values. For example this 1280x720 picture: looks like this in YUV format interpreted as an 8-bit, 1280x1080 texture: In Direct3D11, I'm loading this as a Texture2D with format R8_UNorm and dimensions 1280x1080. The tricky part is reconstituting the U and V planes, because as you

How can I draw a transparent 3D object with the SharpDX Toolkit?

雨燕双飞 提交于 2019-12-10 13:31:33
问题 I'm working on an application that uses SharpDX and the SharpDX Toolkit to draw simple 3D shapes, and the Geometrics.Desktop sample was very helpful in getting started. Now I'm trying to make some shapes transparent, and to keep things simple I'm just trying to make the teapot model in in that sample appear transparent (perhaps translucent would be more precise). For those not familiar with the Geometrics.Desktop sample, it draws a few simple primitive geometric shapes in 3D. Being a sample

How to use a font from a file in SharpDX?

早过忘川 提交于 2019-12-10 11:36:34
问题 i want to generate image for windows 8 app, i'm going to use SharpDX API here is the code sample which i thankfully coped and paste private MemoryStream RenderStaticTextToBitmap() { var width = 400; var height = 100; var pixelFormat = WicPixelFormat.Format32bppBGR; var wicFactory = new ImagingFactory(); var dddFactory = new SharpDX.Direct2D1.Factory(); var dwFactory = new SharpDX.DirectWrite.Factory(); var wicBitmap = new Bitmap( wicFactory, width, height, pixelFormat, BitmapCreateCacheOption

SharpDX: Enabling BlendState

谁都会走 提交于 2019-12-09 20:29:48
问题 I'm trying to get the "SharpDX.Direct3D11.DeviceContext.OutputMerger.Blendstate" to work. Without this, i have nice scene (Polygones with textures on it, for a Spaceshooter). I've done OpenGL Graphics in the past three years, so i thought it might be as simple as in OpenGL - just enable Blending and set the right Dst/Src Modes. But if i set a new BlendStateDescription, all Output is Black, even if "RenderTarget[x].IsBlendEnabled" is set to "false". I searched for a tutorial or something, and

Now that Xna is unsupported, what is a better choice? [closed]

无人久伴 提交于 2019-12-09 10:06:43
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Xna is unsupported, and unfortunately I started game programming recently(~9 months). What is a better choice, DirectX or OpenGl. Now,

A function like “glReadPixels” in DirectX / SharpDX

南笙酒味 提交于 2019-12-08 20:38:11
问题 I'm searching for a way to read a pixels color at the mousepoint. In OpenGL it was done by calling the function "glReadPixels" after drawing the scene (or parts of it). I want to make a simple color picking routine in the background, for identifing a shapes / lines in 3D Space. So, is there any equivalent method/function/suggestion for doing the same in SharpDX (DirectX10 / DirectX11) ? 回答1: This is perfectly possible with Direct3D11: simply follow these steps: Use DeviceContext

How to draw a transparent surface using SharpDX?

泄露秘密 提交于 2019-12-08 15:45:14
问题 ( This question is based on further investigations of this other question, but isn't the same question, this is very specific question about painting issues. ) I'm trying to draw a transparent surface overlapped on a target window, the problem is that I don't know how to paint it transparent, so by the moment my surface is black, and I cannot see the proper way to clear the black color of that surface in the code below. I'd read about pixelformats and alphamodes, however, seems I cannot use

How to load a texture from a file?

北城以北 提交于 2019-12-08 06:09:00
问题 I'm switching to SharpDX 3.0.0 right now. With the old SharpDX version you could load a texture from file in this way: ShaderResourceView textureView = SharpDX.Direct3D11.Resource.FromFile<Texture2D>(device, "Texture.png"); or ShaderResourceView textureView = ShaderResourceView.FromFile(device, "Texture.png"); But in version 3.0.0 the function FromFile is missing. How can I load textures from files with SharpDX 3? 回答1: You have to use the WIC API or similar methods. There is a old code

SharpDX, DirectWrite and Windows Forms

冷暖自知 提交于 2019-12-07 18:14:38
问题 Can one render text using DirectWrite to a PictureBox in a WinForm app? I'm using SharpDX and have gone through the DirectWrite samples trying to build the simplest working case I can. I created a Form and added only a pictureBox to it. Then the following code. The form displays, but nothing visible with the PictureBox. Any guidance would be much appreciated. Thanks! using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; //using System.Drawing; using

Find out DirectX Version

故事扮演 提交于 2019-12-07 08:25:30
how can you detect if the directx version on a windows 7 machine is 11 or 11.1 ? preferably using a .NET language maybe via PInvoke or SharpDX? Ivan Aksamentov - Drop Just try to create a device with a specific feature level (along with other parameters). In native code (use one of the D3D11CreateDevice* functions) . If function will not succeed - feature level is not supported. To make it easier, we usually pass array of feature levels, and then, if device is not nullptr , we can check which one is highest supported: const D3D_FEATURE_LEVEL arrFeatLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D