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
1answer
98 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 ...
0
votes
0answers
534 views

How can I avoid anti-aliasing on lines rendered with Direct2D? [on hold]

I am using Direct2D to draw all the my 2D graphics and uses Direct3D for all the 3D graphics. Whenever I draw 2D lines there is anti-aliasing issue which is clearly visible; to fix it I tried using ...
0
votes
1answer
109 views

DirectX9 Drawing Sprites out of place due to offset

This is my very first time into DirectX. Im trying to make a simple 2D game, just for learning the basics. And i've achieved that. The next step is to draw an animation using sprites. For that, i ...
3
votes
1answer
159 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
0answers
31 views

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

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 = ...
0
votes
1answer
80 views

What is DirectX 11's equivalent of D3DCAPS9::MaxVertexIndex of DirectX 9?

I'm porting a DirectX 9 program to DirectX 11. How do I get the value in DirectX 11 that is retrieved using D3DCAPS9::MaxVertexIndex in DirectX 9? Thanks in advance.
0
votes
1answer
137 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 ...
3
votes
1answer
4k views

Teamviewer doesn't show my game screen

I've been building a 3D engine from scratch using C# and I've tried to show the result to a friend of mine using Teamviewer. When my demo game starts he doesn't see it. He can only see the last active ...
1
vote
1answer
43 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
41 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
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
28 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 ...
2
votes
1answer
1k views

Reading from a staging 2D texture array in DirectX10

I have a DX10 program, where I create an array of 3 16x16 textures, then map, read, and unmap each subresource in turn. I use a single mip level, set resource usage to staging and CPU access to read. ...
1
vote
1answer
38 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
27 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 ...
-2
votes
0answers
19 views

Incorporating Rastek light issue [closed]

Hello i have a few issues with Directx, i am trying to make diffuse light work whithin my code. But the book i have doesn't really work for me and i'm now trying incorporate the light from Rastertek ...
0
votes
1answer
32 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
34 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 ...
2
votes
1answer
59 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
1answer
510 views

How do I determine the look-at vector of a free-look camera?

I'm trying to create a free-look camera with DirectX 10. I've figured out how to get the directions for forward and back and left to right. However, I don't know how to rotate the look-at vector of ...
1
vote
1answer
58 views

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

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 ...
1
vote
2answers
82 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
37 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 ...
0
votes
1answer
71 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 = ...
0
votes
1answer
35 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
56 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, ...
3
votes
1answer
161 views

Do shader program compilers optimise divide-by-PoT-constants to bitshift operations?

So just to restate that, let's say we have this: float f = g / 2; Given the divisor is a constant, will the shader compiler auto-optimise this to a bitshift operation, as some language compilers are ...
0
votes
0answers
27 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
2answers
126 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 ...
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
39 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
1answer
28 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
53 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
85 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
43 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 ...
0
votes
2answers
62 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 ...
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() ...
1
vote
0answers
96 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 = ...
2
votes
0answers
98 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 ...
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
44 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
50 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 ...
0
votes
0answers
46 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
46 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
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 ...
4
votes
1answer
133 views

Using sky for indirect lighting - should I remove the sun?

I'm attempting to achieve slightly more realistic ambient lighting in outdoor scenes using the sky cubemap. When rendering an object, I first calculate the direct lighting contribution using ...
0
votes
0answers
88 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 ...