Questions tagged [directx]
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.
117
questions with no upvoted or accepted answers
14
votes
0answers
1k views
SSAO and normal issues
I'm using a SSAO alghorithm called "SAO", seen here: Scalable Ambient Obscurance.
I'm currently having issues with "smooth" normals, for example when using normal/height maps.
To ...
7
votes
0answers
598 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 ...
6
votes
0answers
109 views
How many Pipelines in a Typical Rendered Scene DirectX12
I'm learning DirectX12 right now and I'm missing a few pieces of the puzzle in my own head on the overall structure of how you would setup a game. Specifically, I'm trying to get an idea of how ...
6
votes
2answers
2k 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. ...
6
votes
1answer
600 views
Why does writing to a D3DFMT_R32F render target clamp to 1?
I'm currently implementing a picking system. I render some objects in a frame buffer, which has a render target, which has the D3DFMT_R32F format.
For each mesh, ...
6
votes
2answers
722 views
How to display unicode text in monogame?
I'm looking for ways to draw any characters that may be entered in any language, on any keyboard, so that I don't have any trouble with limited language support in a monogame project.
So far I've ...
4
votes
0answers
116 views
Flicker when drawing multiple shapes over image based texture
I'm rendering video frames with multiple color filled shapes over it using SharpDx and D3D11.
Rendering seems to be fine when just rendering the video frame and is as expected.
Now if i draw a ...
4
votes
0answers
693 views
DX11 CreateTexture2D
When i want to load texture i can either call
CreateTexture2D without passing pointer to texture content passing Default usage and call ...
4
votes
0answers
51 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 ...
4
votes
1answer
621 views
Fog shader camera problem
I have some difficulties with my vertex-fragment fog shader in Unity. I have a good visual result but the problem is that the gradient is based on the camera's position, it moves as the camera moves. ...
3
votes
0answers
56 views
How would one get the pixel value of a texture under the cursor?
I have a requirement to detect which pixel of a texture is under the cursor in the 3D world. I assume that Ray casting is involved however, after that I'm not sure how one would accomplish this.
Can ...
3
votes
0answers
309 views
Reading depth buffer result in only two values
I am attempting to add an SSAO post processing shader to my deferred rendering engine. I am running into problems with reading from the depth buffer. In the images linked below you can see the depth ...
3
votes
0answers
277 views
Texture Mapping to procedurally generated geometry
How can I calculate texture coordinates of such geometry?
The angle shown in the image (89.90 degree) may vary, therefore the geometry figure is changing and is not always such uniform.(maybe like ...
3
votes
0answers
430 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 ...
3
votes
0answers
177 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 ...
3
votes
0answers
341 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
0answers
1k views
How to correctly synchronize a shared surface?
I am trying to share a direct3d9 surface between two processes. One process (let's call it A) writes to the surface, and the other (B) displays it on screen. Currently, process A does a StretchRect of ...
2
votes
0answers
22 views
How to get struct layouts from vertex shader input using ID3D12Reflection
I am attempting to write a code generator that builds C++ structs/classes from D3D12 reflection data built using DXC. Given a simple vertex shader signature:
...
2
votes
0answers
181 views
Import Quaternions from a different coordinate system to perform an animation (DirectX to 3ds/Maya)
I'm working on a tool to import a biped from a DirectX engine that uses Left-handed coordinate system to 3ds Max that uses a right-handed one.
I managed to achieve the initial positions of the biped ...
2
votes
0answers
118 views
DirectX 11 - Problem with low resolution decals
I'm trying to add a decal system in my DirectX engine but i'm facing some problems with the quality of the textures projected. Every other no decal texture look fine, but these ones look really bad.
...
2
votes
0answers
400 views
RWTexture3D in Compute Shader on Intel HD 4000
I'm having some weird issues running a Compute Shader with DirectX 11 on an Intel HD 4000 GPU.
The goal is to write different shapes into a DXGI_FORMAT_R32_FLOAT 3D Texture with a size of ...
2
votes
0answers
231 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 ...
2
votes
0answers
3k views
How to rotate a 3D instance using an HLSL shader
I'm experimenting a little with HLSL shaders. I have the following code for a vertex shader, it is used to render a few instances of a 3D model. Let's say I want to rotate these instances on their Y ...
2
votes
0answers
601 views
Directx 11 full screen
I build simple directx 11 application in c++ that draw square to screen.
Also check in the end of the program when I close the last peace of directx the number of free reference.
This work great in ...
2
votes
0answers
345 views
Chunk Texture3D GPU generated vertices
I read GPU Gems 3 from NVidia about procedural terrain.
It's quite interesting but not applicable for me because I only read the online version without the shipped ...
1
vote
0answers
155 views
How do I prevent my game from being detected as a virus?
I developed my own game engine and I'll refer to it as a Software Development Kit (SDK) here, for making a specific type of game.
The SDK encapsulates low level DirectX APIs. It's written in C++ and ...
1
vote
0answers
36 views
How do I render halfspace fog?
How do I render halfspace fog? From my interpretation, I have a transparent plane in the scene. Then I use a function that returns a fog color in my shader.
Do I render the transparent plane by itself ...
1
vote
0answers
76 views
My arcball camera does a roll when it shouldnt be
I am trying to build an arcball camera and it's mostly working, the problem is that as you rotate around the object you have selected (orbit_target_pos in the code),...
1
vote
0answers
53 views
Directx 12 ultimate. What has changed?
We have Windows 10 2004 with new sdk, we have new nvidia drivers with support wddm 2.7 and Dx12U but I still can't understand - how it should help to developers write one code for all platforms?
I don'...
1
vote
0answers
22 views
My triangle disappears when multiplaying by my perspective projection matrix
Whenever I multiply my transformation matrix, which is passed to the shader via constant buffer, my triangle disappears. Here is the code for the passed matrix:
...
1
vote
0answers
123 views
HLSL DXGI_FORMAT_A8_UNORM Texture - dark colors appear less opaque than white
I am trying to render a DXGI_FORMAT_A8_UNORM texture (precisely, a font bitmap) in multiple colors by specifying the color per vertex and then apply the alpha value ...
1
vote
0answers
43 views
How do I get the proper swapchain enumeration for getting the backbuffer?
I have code that I'm trying to update from DirectX 8, and so far I have been doing just fine until I reached this line of code:
...
1
vote
0answers
390 views
Is there a quick-reference card for HLSL (DX9 or DX11)?
Does anyone know of a DX9 or DX11 counterpart to the GLSL quick-reference card from Khronos? The GLSL card is pages 8-11 here, and lists preprocessor directives, operators, types, and builtin ...
1
vote
0answers
194 views
What's wrong with my normal mapping, and how can I fix it?
I'm trying to implement Normal Mapping in Directx and I'm very close to creating it but I'm getting these weird black colors on some objects. This is how it looks like without the Normal Mapping:
And ...
1
vote
0answers
112 views
dx Shader Model 3.0 break, continue, and loop attributes not recognized
I've been stuck on this problem for just too long. Long story short, the compiler returns "syntax error: unexpected token" for break, continue, [loop], [unroll] and pretty much every other attribute.
...
1
vote
0answers
62 views
Why do I are my quads outlined when rendered?
I have a 3x3 quad wall I am rendering to. I render to a 3x3 because the complete image exceeds the maximum single texture limit. So I've cut the image into a 3x3.
The issue I'm having is that when ...
1
vote
0answers
50 views
Can sampling an input texture in shader return values updated in same pass?
In my hlsl, (I am using Direct2D helpers which I guess just call tex2D), can D2DSampleInputAtOffset() return a pixel value that was only updated in that same pass ...
1
vote
0answers
463 views
Directx D3D9 fails to render a primitive on a RenderTarget surface
So for some reason DrawPrimitive() doesn't seem to work with my render target surface.
...
1
vote
0answers
203 views
Automated animation retargeting
I am currently developing a video game using my own game engine I develop at the same time. While making a good progress in the past months, I am currently stuck. I assume I only miss a minor thing, ...
1
vote
0answers
60 views
Controllable color blending?
I'm relatively new to color blending in DirectX, and I'm hoping there is a relatively simple answer to this question. I am targeting Direct10.1.
What I am trying to achieve is colour blending of two ...
1
vote
0answers
43 views
Light intensity on plain from angle
Given a vector (v) for the direction of light and a vector (n) for the normal of a plain.
How can I calculate a rudimentary intensity value (i) where
...
1
vote
0answers
527 views
1
vote
0answers
104 views
Translate D3DXMatrixLookAtLH to Unity compatible code
I am currently trying to port a really old Game (I have the source of it) to Unity as a fun project. And I'm currently stuck with the object rotation techniques in Unity compared to the ones used in ...
1
vote
0answers
867 views
Why does reverse depth buffering provide more precision? (with DXGI_FORMAT_D24_UNORM_S8_UINT Datatype layout)
I lately came around methods optimizing the use of the depth buffer, as the easiest solution reverse depth buffering is mentioned but I cannot wrap my head around why I would be gaining a better depth ...
1
vote
0answers
369 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:
...
1
vote
0answers
951 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
0answers
81 views
Applying two Vertex shaders on two models with the same pixel shader
I want to apply two HLSL vertex shaders on two different models but with the same pixel shader. What I've done is wrong but I don't know how I can use both vertex shaders with one pixel shader (and I ...
1
vote
0answers
224 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 ...
1
vote
0answers
54 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. ...
1
vote
0answers
136 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 ...