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

learn more… | top users | synonyms

0
votes
0answers
15 views

Animating colors in a Direct2D Linear or Radial GradientBrush

Is it possible to change colors in a Direct2D brush once created? For example, if I create a LinearGradientBrush can I interpolate the value of the color in one GradientStop to a target color over ...
0
votes
0answers
85 views

class instance issue

Currently, i am working on a project which deals with several parts. First, I want to interface with a Sidewinder Force Feedback 2 joystick in Unity using SharpDX and SharpDX.DirectInput libraries. ...
1
vote
1answer
340 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?
2
votes
3answers
403 views

SharpDX/D3D: How to implement and draw fonts/text

I am playing with SharpDX (Direct3D for .NET) without using "Toolkit", already finished with basic rendering 3D models. But now i am wondering how to program/create fonts for game (2D), or how to ...
0
votes
1answer
54 views

HLSL - can't get texture to wrap or mirror

I'm currently converting an app from XNA to SharpDx and I'm therefore upgrading my shaders to version 4 (vs_4_0/ps_4_0). When using this sampler: SamplerState MySampler { Filter = ...
0
votes
1answer
78 views

Multiple joysticks event handling

I want to make a game which is totally same idea as "Who pressed the button answers the question". I have 2 joysticks and both are connected to a pc. My application will be Winforms and I will ...
1
vote
1answer
42 views

Why does this no longer render the “test tri”?

So I got this code about rendering a shaded tri using sharpDX ... var vertexShaderByteCode = ShaderBytecode.CompileFromFile("MiniTri.fx", "VS", "vs_4_0", ShaderFlags.None, EffectFlags.None); var ...
1
vote
0answers
120 views

Windows Phone 8.1 emulator for DirectX landscape

July 16, 2014 update: I have converted the SharpDX "MiniCube" sample project to a Universal 8.1 project. It is 100% self-contained. It will demonstrate this issue. There is a "READ ME.txt" file ...
2
votes
1answer
162 views

Is there a penalty to using render targets versus textures?

I figured that the best way to ship 2D art for multiple resolutions is to instruct my artist to create the fullscreen background images sized for the highest resolution and then scale them down during ...
1
vote
1answer
58 views

How can I create a buffer suitable for dynamic updates in SharpDX?

I want to set a buffer that is updated every frame but can't figure it out, what i have to do. The only working thing i have is this: mdexcription = new BufferDescription(Matrix.SizeInBytes * ...
1
vote
0answers
48 views

Anisotropic and trilinear filtering?

I'm confused about the usage of trilinear filtering and anisotropic filtering in SharpDX. As far as i understood, trilinear filtering does linear filtering to the textures and in a case of LOD-change ...
0
votes
0answers
47 views

Pixel Shader : Backbuffer is 'Black'

After Fiddling around I am pretty sure this is not a Shader issue. Edit 4: The only diference I can see is that BasicEffect calls these methods before drawing: // Make sure that domain, hull and ...
1
vote
1answer
92 views

How do I create a camera?

I am trying to create a generic camera class for a game engine, which works for different types of cameras (Orbital, GDoF, FPS), but I have no idea how to go about it. I have read about quaternions ...
2
votes
1answer
101 views

Achieve anisotropic filtering

I want to set anisotropic filtering to my scene. I use SharpDX (DirectX 11) and C#. How do i set up anisotropic filtering in my shader? Currently i try that in the shader: Texture2D tex; sampler ...
0
votes
1answer
146 views

How do I set up a depth buffer in SharpDX?

I draw some instanced cubes, but when i rotate the camera (or the world) some cubes that should be behind other cubes are drawn before the cubes. I already had this issue a long time before and i ...
1
vote
2answers
270 views

Drawing cube in SharpDX, wrong perspective

I want to draw a cube. This is what i currently have: As you can see, the perspective is VERY wrong. The the size in the z-direction is too small and the difference between the front and back size ...
2
votes
2answers
102 views

Properly rendering transparent areas of textures

I'm rendering a tree that contains branch meshes with partially transparent textures. If I render it with AlphaTestEffect and set the ReferenceAlpha to something low, I'll get this. I want to ...
2
votes
1answer
70 views

Camera roll has no effect

Consider my following (abstracted) C# w/ SharpDX code: class Game { Camera _camera = new Camera(); private void Window_KeyDown(object sender, KeyEventArgs e) { // Roll if ...
0
votes
2answers
226 views

SharpDX.Toolkit setting constant buffer

I am trying to use a constant buffer in a program using SharpDX.Toolkit. I use the Toolkit because it has nice font support for writing on the screen. The problem I face is in assigning data to the ...
-1
votes
1answer
166 views

SharpDX instancing with D3D11

Could anybody provide working code using SharpDX with D3D11, which does instancing and uses SharpDX's content pipeline? I have several problems there. I came to understand that one should use a ...
4
votes
1answer
350 views

How do I convert a .dds texture to .png bitmap in C#?

This question is from someone who has not written a line of code for games, but several Game Save editors and other game tools. I'm working on a Save Editor and would like to display icons of some of ...
4
votes
1answer
239 views

How to debug DXGI_ERROR_INVALID_CALL errors?

I am developping an application using SharpDX and on one of my machines the call _swapChain = new SwapChain(factory, _device, desc); fails with the error message HRESULT: [0x887A0001], Module: ...
1
vote
0answers
199 views

How do i define array in shader's constant buffer with C#?

I am using SharpDX to render 3D graphics and i cannot get to work constant buffer in my shader since it contains an array. Currently it looks like this: cbuffer cb0 : register(b0) { matrix ...
0
votes
1answer
227 views

From Position/Target to Orientation/Elevation

I have an orbit camera class that calculates the camera position from Orientation/Elevation and distance from target. I decided to replace these initial values for the camera instantiation with simply ...
0
votes
0answers
74 views

Sorting 3D particles by depth

This is a general particles question, but I use XNA/MonoGame so I looked at: http://xbox.create.msdn.com/en-US/education/catalog/sample/particle_3d for Particles 3D. I found the example not to ...
1
vote
1answer
462 views

How to set shader global variable in sharpdx without using Effect class

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. But, in my code SharpDX's Effect class is not used: i use PixelShader ...
1
vote
1answer
139 views

Read part of texture using SharpDX

I have a Texture3D. I want to read a part of it from CPU side. (I'm using the SharpDX toolkit (v2.5.1).) My data is always 0, but the output shows no errors. This is the source texture: testTex = ...
2
votes
2answers
573 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 ...
0
votes
1answer
279 views

Instancing with the SharpDX toolkit

I am starting on the graphical portion of my project and before I begin I need to get Instancing working. I can do instancing with SharpDX, but not with the Toolkit Models. The main reason I want to ...
1
vote
1answer
458 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 ...
0
votes
1answer
153 views

Rendering Textured Terrain With SharpDX Toolkit [closed]

So i recently moved from XNA to SharpDX Toolkit and started with some basics. The 2d part was easy since nearly nothing has changed but im really struggeling with the 3d part. For example i wanted to ...
0
votes
0answers
40 views

IndexedInstanced logic

I'm using SharpDX.Toolkit with three buffers: two vertex and one index buffer. The first vertex buffer is bound to slot 0 for per-vertex data with following data: static VertexPosition[] vertexData = ...
1
vote
2answers
240 views

Anti-aliasing a sphere

I render everything in my game in 2D with SpriteBatch with the exception of a spherical entity (orb) that I render as a spinning and dynamically lit (custom effect) sphere in 3D. I capture the sphere ...
0
votes
1answer
129 views

Why divide by w makes the pixel shader look better?

I'm writing a shader in HLSL (Direct3D11 with SharpDX) and after some computations I was trying to make a test and print the depth z of a specific point in my pixel shader, like this: myZ = ...
1
vote
1answer
131 views

ShaderBytecode Compiler one technique multiple passes

I have an effect code with a basic structure like technique TechniqueName { pass FirstPass { Profile = fx_4_0 VertexShader = RenderFirstVS GeometryShader = null ...
0
votes
1answer
68 views

How do I upscale my scene to a larger viewport?

I want to: Render my scene to a small viewport (some divisor of the full screen size). Stretch the rendered image to cover the full screen size. For example I want to render a complex, very slow ...
0
votes
0answers
137 views

When should I set a texture as a shader resource in order to read it?

I'm writing a Direct3D 11 HLSL shader with SharpDX. What I want to do is write the depth to a texture in one pass and read it in the next one. After declaring the texture, do I have to set the depth ...
1
vote
2answers
350 views

What is the depth that a pixel shader may output? Is it necessary to write Depth?

In DirectX11, what does the depth that a Pixel Shader can output mean? Does a pixel shader need to output a depth so that we "write" the depth? If not, why would we output it? For any doubts, I'm ...
0
votes
1answer
254 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
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 ...
1
vote
0answers
538 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
1answer
274 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
109 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
1answer
921 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 ...
0
votes
3answers
320 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
355 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
427 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
140 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 ...
2
votes
2answers
121 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
2answers
309 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 ...