SharpDX is an open-source third-party managed DirectX wrapper.

learn more… | top users | synonyms

0
votes
1answer
420 views

How to print Depth to a Texture2D and then read it in the next pass on a shader in DirectX11

I'm programming a two-pass effect in DirectX 11 (SharpDX). It's supposed to write the depth to a texture in the first pass and then use that texture to extract data on the second one in the pixel ...
0
votes
1answer
365 views

Difference between texture.Load() and texture.Sample() methods in DirectX?

The question is simply that: What is the difference between texture.Load() and texture.Sample() in DirectX? I've used a Texture2D to store the depth in a pass of a DirectX Shader (with SharpDX), and ...
0
votes
2answers
135 views

Alpha interpolation in a pixel shader

How does the interpolation in a fragment shader work when it comes to the alpha parameter? I'm programming a shader with SharpDX, DirectX11. My idea is to interpolate 2 3d points of a segment, so ...
1
vote
0answers
740 views

SharpDX: Render to bitmap using Direct2D 1.1

I have a command line application that I am currently using SharpDX (Direct2D 1.0) to render to PNG files. This is a window-less application. It's currently creating a SharpDX.WIC.WicBitmap, a ...
0
votes
3answers
421 views

Loaded Images are upside down

I'm using SharpDX Toolkit and load a png file with SharpDX.Toolkit.Graphics.Texture.Load(GraphicsDevice, Stream) If I apply the texture to another texture it's drawn upside down. The texture is: and ...
1
vote
3answers
497 views

Error on running exe, build using SharpDX

I have developed a windows application to read gamepad using SharpDx (XInput) and C# (VS 2008). The application is running smoothly in my development environment. But when i move to some other machine ...
3
votes
2answers
519 views

Memory Leak in SharpDX

one Thing I found out: Windows 7 produces a memory leak while using certain methods to access rendertargets. Why doesn't Windows 8 leak at this method? public class Game : SharpDX.Toolkit.Game { ...
2
votes
2answers
175 views

Orthographic (0,0) center

I want to display coordinates from 0 to n, where n is int > 0. The map is displayed correctly heaving it's center in the middle of the screen pointing top right. I would like to have it pointing ...
0
votes
2answers
991 views

SharpDx how to detect if Mouse Button is pressed?

I'm wondering how it's possible to detect if a mousebutton is pressed or released. var di = new DirectInput(); _mouse = new Mouse(di); _mouse.Acquire(); _mouseState = _mouse.GetCurrentState() All I ...
0
votes
1answer
222 views

Monogame/SharpDX Texture2D doesn't hold value

The problem I have discovered is most likely between classes, so I dont really have much option but to post the whole code here: https://www.dropbox.com/sh/smyw9t1ap3by2vd/pBX-aJJ-Qx I have been ...
6
votes
1answer
227 views

Measuring GPU time from managed code

To measure CPU code, I use a Stopwatch. Using a Stopwatch in the Draw method is meaningless for the GPU side of things since the CPU and the GPU run asynchronously. The questions is simple: Is it ...
2
votes
2answers
148 views

How is the result returned in SharpDX.DirectInput.Device.Acquire()?

The documentation of IDirectInputDevice8::Acquire says: Return Value If the method succeeds, the return value is DI_OK, or S_FALSE if the device was already acquired. If the method fails, ...
2
votes
0answers
201 views

Chunk Texture3D GPU generated vertices

I read GPU Gems 3 from NVidia about procedural terrain. It's quite interesting but not applicable for me because I only read the online version without the shipped DVD so I'm not able to download the ...
0
votes
1answer
310 views

Chunks - Drawing in a randomly generated and infinite world

I am working on a platformer that is going to have a map that is randomly generated and infinite in 3 directions: left, right, and down. I've figured out that I will need to separate this world into ...
3
votes
2answers
306 views

How to correctly Dispose a SourceVoice once its finished

i am starting to play a sound with XAudio2 and SourceVoice and once its finished, it should be correctly disposed to not have any leaks. i was expecting it to be something like this: ...
0
votes
0answers
404 views

Deferred Shading - Toolkit

I recently managed to get some lights rendered in a scene by using a buffer and a for-loop. The problem with this method is the performance drop if more lights are used. I tried to convert Deferred ...
1
vote
1answer
189 views

