DirectX is a set of multimedia APIs from Microsoft aimed primarily at game developers. Popular APIs within the DirectX collection include Direct3D, XInput, and XAudio.

learn more… | top users | synonyms (1)

8
votes
3answers
511 views

How can I create a glitter effect?

I am trying to create a glittering effect for my realtime shader but I don't know how. Here is one example, and another example. What technique can I use to implement this?
0
votes
1answer
102 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 = ...
0
votes
1answer
40 views

DXUT getters are always null using DLL

I'm struggling with a problem for a while and I hope some of you can help me out. The title for this question is vague, so I will try to explain my problem as best as I can! I'm am creating a project ...
0
votes
1answer
54 views

Changing the maxDepth of viewport

Whenever I change the maxDepth of the viewport from 1.0 to say 300.0f (just for kicks), everything on my screen disappears. Why is that? Is there anywhere else I have to account for this change in ...
1
vote
1answer
53 views

Does `SetResourceArray` copy the data into the GPU?

I am trying to create multiple textures, and only several of them change every few frames. I don't want to have to copy in the whole array via SetResourceArray for just a few textures that change, ...
2
votes
1answer
88 views

How do we apply different textures to different faces generated via geometry shader?

I am trying to render a cube by starting of with one vertex into the shader, then geometry shader to expand into a cube, and then apply a different texture to each side. The part I am facing the issue ...
2
votes
2answers
124 views

Implementing Geometry Instancing in DirectX

I have a project that I'm doing in Managed DirectX (DX9) where I want to render lots of grass. My current method (many draw calls) is slow, but I've heard Geometry Instancing can fix that. I know ...
1
vote
2answers
172 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
2answers
118 views

Is there a way to optimize this 2D lighting effect shader? [duplicate]

I'm doing a little 2D game in C++ with Direct3D 11. In the game I want to render a sort of shadow that covers part of the screen: To do this I am using this pixel shader: float4 PS_Main( PS_Input ...
1
vote
2answers
118 views

How can I render 3D dots at object vertex positions?

What is the best way to put a dot on a vertex? I have a model (a plane for example) consisting of a few thousand vertices. I want to draw a red dot at every vertex's 3D position, just like 3ds Max's ...
0
votes
1answer
146 views

How to get pixel coordinates between 0,1 from SV_POSITION [duplicate]

I am new to HLSL and Directx. I was trying to write a simple gradient Shader by modifying one of Microsoft samples. 1.I can not understand why SV_POSITION is float4? If it is pixel coordinates ...
1
vote
1answer
72 views

How do I determine color resolution of an output in DXGI/D3D?

i'm was revising some code i wrote some time ago when working on the window wrapper for my rendering framework. The framework is based off DirectX, but it wasn't really using any D3D-related facility. ...
5
votes
1answer
197 views

How can I draw a perspective-correct quad?

I'm trying to draw a quad in 2D (in SharpDX, but that is basically XNA). But texture correction is not working, and I'm getting only an affine textured quad. I'm using BasicEffect to render it. ...
3
votes
2answers
114 views

How to fill/initialize D3D11_SAMPLER_DESC properly?

If I want to set explicitly every parameter of the structure I just do so and that's it. But what if I want to set only some of them and leave the rest with default values? I've seen in some tutorial ...
8
votes
1answer
259 views

DirectX error with older XP systems

I am a blind programmer, working on an audio game for the blind. I am using SlimDX, and it has been tested on dozens of systems from XP to Win 8.1. My code works on most systems just fine, but I ...
6
votes
2answers
255 views

Fixed Function vs Programmable Pipeline performance with many batches

In OpenGL 2.0 I can easily make 10,000 draw calls per frame (with state changes in between each call). However, if i try to do this in either OpenGL ES 2.0 or DirectX9 with shaders, my peformance is ...
2
votes
1answer
221 views

How to create texture using raw RGBA texture data without having to use LockRect

I was previously uploading textures to DirectX by creating texture in D3DPOOL_MANAGED and then calling LockRect to upload the texture data to DirectX. However, I have switched to using DirectX9 Ex, ...
0
votes
1answer
52 views

Multiplying matrices in HLSL

