Skip to main content
3 votes
Accepted

SharpDX Texture to Image in C#

I have two methods for doing this I will post them both. Code is in VB.net and using sharpDX 3.0.2 Basically you copy your texture data to a staging resource and then write that staging resource to ...
Justin William Stanley Bryant's user avatar
2 votes
Accepted

Calculating 3D character movement based on YAW and Pitch

A vector to your camera's right is the same as the forward vector of a camera that's looking 90 degrees further in yaw, and at zero pitch. So you can modify your look vector code to give you your ...
DMGregory's user avatar
  • 135k
2 votes

How can I install SharpDX for my project?

On the right hand side of the page is a list of actions. On the bottom, it says "Download Package". It prompts a download of the nuget package, which I believe is what you want. This is the link: ...
Chillersanim's user avatar
2 votes
Accepted

Why does rendering to a texture cause transparency here?

A couple of things i try to do first to debug it. For your ui just set the pixel shader to write out white with alpha set to 1.0f. If that is rendering and is no longer transparent then you can ...
ErnieDingo's user avatar
  • 1,150
2 votes

What is the proper strategy to manage vertex buffers?

If there was just one "proper strategy" or "best way", the API would give you only that one option to ensure everyone got the best outcome. But that's not how gamedev works. ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

XInput (SharpDX) not returning 0 on thumb sticks when they're idle