SharpDX - How do I write multiple streams to Texture2D?

I'm working on a 3D map that is cut as a simple grid of textures. The idea is to draw only one object with all those textures, instead of having a tile object for each of them. Correct me if I'm ...
2
votes
1answer
925 views

DirectX11 Gamma Correction

I am writing a game using SharpDX with DirectX11 and I have been reading that it is important to apply gamma correction to my engine in order to perform correct linear lighting calculations. So I ...
0
votes
1answer
236 views

Sharp DX Identity Matrix, Matrix.Forward vector pointing at negative Z

I'm trying to take a steady grip on Sharp DX. Already done some work like translating, scaling and rotating objects. Now i have to calculate the rotation matrix using only direction vector and ...
2
votes
2answers
389 views

Error instantiating Texture2D in MonoGame for Windows 8 Metro Apps

I have an game which builds for WindowsGL and Windows8. The WindowsGL works fine, but the Windows8 build throws an error when trying to instantiate a new Texture2D. The Code: var texture = new ...
0
votes
1answer
267 views

XNA's SetData in a SharpDX Texture2D object in DirectX 11?

I'm trying to load a texture given a swap chain, and then populate that texture with data. I already have some bitmap data (although not sure if it is in the correct format) that I want to populate ...
0
votes
1answer
127 views

Weird rendering issue when applying lightmap through HLSL

I have a weird issue when trying to render the lightmaps in my game. Please see the following screenshots. Note how the scene looks up close with the lightmaps enabled. Note how that same part of ...
1
vote
1answer
622 views

Can not enable IME to capture Chinese characters in SharpDX

Just found that direct integration of IME is blocked in Windows 8, moving on to TSF now. By now, there is lack of Microsoft's Document about TSF, this will be hard. I am using SharpDX and the ...
2
votes
2answers
647 views

Camera frustum calculation coming out wrong

I'm trying to calculate a view/projection/bounding frustum for the 6 directions of a point light and I'm having trouble with the views pointing along the Y axis. Our game uses a right-handed, Y-up ...
2
votes
2answers
169 views

One or multiple VertexBuffers

I'm currently working on a personal project where I'm trying to load the levels and all of the geometry from the game "Medal of Honor Allied Assault" into my own C# code-base based on SharpDX. I ...
3
votes
1answer
1k views

Proper use of Dynamic Vertex Buffers for rapid update

I am creating a C#/SharpDx/DirectX10 application to plot line charts in a fast way. I have a prototype which uses Dynamic Vertex Buffers and fills a fixed-size buffer, say 1M vertices, with new data ...
0
votes
2answers
508 views

SharpDX (DirectX) - possible to measure Frame time?

I'm trying to benchmark various ways to draw 2D lines and have a snag. A D3D10Device that I draw with (and flush) doesn't appear to block, so I can't accurately measure frame rate (or time to render 1 ...
3
votes
2answers
2k views

Does Monogame on Windows Desktop use OpenGL or DirectX by default?

if i use monogame 3.0 beta on windows desktop, does it use the directx renderer (sharpdx) or the opengl renderer by default? if it uses directx is there away to make sharpdx call directly? thanks!
3
votes
1answer
354 views

DirectX Unproject troubles

I have an orthographic projection and I try to unproject a point from screen space. Following are the view and projection matrices: var w2 = ScreenWidthInPixels/2; var h2 = ScreenHeightInPixels/2; ...
1
vote
2answers
275 views

Doubling the DPI with a shader?

I'm developing a game where the map is generated with Perlin Noise, but on the CPU. I am generating some perlin noise onto a texture with a small size, and then I stretch it out to the whole screen to ...
6
votes
2answers
387 views

Best pathfinding for a 2D world made by CPU Perlin Noise, with random start- and destinationpoints?

I have a world made by Perlin Noise. It's created on the CPU for consistency between several devices (yes, I know it takes time - I have my techniques that make it fast enough). Now, in my game you ...
2
votes
2answers
2k views

Migration from XNA to SharpDX

My fear is that XNA has reached the end of the road. To keep up with the latest technology a shift to another game framework might be needed. We have many games in a large codebase, all based on XNA. ...
2
votes
1answer
632 views

