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)

0
votes
2answers
56 views

Should I use DirectX 11 for 2d games or should I stick to DirectX 9? [on hold]

After two years now I wanted to continue working on my sandbox project which I actually used to learn and experiment with various C++ features and DirectX. So far I have simple elements for 2d ...
1
vote
1answer
76 views

How to rotate an object so that it is aligned with a vector?

I have the following Scenario: Two moving objects (A and B in the picture) need to appear "connected" by a third one (C in the picture). I set the position of the connecting object C as "halfway" ...
0
votes
0answers
36 views

Cannot understand behaviour of BoundingFrustum created from projection matrix multiplied by rotation matrix [closed]

I think that this must be something obvious, but I just cannot understand it. Please help. auto&& aspectRatio = 1.0f; auto&& distToNearPlane = 1.0f; auto&& distToFarPlane = ...
-1
votes
0answers
16 views

Find transform from vector to vector in Directx11

In order to draw a line i need trasnform matrix to draw vertex buffer properly. So, i 'm trying to find good way to find such transform. First, that i thought about was to find axis by taking cross ...
0
votes
1answer
33 views

How to disable depth buffer in Directx11

For now i know what i must use OMSetDepthStencilState. In the beginning i must create two states and change them every time i need another. For now i have this and it doesn't work, i.e. objects ...
0
votes
1answer
44 views

Drawing a Line in 3D using DirectX 11

I had a lot of problems to draw a line in a 3D and had a weird results.. The 3D Lines are projects in 2D and that's so weird. They only work with that view matrix configuration: XMVECTOR Eye = ...
1
vote
1answer
40 views

Why I don't have the DX templates even with the Windows 8 SDK installed?

I have Windows 7, 64 bit. I installed the Windows 8.1 SDK from here, and I installed Visual Studio Ultimate 2013. I chose to install everything; the size of the install was around 11GB. Yet I don't ...
1
vote
1answer
29 views

Per instance world matrix is 0.0f/NaN

I'm trying to draw some cubes with Hardware Instancing. However they don't get displayed. So I debugged my code, and found the source of the problem: In my VertexShader, the var that has the per ...
0
votes
1answer
34 views

Is this equivalent to D3DXVec3TransformNormal?

I was porting some code from DirectX to OpenGL. I have the following code: glm::mat4 rotation(1.0f); rotation = glm::rotate(rotation, degrees, m_up); m_look *= rotation; where rotation is a mat4 ...
1
vote
0answers
37 views

Modifying depth values in PixelShader (SharpDX)

I'm relatively new to DirectX, and am currently converting some WPF 2D graphics code that displays geo-located sonar returns. I am using SharpDX, and rendering via a D3DImage. I've got the basics ...
1
vote
1answer
59 views

How to diagnose the problem when the input assembler and the vertex shader look correrct, but the Output Merger is wrong? [on hold]

I'm porting some OpenGL code to Direct X 11. I ended up with nothing being drawn on the screen. I reverted to a simple program, which I am writing about here. I'm now trying to use the Graphics ...
0
votes
1answer
43 views

Compiling a shader with fxc results in invalid ps_5_0 output semantic 'COLOR0'

I'm attempting to compile a shader at the command prompt. What am I doing wrong that would make it generate this error? fxc /Od /Zi /T ps_5_0 /E "ps_main" /Fo "basic.pso" "basic.ps" Here is the ...
1
vote
2answers
83 views

DirectX Quaternion SLERP Wrong Answer?

I have some code that looks like this: DirectX::XMVECTOR a, b, c; a = DirectX::XMQuaternionIdentity(); b = DirectX::XMQuaternionRotationAxis(DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f), 3.1415f); c ...
0
votes
1answer
36 views

Normal Mapped Models Render with render target background color acting as transparency and lighting Problem [closed]

SOLVED. See my comment below. Originally I noticed some sort of transparency when rendering in Direct3D 11. I noticed it was worse once I changed my background color to something other than black. ...
0
votes
0answers
61 views

Trying to bounce a box with a plane using bullet physics

I'm trying to simulate a box that bounces with a plane and I'm beginner with bullet physics. I created a plane (box) and and a box that is falling. The problem is the ball is stalled while colliding ...
0
votes
1answer
44 views

Camera stops moving forwards near World-Center

