Tagged Questions

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
17 views

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

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. I also created a simple exporter ...
0
votes
0answers
16 views

Formal parameter with _declspec(align(16)) [on hold]

I am currently trying to learn DirectX. So I was using one of the old templates from my teacher where everything is set up. As I am done with the course, I am moving away from these things I renamed ...
0
votes
0answers
44 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
39 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, ...
0
votes
0answers
46 views

Engine Lighting issue [closed]

i have question since i'm learning Directx 11 and i've just wrtitten an HLSL-file, but i don't fully understand how it should work and to incorporate it into my code. Can anybody explain to me how it ...
1
vote
1answer
31 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
101 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
23 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
69 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
103 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
35 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
123 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
22 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
46 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
62 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
36 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
92 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
35 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
38 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
78 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
101 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
39 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
35 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
84 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
163 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
49 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
70 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
68 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
33 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
43 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
45 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
30 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 ...
1
vote
1answer
44 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
87 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 ...
2
votes
0answers
135 views

HLSL defines vs static const

So far I've been declaring all my constant variables as static const in my hlsl shader code, yet virtually every single shader piece I've come across uses #defines instead. I know the reasons I would ...
0
votes
2answers
96 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
77 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
56 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
60 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 = ...
1
vote
1answer
71 views

Static constants set to default value in HLSL

I'm using dx11 and I'm working on SSAO. I am having wierd results, so I tried debugging it using RenderDoc and stepping through the pixel shader log, all the values of the static array seems to ...
1
vote
2answers
271 views

Directx fbx loader

I am trying to build a game with animation in c++ with DirectX. I have some fbx files with animation that I want to integrate in my game. But I do not want to draw the fbx files as a FbxScene or ...
0
votes
1answer
52 views

Diffuse Maps and DirectX

How would I load two diffuse maps onto one mesh. I have a mesh with multiple sub meshes but each one of those sub meshes has a vertex buffer and I don't think that's very efficient. How could I have ...
0
votes
1answer
67 views

How to take a screenshot with java from directX

I'm looking for a way to take a screenshot with a Java application of any running directX game. I use the following code Robot robot = new Robot(); GraphicsConfiguration config = ...
1
vote
1answer
107 views

How to handle game objects in DirectX

Coming from XNA, I would use the content pipeline and create XML files for game objects. However, if I changed something in the XML, I would need to do a rebuild of the project so it will create the ...
0
votes
1answer
101 views

Ambient occlusion: Correct culling after anisotropy correction

I've added simple color based ambient occlusion to my game. First it looked like this (from giawa.com): The description: "Due to anisotropy, the ambient occlusion shading on the top left is ...
2
votes
0answers
90 views

Enable IME in a non-windows control

I'm writing my own game in DirectX using C#. I'm at the point where I'm implementing my own textbox, written from scratch. It has the very basic functions for now, but works well. I want, however, to ...
0
votes
1answer
66 views

HLSL SampleCmp compile error

When trying to compile the following HLSL: Texture2DArray gShadowmap : register(TEXTURE_REGISTER_DEPTH); SamplerState gShadowmapSampler : register(SAMPLER_REGISTER_DEPTH); // ... float3 projCoords ...
4
votes
2answers
183 views

How can I manually construct a right-handed orthographic projection matrix?

I need the formula to create a orthographic projection matrix. I am using GLM math libary and DirectX11. The reason I cannot use GLM to create it is because the NDC spaces are different between DX11 ...
1
vote
2answers
225 views

How to detect graphics API at runtime with SDL2?

Using SDL2, is there a way to determine at runtime whether the application is using OpenGL, OpenGLES, or DirectX? EDIT: If there is a way to figure it out without using the SDL2 API, I'm willing to ...
0
votes
1answer
60 views

Deferred Lighting - How to map to the generated texture?

I'm trying to implement deferred lighting and I have done the first and second pass but I'm stuck on the third as I don't know how to map from the current pixel being drawn to the generated texture ...