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)

1
vote
1answer
47 views

How does one calculate color intensity?

How do I calculate color intensity if I have a image sample of RGB? The sample is of a float3 of red, green, blue. I'm trying to do a bilateral blur and have to not change the image if the color ...
6
votes
1answer
151 views

How can I speed up this HLSL shader?

I have written a lighting shader file that is used as the fragment shader part of a deferred lighting pipeline. Unfortunately, each iteration seems to be adding 0.5ms to my frame time, so any more ...
1
vote
2answers
87 views

How to rotate camera using mouse?

I'm looking for a basic example of rotating camera using the mouse. the only problem is I'm not sure of how to rotating the camera around it target. should i do this by an algorithm or is there a ...
0
votes
1answer
34 views

Storing and rendering Mesh Data in stl container

I'm trying to refresh my DirectX11 knowledge, and ran into a problem while trying to render multiple meshes instanced. What I want to do is give my ObjectManager class the name of an .obj file and it ...
3
votes
2answers
41 views

DirectX11 Using Multiple Shaders

I currently have a scenario where I am rendering terrain with a shadow map. I have two passes, one for the depth buffer to create the shadow map (which is rendered to a texture) and a second that ...
0
votes
0answers
20 views

DDS DXT5 texture doesn't render alpha correctly

I have an issue with how dxt5 textures render alpha. I have a source png with alpha gradients which is converted to dds with NVidia tools. Then is loaded in engine correctly but shows alpha pixels ...
2
votes
0answers
69 views

Jagged light bleeding where surface is roughly parallel to shadow mapping light direction

I am using Unity but this question might not be proper to this engine. I have projected the shadow map onto this sphere but there are grazing shadows. Is it possible to avoid it or to correct it as I ...
3
votes
1answer
36 views

Vertex normals in the geometry shader using directx

I'm in directx 11 with the geometry shader. Is is possible to calculate vertex normals? Just one like segment per vertex? In the geometry shader? I did vertex normals per face, this is what I got, ...
1
vote
0answers
11 views

Cannot obtain correct bone transform matrix data

I tried to obtain bone transform matrix for animation implemented with Directx11 and FBX sdk. I found this function in some web resources: fbxCluster->GetLink()->EvaluateGlobalTransform(); // ...
0
votes
1answer
17 views

Distance per mesh in HLSL directx

I'm subdividing a sphere so when distance gets greater, the sphere is subdivided less to save memory. The sphere changes to another sphere when the distance is 10. My problem is that only one ...
0
votes
0answers
45 views

Unity - _LightMatrix0 and Directional Light

I am trying to access the _LightMatrix0 in a forward base pass to calculate some light point of view coordinate but it seems that the _LightMatrix0 is empty with directional light. Any idea how can I ...
1
vote
0answers
24 views

Loading FBX Files into a DirectX 9 Application

I'm having an extremely difficult time trying to convert an FBX file into a format that can be used with DirectX. I've read a lot of articles on forums all over the internet and have followed ...
1
vote
2answers
42 views

Subdivision of a triangle in HLSL

How can I subdivide a triangle more than once. I can not use recursion as directx 11 hlsl will not allow it. Are there any links to a HLSL code. This has to be done in the geometry shader as my book ...
0
votes
0answers
56 views

Cubemap texturing issue D3D11 (C++)

I have a texture problem with the cubemap I'm rendering and can't seem to figure it out. I've generated a cube map with direct x's texture tools and then read it using ...
0
votes
0answers
24 views

Shader - Directional Lights Depth

Is there a way to retrieve the deph from directional lights ? I can access the _ShadowMapTexture but this is not the depth. I found how to access the shadow map of, I think, every light type by using ...
0
votes
1answer
32 views

Unity - Access to svPosition in fragment shader

I am trying to access to the svPosition in my fragment program in Unity but I keep having this error. invalid input semantic 'POSITION': Legal indices are in [1,15] invalid ps_3_0 input semantic ...
1
vote
0answers
44 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...
1
vote
2answers
47 views

What's the reasoning behind using “redistributable” packages?

On Windows, many if not all games require some DirectX package and some VC++ runtime. Others also need OpenAL, wmfaredist, nvidia physx, windows live and probably others. I'm trying to figure out why ...
2
votes
1answer
56 views