SharpDx: using maximized RenderForm

I'm trying to learn DirectX via SharpDX, very new to this. What I want to do is be able to draw 2D shapes for a game I'm trying to make. So I started with the demo "MiniRect" that came with SharpDX. ...
1
vote
1answer
211 views

Direct2D gamma correction

I'm using direct2d and direct3d together and having an issue with gamma correction. My direct3d backbuffer is using an SRGB format and when I render images from direct2d onto the direct3d surface, ...
3
votes
1answer
760 views

Monogame/SharpDX - Shader parameters missing

I am currently working on a simple game that I am building in Windows 8 using MonoGame (develop3d). I am using some shader code from a tutorial (made by Charles Humphrey) and having an issue ...
1
vote
1answer
1k views

Pixel Shader, YUV-RGB Conversion failing

I am tasked with playing back a video hthat comes in in a YUV format as an overlay in a larger game. I am not a specialist in Direct3d, so I am struggling. I managed to get a shader working and am ...
5
votes
1answer
994 views

Rendering a Sprite with an Effect… how?

gettings tuck doing some 3d Rendering and I think you guys may have a lot more knowledge in it. I am tasked with basically rendering a texture onto a screen, preparing the way to apply graphical ...
1
vote
1answer
350 views

Are SharpDX's ContextDirect2D methods different from XNA's SpriteBatch?

I'm migrating from XNA to SharpDX in Win8. I noticed this DrawBitmap call in one of the samples. Is this different in some shape, way or form from XNA's SpriteBatch?
0
votes
2answers
2k views

SharpDX: best practice for multiple RenderForms?

I have an XNA app, but I really need to add multiple render windows, which XNA doesn't do. I'm looking at SharpDX (both for multi-window support and for DX11 / Metro / many other reasons). I decided ...
14
votes
5answers
11k views

SharpDX and game engines, back to zero?

I'm a desktop developer (I mainly do WPF for a living) but I want to make games as a hobby. So a few months ago, I started reading blogs, gamedevSE, you name it. I understand in the C++ DirectX ...
1
vote
2answers
159 views

What calls trigger a new batch?

I am finding my project is starting to show performance degradation and I need to optimize it. The answer to my previous question and this presentation from NVidia have helped greatly in understanding ...
3
votes
1answer
2k views

What are the valid DepthBuffer Texture formats in DirectX 11? And which are also valid for a staging resource?

I am trying to read the contents of the depth buffer into main memory so that my CPU side code can do Some Stuff™ with it. I am attempting to do this by creating a staging resource which can be read ...
2
votes
1answer
1k views

Loading textures with SharpDX in Metro

I have converted my C# game from OpenTK (OpenGL) to SharpDX (DirectX) and have it up and running from Visual Studio 2010. I also have it up and running from Visual Studio 11 in Metro, in the Windows 8 ...
2
votes
3answers
1k views

Tutorials for Managed DirectX development? [closed]

Are there any good tutorials, for someone new to DirectX development? I'd like to use the SharpDX library in a project, but am completely new to this sort of graphics programming. I'm looking for a ...
5
votes
2answers
4k views

Is using SharpDX or SlimDX easier than using DirectX directly from C++? [closed]

I decided to learn to program in DirectX yesterday, and, not being a huge C++ fanatic, went looking for a .Net wrapper. After reading about SlimDX and SharpDX, I decided I liked what the SharpDX ...
1
vote
1answer
518 views

Determine the stride of a DirectX Texture2D line?

Is there a way to determine, or preferably calculate/predict, the the stride of a line of a DirectX 11 Texture2D resource when using SharpDX? (E.g. Can we say the stride of a line is always a power ...
2
votes
1answer
2k views

Why can I not map a dynamic texture in D3D?

I am trying to map a Texture2D resource in DirectX11 via SharpDX. The resource is declared as a ShaderResource, with Dynamic usage and the 'Write' CPU flag specified. My call however fails with a ...
10
votes
1answer
4k views

Is SharpDX mature enough to adopt yet or should I just start using SlimDX right now?

I'm about to stop my game-project in XNA because from what I can gather it's development is coming to an end (and it's already behind current technology). Therefore, I need to adopt a new framework or ...