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
0answers
21 views

OpenGL shaders with OOP languages and game engines [on hold]

Is it okay to encapsulate all the dirty shaders codes inside a class object, and then let the user call easy methods such as Render()? I've done this with a simple Skybox object and I wonder if this ...
1
vote
2answers
62 views

Could I use Direct3D to make 2D games?

My goal is to make a completely 2D game using DirectX, but I'm new to it and I'm confused about all of the different APIs that are available. From Wikipedia: Direct3D is used to render ...
0
votes
0answers
28 views

Frustum Culling not working when objects are transformed

I've been implementing some frustum culling and my code looks like this. // Frustum Culling XMVECTOR detView = XMMatrixDeterminant(cam->View()); XMMATRIX invView = XMMatrixInverse(&detView, ...
-3
votes
0answers
29 views

Decode webm video to DirectX Texture [closed]

I am loooking for a library or sample code that decodes a webm video to a DirectX texture. I know that everything in webm is open source and it's just a matter of implementation. But before I do the ...
0
votes
1answer
62 views

Instancing effectiviness

At about how many instances would instancing become effective? DirectX dynamic buffers seem to take a little more out of the fps than an immutable one would. So obviously you wouldn't want to make a ...
1
vote
0answers
21 views

rendering an image within c# & sharpdx dirext3d9 [game overlay]

I'm following this guide and the related blog post to implement a basic game overlay for DirectX 9 games using SharpDX. So the tutorial already have an example for text rendering but I need to be ...
1
vote
0answers
72 views

DirectX graphics issues [closed]

When you see something that looks like this And it's actually supposed to be like 100 models of asteroids. What would you say is wrong with it? Index Buffers messed up. Vertex Buffers? Projection? ...
0
votes
1answer
43 views

DirectX 8.0 SDK

I know this in unprofessional and probably doesn't follow the question asking conventions on this site, but I cannot find any other, more suitable (in my opinion) network on stackexchange to ask this ...
0
votes
1answer
40 views

What are .fxo and .cod files for?

I've been reading about shaders and looking at code. I found this in the code I'm looking at and it obviously has "Basic.fxo" there. BasicFX = new BasicEffect(device, L"FX/Basic.fxo"); Now my ...
2
votes
2answers
138 views

What are my options other than game engines? [closed]

I'm a programmer. I've experience in Java, python, and c++. I see that some big games are built using game engines (Crysis uses Cryengine). However, other don't (Bayonetta for example). what's their ...
2
votes
1answer
83 views

Signed Distance Fields: How are different colour channels used to improve output of sharp corners?

The naive approach to implementing signed distance field font rendering suffers quality issues where sharp corners get softened (either outward- or inward-facing corners, i.e. convex or concave ...
1
vote
1answer
61 views

Shader - Realtime texture masking

The first thing that comes in mind is masking using RGBA values. With this you can obtain this kind of textures and this kind of results. But with this, you can only store up to 4 masks inside a ...
0
votes
1answer
18 views

DirectX 10 - dimension of vertices passed to vertex shader

I'm trying to learn DirectX programming. Looking at different tutorials there is something about vertices that I find a bit confusing. I know that DirectX uses vertices with four elements (x, y, z, ...
1
vote
1answer
43 views

Draw multiple triangle strips in one draw call DirectX

I'm running into a bottleneck where I'm drawing many basic disconnected colored triangle strips in DirectX 9 (XNA). The problem comes with drawing them all in seperate draw calls, so I'd like to batch ...
3
votes
1answer
172 views

Is it more efficient to transform vertices on the CPU or the GPU?

Working on optimizing the rendering core of my game engine and I have a couple of questions. Is it more efficient to transform vertices to world space on the CPU before you send then stream to the ...
0
votes
0answers
22 views

Encoding Floats to RGBA and Blending causing artifacts

I am using float packing to encode a float value inside a RGBA texture because I don't have access to float texture unfortunately. Here are the function I am using for encoding and decoding. inline ...
0
votes
1answer
28 views

Encoding Float to RG/RGBA and Blending

Encoding a float value inside a RG or RGBA texture is very interesting and useful but it is also become quite useless when you use blending as the result and the values might be altered because of ...
0
votes
1answer
43 views

How is this particular HLSL condition treated with respect to compile- or run-time evaluation?

Let's say I have this very simple pixel shader (cbuffers and other stuff omitted) float4 PS(VertexOut pin, uniform bool useLighting) : SV_Target { float4 retColor = gDiffuseMap.Sample( sampler0, ...
0
votes
2answers
130 views

Can someone explain to me how setting shader parameters aren't a bottleneck?

I am trying to understand this. So I have a bunch of models that need to be rendered. Each model most likely has various "sub meshes" with their own diffuse, specular, etc textures. So for each of ...
0
votes
2answers
87 views

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

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
86 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
1answer
37 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
57 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
48 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
32 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
40 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
52 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
62 views

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

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
65 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
92 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
42 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
72 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
51 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
149 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
30 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
131 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
116 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
44 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
130 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
33 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
73 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
101 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
52 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
102 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
57 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
68 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
85 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
119 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
63 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 ...