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.
1
vote
2answers
17 views
Shader models, when to use “ps_4_0_level_9_x” instead of “ps_4_0”
I've made a very simple post processing shader for my 2D game. It produces scanlines by dimming every other line. For this I use the position of the pixel on the screen.
When using ps_4_0_level_9_3, ...
9
votes
0answers
63 views
Flowing GPU compute water
I have a civil engineering background and perform hydraulic and hydrologic analysis' regularly. They sell degrees for that sort of thing, but it's really not rocket science. I recently got it in my ...
0
votes
0answers
20 views
What is PhysX and how is it related to directX? [closed]
And should a hobbyist unity c# programmer know about both if he wants to become a professional game programmer. if yes given he has experience in c++ and the vector math, matrices, calculus etc. where ...
0
votes
1answer
39 views
directX rotation of a 3d cube inconsistent
i'm trying to develope a simple 3d cube in directX that can be rotated in any direction by dragging the mouse.
It works in the following way: i drag the mouse to the right or left, and the cube ...
0
votes
1answer
16 views
GL_TEXTURE_MAX_LEVEL equivalent on DirectX
I'm trying to mix atlas and mipmapping for a kind of Minecraft editor I'm doing. Everything looks good until I reach the smaller mipmaps of the atlas texture, where obviously all the textures are ...
-1
votes
1answer
35 views
Compute shader in directx 12? [closed]
I was just wondering since directx 12 is out does it have a compute shader like directx 11??? Ive tried searching and didn't find anything.
1
vote
1answer
32 views
How to get depth of vertex in 0 - 1 range
I want to get the depth of vertex in 0 to 1 range(like it done in the shader) and I do it like this
D3DXVec3TransformCoord(&vertex, &vertex, &wvp);
depth = vertex.z;
It ...
1
vote
1answer
54 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
170 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
93 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
41 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
43 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
26 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
94 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
43 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
12 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
29 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
49 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
37 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
46 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
65 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
27 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
33 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
53 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
54 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
61 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
29 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
34 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
67 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
52 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
33 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
229 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
62 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
46 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
82 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
104 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
63 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
265 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
85 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
38 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
40 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
53 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
176 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
39 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
73 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
24 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
31 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");
...