This sounds like a fairly normal issue. Analog sticks are notoriously imprecise, and develop a drift over their lifetimes. (If you've ever had such a well-used gamepad that when you boot up some games,...
DMGregory's user avatar
  • 135k
2 votes
Accepted

Is there any performance difference between Draw() and DrawInstanced(1)?

While you can bench this yourself, it may be worth noting that in the new APIs (Vulkan, D3D12), there are no non-instanced draw calls. Every draw call is instanced, and you specify a number of ...
Maximus Minimus's user avatar
1 vote

Instancing mirrored geometry

I would sort the instances mirror/no mirror. Make the first draw call, update the rasterizer with the cull mode you want then render the mirror'd instances. Its overhead on CPU, but it shouldnt be ...
ErnieDingo's user avatar
  • 1,150
1 vote

Off-Screen Image processing with SharpDX

Hey mate so there are a few ways to draw on screen, you can draw a full screen triangle and do some fancy shader math or you can render a full quad. Ill show you how to do both. Full Screen Quad ...
Justin William Stanley Bryant's user avatar
1 vote
Accepted

Simple screen aligned renderer

This is a vertex shader which will draw a full screen triangle without a vertex buffer: ...
János Turánszki's user avatar
1 vote
Accepted

vertex manipulation in instanced shader hlsl SHARPDX 4.2

The goal is achieved. It was to modify the vertex position inside of a Vertex Shader with using Vertex Binding Elements. The vertex binding is used both for storing the index of each byte (to which ...
Ninekorn's user avatar
1 vote
Accepted

How do I draw text using DirectX 12?

How did you draw your text with DirectX 11? D3DX9, D3DX10, D3DX11 and in fact the entire ...
Chuck Walbourn's user avatar
1 vote
Accepted

Ugly Textures in the Distance

ID3D11DeviceContext::GenerateMips method If the base resource wasn't created with D3D11_BIND_RENDER_TARGET, D3D11_BIND_SHADER_RESOURCE, and D3D11_RESOURCE_MISC_GENERATE_MIPS, the call to ...
Maximus Minimus's user avatar
1 vote
Accepted

Pixel Shader stage did not run

Your input w values are zeros. The mathematical principles which projection matrices are based on rely on the input vector w element to be 1.0. The GPU later uses the resulting w element of each ...
Elad Maimoni's user avatar
1 vote

A question about SharpDx Colored Cube

Finally, I found what the problem is. My indeces is an array which type is int, so during my render period, I should set my index buffer format 32byte such as Format.R32_UInt, rather than Format....
tedyage's user avatar
  • 23
1 vote
Accepted

Device Disposing Memory leak issue

You probably still have objects bound to the pipeline (via a context->Set call) at the time you perform the final dispose. In D3D11 binding an object will cause it's reference count to be incremented,...
Maximus Minimus's user avatar
1 vote
Accepted

How to pan a perspective camera over a 2D scene with click & drag

Let's start with your cursor position as a 2D vector, where (-1, -1) is the bottom-left corner of the screen and (1, 1) is the top-right (flip signs accordingly from here on in if you're using ...
DMGregory's user avatar
  • 135k
1 vote
Accepted

Processing large multi layered images with SharpDX

Instead of merging everything into a large temporary texture if you render all the temporaries and 2D mesh to a frame buffer the same size and render-offset as your final window the GPU would be ...
Stephane Hockenhull's user avatar
1 vote
Accepted

Merging multiple image with DirectX D3DImage best approach?

The Pixel Shader and Texture Array are your friends. I removed any C# architecture the was not absolutely necessary (Loops and Collections). I was able to get this working very well with smooth ...
Reaper's user avatar
  • 153
1 vote

Why does rendering to a texture cause transparency here?

In the event that somebody with a similar problem stumbles onto this thread, I'll share what eventually fixed my issue. I took ErnieDingo's advice and took a closer look at the z-buffer. Looking for ...
Scorch's user avatar
  • 257
1 vote

Draw fonts in Hololens using SharpDX

The sample you provided is actually not using DirectWrite I think, which would not be your best bet in any case, because the ...
Scorch's user avatar
  • 257
1 vote
Accepted

Why is my render engine only rendering one frame?

A few things that I found. First up don't use the datastream object for writing to buffers because in the long run it will end up killing GC performance(have tested), the best bet for writing to DX ...
Justin William Stanley Bryant's user avatar
1 vote
Accepted

Help Understanding Cameras/View Matrices in DirectX11 (C#)

So, in the end, I'm not entirely sure why the above code doesn't work, but I believe it has something to do with the way that matrices are multiplied, which appears to vary, being either row-major or ...
Scorch's user avatar
  • 257
1 vote
Accepted

How do I use SharpDX with the .NET Core framework?

So, for anybody looking to find an answer to this in the future, the answer is "No." You can not use SharpDX with .NET Core (note that VS Code supports only .NET Core if you develop in C#). ...
Scorch's user avatar
  • 257
1 vote

How can I send effects to joystick connected to my PC USB using C# and sharpdx?

I'm assuming you are looking to receive input from the controller, and not actually trying to send data to the controller. First, an Effect in this context is referring to a force-feedback effect (IE....
JonBee's user avatar
  • 659
1 vote

How do i get a list of all joysticks connected to my pc in usb using sharpdx with c# ? Getting errors

You're getting these errors because the library no longer works the way it did in whatever documentation you are using. Joystick.GetObjects() supports a parameter that allows you to specify the ...
JonBee's user avatar
  • 659
1 vote
Accepted

I don't think my shaders are working, looking for help

I made it! It turns out the problem is not with the shader, but the Draw method. I missed setting the first parameter of draw in my code, which should be the ...
王凯越 Kaiyue Wang's user avatar
1 vote

How the game engine handles camera view in DirectX

Direct3D version 9, and even more 10, 11, and even even more, Direct3D 12, work at a very different level of abstraction compared to a game engine. Put simply, Direct3D is simply a set of APIs that ...
Panda Pajama's user avatar
  • 13.4k
1 vote
Accepted

Adding mesh's\objects to procedural isosurface terrain

You should have the vertex positions for the terrain and some information about how they make up the triangles (like indices), and you also know the normals for each triangle. With this data you can ...
Bálint's user avatar
  • 14.9k
1 vote

SharpDX Error 'The Parameter is Incorrect', how to debug from dx?

I was having the exact same error on the same line, and I managed to solve by completing all the properties of the EffectParameters object. Mine was the ep.TriggerButton, that I changed from 0 to -1. ...
Matheus Stumpf's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible