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.
3
votes
1answer
53 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
23 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 ...
2
votes
0answers
15 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
11 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
49 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
17 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
60 views
Can I recover polygons and normal maps from compiled games by emulating directx 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
19 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
67 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
37 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
20 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 ...
0
votes
2answers
39 views
Shader value remap - Blend Falloff
I would like to know if there's a way to remap a value that goes from 0 to 1 constantly like this.
Into those values (those are examples).
This might be some function transformation but I can't ...
1
vote
0answers
14 views
What happenes if you leave out buffers for the inputassembler that the vertex shader expects?
I'm working through my first attempt at a "graphics engine" (I use the term loosely as I'm not aiming for much more than something that will display a few meshes). I want to leave my classes as ...
2
votes
0answers
43 views
When does the memory transfer from CPU to GPU happen when creating a buffer?
I just finished my first DirectX 11 program. But I have several questions on memory transfer between CPU and GPU.
In my program, I create a vertex buffer first:
bool InitializeGeometry() {
...
2
votes
3answers
443 views
Do the lookDirection vector and upVector have to be orthogonal? What happens if they are not?
I'm currently starting with DirectX and building a small framework for myself and ran into a problem comprehending the camera vectors (position, lookDir, up).
What they represent exactly is clear, ...
3
votes
2answers
90 views
How to achieve a dynamic soft see-through hole effect in a wall with shaders?
I'm looking for a way to create a dynamic soft see-through hole effect for room walls. I know a few ways how to do it (for example multitexturing with second layer being the hole mask in screenspace), ...
0
votes
1answer
34 views
D3D12 ConstantBuffer - Shader receives wrong values
im having trouble with one constantbuffer:
struct CameraConstData
{
urd::Matrix projection; // 64 ( 16 floats)
urd::Matrix view; // 64 ( 16 floats)
urd::Vec3 viewPosition; // 12 ( 3 ...
2
votes
2answers
61 views
How can I test DXGI_ERROR_DEVICE_REMOVED error handling?
My application uses DX11 and it periodically gets a DXGI_ERROR_DEVICE_REMOVED error on startup. It is an infrequent thing (I can go days or weeks without seeing it) but according to the documentation ...
1
vote
1answer
52 views
DirectX11 - AlphaBlending Rendering problem
So.. I completed this tutorial on the following site rastertek.com/dx11tut12.html. The tutorial is all about rendering Text in an orthographic space. Basically just 2D rendering on DirectX 11.
Now ...
0
votes
1answer
33 views
Direct3D - Get screen coordinates for printing multiple text elements
I have a function that I use to print text PrintText(char* text) that stores the text to a vector, which is then displayed if the vector is not empty. I'm trying to figure out how can I correctly ...
0
votes
0answers
34 views
My texture is doing weird, either not loaded correctly or not rendered correctly. DirectX11
I'm loading a texture from a file called owl.png. But it renders really weird.
Original picture(512 X 512):
But it renders like this:
It's rendered on a square, that is initialized like this:
{ ...
2
votes
0answers
62 views
Assimp and directX12 universal apps
I started a directX 12 universal app project on visual studios and started coding some stuff to create a physics engine. I was currently working on implmenting Assimp into the engine too load whatever ...
1
vote
1answer
70 views
Why would this scaling matrix have no effect?
To draw a simple model using the DirectXTk, I'm doing the following. It all works perfectly, draws correct, and so on. Except changing the scaling factor makes NO difference, and I can't figure out ...
1
vote
0answers
46 views
Set Render Target usage
I am using Unity and I have some difficulties about understanding the way Set Render Target works and how it can behave with the shaders.
Is it possible to render a shader pass in multiple render ...
7
votes
1answer
388 views
Strange SSAO effect (wrong position/normal textures in view space?)
I try to create an SSAO effect in my game engine (DirectX 11, C++), based mainly on gamedev.net tutorial by José María Méndez. Unfortunately, it doesn't cover texture-creating problem (normals, ...
0
votes
1answer
36 views
Getting mouse movement value with DirectX Tool Kit
today I want to ask a question about how to get mouse movement value with DirectX Tool Kit.
While I can certainly use Mouse::SetMode(MODE_RELATIVE), to do this, I want to be able to get the mouse ...
0
votes
0answers
102 views
Speed up the DirectX game - how else can I boost the fps with typical triangle drawing?
I am writing my own c++/DirectX engine. I've made the basic framework and here comes the time for optimizations.
I don't want to focus on optimizing the resources themselves right now (meshes, ...
0
votes
0answers
29 views
Device.SetRenderTarget Prevents Shader From Executing
Using DirectX 9 and C++. I'm trying to finalize this code to run a HLSL shader on in-memory data. In theory it should be working. In practice the shader doesn't run.
...
0
votes
1answer
65 views
How to Set HLSL Shader Input Textures?
Very simple question. With C++/Direct9, I'm creating a texture as RenderTarget with a full screen quad, creating a scene, setting a HLSL pixel shader, copying the image and then call Present.
1) How ...
0
votes
1answer
60 views
DX9 How to Apply HLSL Shader with StretchRect
Using DirectX 9,I'm trying to run a HLSL pixel shader on video frame data while copying it from one texture buffer to another texture buffer without displaying it. StretchRect at the end is what ...
0
votes
0answers
27 views
How to Set Compiled Pixel Shader
When compiling a shader with D3DXCompileShaderFromFile, it works. But what if the shaders are pre-compiled into .cso files?
I have this function. It fails. What's the proper way of loading the pixel ...
0
votes
0answers
38 views
DX9 StretchRect to Texture Fails
Alright, I got the code almost working to copy memory data to a texture, process it with DirectX9 into another texture and copy the result back to memory. Almost all the errors are gone and the code ...
0
votes
1answer
24 views
How to Create Device with D3DFMT_A32B32G32R32F
I'm trying to create a DirectX9 device to copy video frame data from one memory buffer to another while processing it through a HLSL shader. I will need half-float or float precision for each channel. ...
1
vote
1answer
61 views
DX11 Mixing 2D and 3D
So I am somewhat new to working with DirectX rendering, and I have done some 2d and 3d work. I am planning on working on a new application where I will be rendering a bunch of 3d scenery, and then ...
1
vote
1answer
51 views
Can DirectX9 be used without HWND handle?
I found an excellent code here that does almost everything I need: running an HLSL shader on memory texture to process video frames into another texture buffer without displaying it.
...
1
vote
0answers
48 views
Simulating sun 3d direction
At the moment I got the following to simulate the suns direction:
void Sun::Update()
{
if (!mIsMoving)
return;
const auto now = Clock::now();
const auto timeDiff = now - ...
0
votes
2answers
33 views
How to handle mesh update in its vertex buffer
suppose i have a mesh, it can undergo any kind of changes - bend, stretch, even been torn. How should i update vertex buffer in DirectX for this mesh. For now i recreate it every time, and i don't see ...
0
votes
0answers
82 views
Run Simple HLSL Pixel Shader with DirectX 9
I'm trying to run HLSL Pixel Shaders with DirectX 9 where I feed a texture in, run the HLSL code and copy the resulting texture back from memory. I think I'm getting pretty close, although a LOT of ...
1
vote
0answers
48 views
OpenGL textureGather and DirectX gather
These functions sample multiple RGBA pixels but return only a single component.
OpenGL: https://www.opengl.org/sdk/docs/man/html/textureGather.xhtml
DirectX: ...
0
votes
1answer
166 views
Is DirectX free for commercial use?
This question isn't gamedev per se but it is definitely relevant. Still, if it's off-topic, please direct me to the proper SE page.
This question has probably already come up many times but I'd like ...
0
votes
1answer
27 views
DirectX 11 throws out my pixel shader when I multiply verts by MVP
Been following some tutorials online for DirectX 11. I was able to successfully get a triangle to render in screen space. But the moment I add a MVP matrix, my triangle disappears!
Looking at it in ...
1
vote
1answer
150 views
Run HLSL in C++ Basic Sample
I'm considering the idea of taking shaders written in HLSL and running them in an AviSynth plugin to process videos. This would allow accessing various shaders, and also to have GPU acceleration. I'm ...
0
votes
0answers
94 views
How to calculate spherical harmonic coefficients for indirect diffuse?
After reading the article "An Efficient Representation for Irradiance Environment Maps", I'm a bit confused as how to calculate the spherical harmonic coefficients. I'd like to generate these ...
0
votes
0answers
17 views
Retrieving shared video memory using SharpDX
I am trying to retrieve the total available video memory using SharpDX via DXGI, using the Description of the best available adapter.
The DedicatedVideoMemory is correct (1GB in my case), but the ...
1
vote
0answers
71 views
how to rotate a 3d instance using an HLSL shader
ok, im 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 ...
0
votes
2answers
90 views
Texturing without D3DX
Well, i have been online for hours looking for solutions, but i have found none. Im looking for a way to create textures without the function D3DXCreateShaderResourceViewFromFile.
Since D3DX is ...
2
votes
1answer
57 views
3D Studio MAX dxf model to OpenGL and DirectX
Main Question
I saw this Loading and Animating MD5 Models with OpenGL an old post explaining .md5mesh .md5anim files. Is there any similar alternate mechanisms?
Additional Questions
1.) Is there an ...
4
votes
1answer
828 views
32 Bit colors difference
Im going through a tutorial to create a basic directx framework, and i've noticed that in there (and other tutorials, when i checked out) use DXGI_FORMAT_R32G32B32A32_FLOAT inside the input element ...
5
votes
2answers
256 views
Low quality bilinear sampling in WebGL/OpenGL/DirectX
I'm seeing low quality bilinear texture sampling in WebGL, OpenGL and Directx, and was wondering if anyone knew how to make it higher quality? The picture below should help show what I mean.
The ...
1
vote
1answer
54 views
Why does the 3D window go blank on resuming from sleep/lock?
I have a 3d window hosted inside a WPF program. This is written in C#, using SlimDX. It uses a D3DImage subclass to support dx10 & dx11 rendertargets, like this site recommends: ...