So basically this is a problem I've been having since forever. I implemented a Camera System, it works fine but somewhere around the center (0, 0, 0) of the world it doesn't work. Actually it works, ...
1
vote
1answer
44 views

CopySubresourceRegion results in no-op

I'm having some trouble copying a subregion from a source texture (2D) to a destination texture. Both textures are mipmapped 2D textures, with dimensions (at mip 0) of 512 x 32. Rather than tell you ...
0
votes
1answer
139 views

SSAO all jagged

So I've been working on SSAO for awhile, and I thought I had it right, untill I loaded up the sponza scene that accompanied the SAO technique I'm implementing ...
0
votes
0answers
29 views

Collada 3d file type

For animations in the Collada file type. How does it store them? I'm reading them in with Assimp and I got the keys. mNumPositionKeys = 24. I made the animation and it had 24 frames. But only 2 were ...
0
votes
1answer
103 views

Animation, Interpolation, & Structure

I have been working on animation in my small game engine recently and I am implementing some interpolation to be used with skeletal animations. I know how to do interpolation but I am not sure where ...
2
votes
1answer
111 views

Shader - Transmittance or Absorption

I am trying to create a transmittance or absorption shader (glsl, hlsl, cg, etc...) in realtime but I don't find any good tutorial or white paper about this subject. I only find offline rendering ...
0
votes
0answers
40 views

Getting a Rect of a SpriteBatch

I'm using DirectXTK, https://directxtk.codeplex.com/wikipage?title=SpriteBatch it's a port of XNA spritebatch. I'm trying to get a bounding rect of my sprite for testing collisions AABB. I draw ...
0
votes
2answers
128 views

How should I fix a graphic glitch caused by t-junctions when using greedy meshing

As you might be able to see in the following image, a "graphic glitch" occurs between triangles. I know you are able to make this less visible by enabling anti-aliasing but i was wondering if there is ...
0
votes
1answer
29 views

D3D11_SAMPLER_DESC::MipLODBias vs ID3D11DeviceContext::SetResourceMinLOD

When implementing a max-texture-detail functionality for a game, which approach is better to use, out of: Setting the D3D11_SAMPLER_DESC::MipLODBias value of a sampler state object, or, Setting the ...
0
votes
1answer
62 views

FBX SDK texture file name

I have built an importer that retrieves necessary vertex data however I wish to be able to read texture file directories. How do I retrieve the texture file name?
0
votes
0answers
91 views

How to use D3D11_SHADER_RESOURCE_VIEW_DESC.Buffer.ElementWidth?

If I want to create an ID3D11ShaderResourceView* to a buffer with a given DXGI_FORMAT (e.g. DXGI_FORMAT_R32G32B32), do I have to also supply a value for ...
0
votes
1answer
45 views

IDXGISwapChain::ResizeBuffers - should I recreate the depth/stencil buffer too?

When I resize the buffers via IDXGISwapChain::ResizeBuffers(), it is required to release any references to views to the back buffer. That of course makes sense, because the back buffer texture is ...
1
vote
0answers
97 views

How to setup a particular blend state where the alpha channel is additive?

I would like to set a blend state to be "additive" and do the following: Result.R = Source.R + Destination.R; Result.G = Source.G + Destination.G; Result.B = Source.B + Destination.B; Result.A = ...
0
votes
0answers
48 views

marshaling c# struct with array to const buffer

I am trying to use a const buffer to pass a structure with an array of values into the pixel shader. However, all my color[] array values are coming in as zeros. I have the struct defined as: ...
0
votes
0answers
51 views

Depth Map not rendering properly in DirectX / HLSL / SharpDX

I've been struggling with this for awhile, and everything I find online says this SHOULD be working, but I apparently missed something. I'm attempting to run Deferred Rendering in SharpDX on a ...
0
votes
0answers
84 views

Particle System Tracking

I have a particle system where instead of tracking the time each particle is alive, I just track the time of the oldest particle and the time of the youngest particle. Basically, the oldest particle ...
2
votes
1answer
111 views

How to share values between different shader programs?

I am using Unity but this might concerns all type of shaders. I would like to know if this is possible to share values between different shader pass.Let's imagine that I am computing something in the ...
0
votes
0answers
50 views

How to translate vertex buffer coordinates in 2D