I have code that calculates a position like this in HLSL: output.ShadowPos = input.VertexPos; output.ShadowPos = mul(output.ShadowPos, gWorld); output.ShadowPos = mul(output.ShadowPos, ...
0
votes
0answers
24 views

Blendshapes workflow in mudbox

I am new to mudbox. I want to create a face with blendshapes. Currently my face has 24576 polygons on level 3. I would like to go to level 2 or level 1, ie lower than 6000, but there, detail suffers. ...
1
vote
3answers
109 views

Applying scale to objects appears to have little effect when close up.

I just started out with D3D 11. My goal is to write a cube voxel engine (Minecraft style). Actually it's working pretty solid already, but when I finally tried to change the size of my cubes, I ran ...
-1
votes
1answer
106 views

Dynamically updating a shader resource view which was loaded from D3DX11CreateShaderResourceViewFromMemory?

I've loaded up multiple images from my custom video format into a vector after using D3DX11CreateShaderResourceFromMemory. Inside the rendering loop it's not updating the shader resource view like I ...
0
votes
1answer
134 views

Why am I getting rendered rectangles that are off relative to their bounding rectangles in this code?

I am rendering different rectangles with the help of the DirectXTK (PrimitiveBatch) and surrounding them with a BoundingOrientedBox (DirectXCollision.h). For visualization I draw the corners of the ...
2
votes
3answers
122 views

Can I store D3D9 textures so that they don't consume process memory and also don't require “lost device” handling?

I have an OpenGL application that uses a lot of texture memory. While the texture is stored in the system memory, that texture memory is not part of my application process memory. When this ...
0
votes
1answer
99 views

Center directional light shadow to the cameras eye

I'm currently drawing my directional light shadow using this view and projection: XMFLOAT3 dir((float)pitch, (float)yaw, (float)roll); XMFLOAT3 center(0.0f, 0.0f, 0.0f); XMVECTOR lightDir = ...
0
votes
1answer
145 views

Anyone know the frames per second that IOS apps run?

Anyone know the frame rate that iphones, ipads, and even android mobiles run?
0
votes
1answer
110 views

Where does XNA 4.0 takes memory from to perform operations?

I found this question which talks around the question I'm interested in. In particular I focused on the line where the guys says that GraphicsDevice object is literally a representation of the ...
1
vote
2answers
132 views

How can I repeat a portion of a texture on a quad?

I want to repeat a selected part of the texture into a quad. I was looking at this thread, however the solution involved changing my HLSL. Is there any way to do it without changing my shader ...
1
vote
1answer
92 views

When creating the horizontal blur, how is the vertex shader being called for each pixel?

I am following this tutorial. I am confused as to why the VertexShader is being called each time for the PixelShader. I was under the assumption the VertexShader is called only 6 times during the ...
0
votes
1answer
100 views

Creating a 2D texture array for depth view

Following my question here, I decided to create an 2D texture array for all of my depth screen texture so that I can use them for shadows for all my lights. I'm having an issue setting it up, I'm ...
0
votes
1answer
114 views

Set Sampler states: Linear, Bilinear, Trilinear Filtering/Interpolation

How do you set each of these sampler states in the hlsl Linear filtering Bilinear filtering Trilinear filtering
1
vote
1answer
152 views

How to create and populate a 2D Texture Arrays in DirectX11

I have generated a bunch of ID3D11ShaderResourceView that are a 2D textures that have a depth map screen shot for my lights shadows. I would like to take all of these textures and put them into a ...
1
vote
3answers
184 views

Is it possible to gain performance by omitting vertex normals in the GPU pipe?

I am working on a rendering problem where I want to render as many raw triangles to the screen as I can with either OpenGL or DirectX with the absolute fastest performance possible. I wondered about ...
1
vote
1answer
136 views

How does HLSL handle clip(vector)?

My goal is to convert clip() to GLSL, version 1.5. I'm currently doing a basic: if (x < 0) discard; But if x is not a scalar, obviously I can't use the "<" operator. So I'm wanting to ...
1
vote
2answers
252 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 ...
3
votes
1answer
174 views

Multiple pixel shader passes

I currently have a pixel shader that calculates the texture and I have another that calculates the light. I want another shader that does both. What I would ideally like to do is instead of creating a ...
1
vote
1answer
90 views

Basic DirectX app creates whistle noise

I'm in the process of learning DirectX and in the book examples they have a very basic application which sets up DirectX and displays a blank screen. When I run this app however my computer starts ...
1
vote
1answer
113 views

Does HLSL implement Shader Model LOD instruction?

The DX Shader Model 5.0 has a lod instruction. It returns "the LOD (level of detail) that would be used for texture filtering". Does HLSL have a built-in intrinsic that can do the same? I know I ...
0
votes
1answer
101 views

DirectX11 Linker error

I'm in the process of learning DirectX and in the examples supplied with the book I get the following error: Error 29 error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match ...
0
votes
1answer
162 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
118 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 ...
1
vote
0answers
32 views

When to clear an auxillary render target

I'm using a few different render targets in my game in addition to the back buffer. These other render targets are only used in a few places, for specific tasks. I'm wondering when I should be ...
0
votes
2answers
82 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
94 views

How do I create an efficient long, pannable, sprite-animated scene in a Windows Store game?

I am creating my first Windows Store application in XAML, and I cannot seem to find a proper example for the requirements I have. The basic idea of the app is to have a large scrollable canvas which ...
0
votes
2answers
114 views

Accesing depth buffer from shader

I read this presentation and on 6th slide I found that is not need to use multiple render targets and depth can be taken directly from depth buffer. From which version of DirectX or OpenGL can be ...
0
votes
1answer
85 views

Why isn't my other two constant buffers being updated to the shader?

I posted previously before about my two dynamic buffers not being dynamically updating the constant shader. The tessellation buffer isn't working because I have to manually update the tessellation ...
1
vote
3answers
309 views

Bouncing ball isssue

I am currently working on the 2D Bouncing ball physics that bounces the ball up and down. The physics behaviour works fine but at the end the velocity keep +3 then 0 non-stop even the ball has stopped ...
2
votes
1answer
194 views

Resource management

I've come across a strange thing in DirectX 11: I'm trying to implement large scale volume visualization engine. My approach is like this: if the volume is HUGE (could not fit to GPU memory ...
0
votes
3answers
204 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
236 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 ...