How to store renderer vertex / index data in scene graph objects?

I have a SceneNode class which contains a Mesh instance. The Mesh class stores client side information such as vertex and index arrays (before they're uploaded to the GPU). I also have an abstracted ...
0
votes
0answers
17 views

Is it possible to Change the vertex format of a Model from line list to Triangle strip using DirectX

So I have a DirectX game library and using DirectX models in a game I am developing. All the models I am using have a Triangle Strip topology and thats fine as ID3DXMesh uses triangle strips for ...
1
vote
0answers
27 views

Direct3D11: Directional Shadow Maps

I've recently implemented shadow maps on my project. However, I'd like to add a feature that allows the light direction to be dynamically changed, so that the terrain can be viewed using different ...
3
votes
0answers
31 views

How to link assimp lib to universal app

I cannot make assimp object loader work with universal app, and I got the same problem as this one: Assimp and directX12 universal apps I tried the static library approach mentioned in the answer of ...
3
votes
1answer
65 views

How to determine what color will be written into single pixel framebuffer?

I thinking about rendering into single pixel (1x1) framebuffer. For example we have two triangles which covers whole NDC area, one is green second red. What color will be written to 1x1 framebuffer? ...
3
votes
1answer
48 views

Issues with depth calculation in HLSL shader

I'm currently trying to implement shadow maps in my graphics framework. I ran into an issue with depth calculations I wasn't able to solve myself (yet). I did a lot of testing and debugging and think ...
0
votes
1answer
21 views

Texture being stretched when using D3DTADDRESS_CLAMP

I'm trying to create a skybox using a cube and using one of this textures: http://forum.unity3d.com/threads/mundus-skybox-pack-01-released.202748/ I've got it working well, but I noticed there are ...
5
votes
2answers
223 views

What are other sources of screen tearing?

I have a DirectX11 based engine / application that is showing screen tearing on a certain system. The system has a large TV monitor with a GTX 980 graphics card. The tearing tends to happen in ...
1
vote
1answer
58 views

Rotate camera with quaternion around axis going through the origin

I am trying to implement my own third person camera using quaternions in DirectX. I first wanted to check that the camera rotates as expected so I started to rotate it around the world y-axis (0,1,0) ...
3
votes
1answer
44 views

How can I get projected coordinates of vertex on screen

I want to check picking for faces and for that I need projected X Y coordinates of my vertexes in -1 to 1 range: For that I multiply my vertex array with matrices and then get projected triangle ...
3
votes
1answer
74 views

Getting rid of texture bleeding

Edit: I figured out what problem I was facing, it's called Texture/Pixel bleeding, which I was not aware of yet. I posted an answer below consisting of a small description of the problem and a link to ...
1
vote
1answer
97 views

Quaternion rotation problems [duplicate]

I want to rotate my model and I have X and Y rotations. Here is my code: D3DXQUATERNION q, qrotation; D3DXQuaternionRotationAxis(&q, &D3DXVECTOR3(1.0f, 0.0f, 0.0f), ...
2
votes
1answer
61 views

How can I use shaders in Unity to write a scientific computing program?

I want to write a GPU shallow water code on Unity3D. For sure, performance matters a lot. I've done this before using DirectX and C++. But for a couple of reasons I want to redo it in Unity3D. I ...
5
votes
3answers
259 views

How to pass rendered frames from OpenGL to DirectX 11?

I have a dll that does some rendering using OpenGL. I need to render it to a texture and use that texture in direct x 11. My current attempt has been to render the OpenGL to a texture on one ...
2
votes
0answers
81 views

Scene Graph: Does anybody have a real world example?

I'm trying to wrap my head around how scene graphs work, and how to apply that to my game, in the context of all my game objects, including assets, cameras, units, shaders, etc. All I can find are ...
1
vote
0answers
36 views

applying two Vertex shaders on two model with the same pixel shader

i want to apply two HLSL vertex shader on two different models but with the same pixel shader. what i've done is wrong but i didn't know how can I use both vertex shader with one pixel shader (and i ...
3
votes
0answers
37 views

Perspective division by zero yields unexpected results

Usually, this is how a shape in clip space is defined: [0.25, 0.25, 0.0, 1.0] [0.25, 0.75, 0.0, 1.0] [0.75, 0.75, 0.0, 1.0] [0.75, 0.25, 0.0, 1.0] After perspective division to NDC space the result ...
3
votes
0answers
45 views

Nothing drawn in Window, not even the clear color

A few years ago I have followed RasterTek's Direct3D11 tutorials to create a simple application in C++. I'm not trying to convert this very simple sample to C# using SharpDX. I've got the Window ...
3
votes
1answer
154 views

Is there a way to bypass Directx Effect Files?

I am now trying to abstract my rendering pipeline, and I've been able to abstract OpenGL fairly easily. But now I have ran into a rather ugly problem with Directx. Most of my knowledge about Dx9, 10, ...
1
vote
1answer
146 views

How do I render a 2D overlay with DirectX 9?

I'm working in C++ with DirectX 9 on a 3D game, but I want a 2D overlay for rendering a HUD. I've heard that I could use D3DXMatrixOrthoLH, but I'm very confused on how to use it. I'm more familiar ...
1
vote
0answers
38 views

Textured trapezoid in Monogame DirectX

I'm working on a 2D game, so most of the graphics are sprites. However, some elements are drawn using trianglestrips in Orthographic projection. The thing is that I can't do a 3D projection because ...
3
votes
1answer
70 views

Separating rendering from HWND

I'm considering separating my game simulation from the message loop. It seems odd to me to have other systems tied directly to the window in which my game is running. Most examples I see are ...
1
vote
1answer
30 views

Modifying alpha of pixels in sufrace/texture

I have a texture who's surface I've loaded with an image. Some areas of this image are completely transparent (alpha = 0), some completely opaque, and some are somewhere in the middle. The issue I'm ...
3
votes
0answers
23 views

Combining two surfaces

I have two surfaces. One is the back-buffer, the other is a surface with some user-interface overlay graphics already rendered onto it. Both surfaces have identical properties (size, format...etc). I ...
2
votes
1answer
28 views

Windows Phone 8.1 Monogame Content.Load<Effect> exception

need some help, just trying to load compiled .fx (.xnb) file by monogame (version 3.4.0.456) in Windows Phone 8.1 enviroment by this code MainEffect = Game.Content.Load<Effect>("chessboard"); ...
2
votes
1answer
97 views

In My Direct2D Gui System, Is It Safe To Use A Bitmap Render Target Per Gui Element?

I am trying to implement a relatively simple GUI system for use in a few simple games. In this system, all Gui elements extend BaseControl. BaseControl has an update and draw method, as well as ...
1
vote
0answers
31 views

What is Purpose of pIntermediate in UpdateSubresources?

DX11 used ID3D11DeviceContext::UpdateSubresource but now DX12 seems to use a new method UpdateSubresources. I think I can figure out most of the differences between these two functions but the ...
2
votes
1answer
102 views

How can I recover polygons and normal maps from compiled games through emulation of D3D or OpenGL?

I am trying to generate labeled training data for an artificial visual cortex to learn on. I'm looking for a tool that will, instead of rendering the scene at each pixel just give me the pre-rendered ...
1
vote
0answers
24 views

DirectX 9 Light projection

I am trying to see changes of component 'z' from light space. In vertex shader component 'z' divide 'w' is not 0. But after sending float4 with texcoord1 to pixel shader its 0. All matrices are good. ...
2
votes
2answers
89 views

If IDXGISwapChain::Present blocks, does that mean I'm GPU bound?

I updated my DirectX11 renderer to render on multiple threads using deferred contexts. Before my change, the Present method took a negligible amount of time (according to VTune analysis). After my ...
1
vote
1answer
51 views

View Matrix to Texture Matrix

I'm converting view coordinates to texture coordinates for both my shadow maps and Screen space reflections. I keep seeing this conversion in examples: var T = new Matrix { ...
1
vote
0answers
31 views

Is it normal in skeletal animation to NOT consider the translation component in bone transform matrices?

I'm using assimp to load a model, and DirectX11 and DirectX ToolKit to render it. In the document of DirectXTK's IEffectSkinning, it says: As an optimization, SkinnedEffect and DGSLEffect assume ...