I am trying to (using a 2D Directx9 engine library) rotate/translate a set of points in a vertex buffer. I understand how this would be done in a 3D system - i.e using the vertex shader stage of ...
0
votes
0answers
49 views

Having trouble getting shader to work with sprite batch in XNA #4

I found a neat "CRT screen" effect shader on the web, but I've never used shaders before and I can't seem to get it working properly. If I do the second sprite batch in my code here normally without ...
2
votes
0answers
100 views

SSAO and normal issues

I'm using a SSAO alghorithm called "SAO", seen here: http://graphics.cs.williams.edu/papers/SAOHPG12/ I'm currently having issues with "smooth" normals, for example when using normal/height maps. To ...
3
votes
2answers
172 views

Shader - Calculate depth relative to Object

I am trying to calculate depth relative to the object.Here is a good solution to retrieve depth relative to camera : Depth as distance to camera plane in GLSL varying float distToCamera; void main() ...
2
votes
1answer
54 views

How can I tint a Texture2D with a gradient?

I am working on a lighting system for my game. Instead of lighting each tile completely with only one color, I want to create a gradient on that tile so to make the lighting look more dynamic and ...
1
vote
1answer
75 views

Design question: best way to model and visualize a long grid of data [closed]

Perhaps some noob questions for a scientific application that you can assist with: I am trying to render a large, evenly spaced grid of data in 2D. The full data set dimensions could be anywhere from ...
0
votes
0answers
89 views

Shader - Objects Depth or Thickness

I am using Unity and would like to render the thickness of an object.My first thought was to use the ZBuffer and the depth but it is always depend to the camera, it seems legit.But I would like to ...
0
votes
0answers
39 views

Volumetric spotlight

Hy I'm working on the a volumetric spotlight into my engine(DirectX 11). I read quite a lot about it and would like to find a relatively quick solution. ShaderX3's approach dividing the light volume ...
0
votes
0answers
44 views

HLSL - Binary operations

I'm trying to do binary operations with integers in the hlsl code. For example: int n = 10 & 15; Binary value of 10 = 1010 and Binary value of 15 = 1111. With this, n = 10, because (1010 & ...
0
votes
2answers
56 views

Direct3D 11 - Mipmap level selection

When we sample a texture resource through an SSO in HLSL, how is the mip level selected for sampling; assuming the texture resource contains mips? The SSO has parameters that seem to be concerned ...
0
votes
0answers
33 views

How to render many regions from the same texture using UV mapping?

I tried to apply some things that look like a "texture atlas". I would like to load 1 big texture which includes many small textures, my goal is to render each texture separately. I tried to use UV ...
2
votes
1answer
61 views

Texture R8_FLOAT format?

I'm working on SAO (http://graphics.cs.williams.edu/papers/SAOHPG12/) and I want to store my ambient obscurance term (a value between 0.0 and 1.0) in a texture. When I did shadowmapping, I created ...
0
votes
2answers
94 views

Strange quaternion rotation

I was implementing some quaternion rotations in too my infant 3d game engine and the rotations were really strange? Excuses my cluelessness. Anyways this is what I have: static XMVECTOR ...
3
votes
1answer
160 views

In HLSL, what is the difference between “static const” and “#define” for constants?

So far I've been declaring all my constant variables as static const in my HLSL code, yet virtually every single shader example I've come across uses #define instead. I know the reasons I would I use ...
0
votes
2answers
103 views

Quaternion Rotation Help

So I'm making a little engine with DirectX 11 and C++. (Some other help from other API's as well) DirectX has this function XMMatrixRotationQuaternion(XMVECTOR quaternion). I know nothing about this ...
3
votes
1answer
79 views

How do I edit a Texture2D at run-time to visually indicate connected tiles?

I'm making a 2D sandbox game in C# and MonoGame, and I have a couple of tile sprites. These tile are loaded in-game as Texture2Ds. I want to have blocks visually connect to adjacent blocks. An ...
0
votes
2answers
64 views

How do I use the DirectX Extension-Library in Windows 8?

I need to use the extended DirectX-Library (D3DX...), but I am programming on Windows 8 (VS), so the DirectX 11-SDK is already included. However, it's included without the extension-library. Do I ...
0
votes
1answer
84 views

Constant buffer not updating

I'm trying to rotate models independently of each other however I cannot for the life of my figure out how. I have gotten to the stage of writing this: std::vector<int>::size_type st = ...