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.
2
votes
1answer
90 views
Nine Patch Images in DirectX
In Android development I found nine patch images very useful to draw images that have a fixed border. When the image is scaled the inner part scales, but the border stays at a fixed size.
I was ...
0
votes
4answers
629 views
At this point in time, avoid XNA? [closed]
XNA seemed like a valid option a few years ago, but XNA was never a real success, and now it seems like a footnote, even Microsoft seems to treat it that way.
Should I just go the DirectX route ...
1
vote
2answers
139 views
Diffuse light direction
I'm learning a tutorial from Rastertek about diffuse light with DX 11, here's the shader code:
float4 LightPixelShader(PixelInputType input) : SV_TARGET
{
float4 textureColor;
float3 ...
0
votes
2answers
224 views
SharpDX (DirectX) - possible to measure Frame time?
I'm trying to benchmark various ways to draw 2D lines and have a snag. A D3D10Device that I draw with (and flush) doesn't appear to block, so I can't accurately measure frame rate (or time to render 1 ...
1
vote
1answer
195 views
Is using Sprites the most recommended way for doing 2d animations with Directx?
I am working on a game engine of my own and I was using Vertex buffers to create triangles and then draw textures on them. Now I want to extend it so I can do simple 2d animations using "sprite ...
9
votes
3answers
973 views
Fastest way to render lines with AA, varying thickness in DirectX
So I'm doing some DirectX development, using SharpDX under .NET to be exact (but DirectX/C++ API solutions are applicable). I'm looking for the fastest way to render lines in an orthogonal projection ...
3
votes
1answer
168 views
Why are some objects not rendering properly?
Here's a button I exported from Blender into a .x format:
Now here it is in the game with BasicEffect applied to everything:
And now with my custom shader:
And there's the problem. While the ...
2
votes
2answers
717 views
Does Monogame on Windows Desktop use OpenGL or DirectX by default?
if i use monogame 3.0 beta on windows desktop, does it use the directx renderer (sharpdx) or the opengl renderer by default?
if it uses directx is there away to make sharpdx call directly? thanks!
0
votes
3answers
268 views
Event Based Render / Update Loop
I'm working on a few game dev tools which use OpenGL or DirectX to render 3D models (viewing).
Consider your favorite 3D modeling software package (Softimage, Maya, 3DS Max, modo, etc.). Note that ...
0
votes
2answers
225 views
Go to fullscreen and back in directX
I'm now learning how to use directX (10 - 11), and i use materials from SDK samples, http://www.rastertek.com/ and http://takinginitiative.net/category/graphics-programming/directx-10-tutorials.
But i ...
3
votes
1answer
139 views
What happens to a D3D11 application when Windows hibernates?
In D3D9 there was the concept of a "device reset". When a device reset occurred textures created with D3DPOOL_DEFAULT had to be recreated, but textures created with D3DPOOL_MANAGED didn't, because, ...
6
votes
4answers
197 views
Game development for multiple Microsoft platforms
I intend to develop games for Microsoft's Windows Store, however, I'm confused between their platforms, so please clarify those questions:
Is there any technology (XNA, DirectX), so a game can be ...
1
vote
1answer
183 views
DirectX procedural programming
Well I'm learning DX11 and I hope someday I can start a simple 3D engine. I'm following tutorial series and I realised that I have no need to create any class to mantain my code (the tutorials also ...
0
votes
1answer
103 views
Why and how should I cast DirectX function parameters?
I'm learning DX11 and I found that in some D3D functions, a parameter has to be cast just like in the GetBuffer function of the swapChain: the third parameter has to be of type void*, so when calling ...
2
votes
1answer
168 views
DirectX11 CreateWICTextureFromMemory Using PNG
I've currently got textures loading using CreateWICTextureFromFile however I'd like a little more control over it, and I'd like to store images in their byte form in a resource loader. Below is just ...
3
votes
1answer
161 views
DirectX Unproject troubles
I have an orthographic projection and I try to unproject a point from screen space.
Following are the view and projection matrices:
var w2 = ScreenWidthInPixels/2;
var h2 = ScreenHeightInPixels/2;
...
4
votes
2answers
290 views
ConsumeStructuredBuffer, what am I doing wrong?
I'm trying to implement the 3rd exercise in chapter 12 of Introduction to 3D Game Programming with DirectX 11, that is:
Implement a Compute Shader to calculate the length of 64 vectors.
Previous ...
0
votes
1answer
107 views
Can I publish an indie game on XBL made with directx
So I know that XNA can be used to publish games on Xbox Live Indie Games and I signed up for the $100/year subscription thing.
I haven't downloaded XNA yet but I was wondering if I can publish a game ...
8
votes
3answers
496 views
Isometric smooth fog
I'm working on a simple 2d game with direct3d 9. It's a isometric game with diamond tiles and a staggered map. This is what I have:
As you see I have some kind of fog which is acomplished by having ...
0
votes
1answer
238 views
DirectX 9.0c and C++ GUI
Well, I'm trying to code a gui for my engine, but I've got some problems.
I know how to make a UI overlay but buttons are still black magic for me. Anything I tried was to compilcated ( if it goes big ...
1
vote
1answer
107 views
Texture the quad with different parts of texture
I have a 2D quad. Let say it's position is (5,10) and size is (7,11).
I want to texture it with one texture, but using three different parts of it.
I want to texture the part of quad from x = 5 to x ...
9
votes
4answers
516 views
Avoid if statements in DirectX 10 shaders?
I have heard that if statements should be avoid in shaders, because both parts of the statements will be execute, and than the wrong will be dropped (which harms the performance).
It's still a ...
1
vote
0answers
529 views
Black Screen: How to set Projection/View Matrix
I have a Windows Phone 8 C#/XAML with DirectX component project. I'm rendering some particles, but each particle is a rectangle versus a square (as I've set the vertices to be positions equally offset ...
3
votes
1answer
119 views
blurry image rendered
I'm using Direct2D to render a PNG image using a ID2D1BitmapRenderTarget and then caling it's GetBitmap() function and rendering the image using ID2D1HwndRenderTarget::DrawBitmap().
Some of the ...
2
votes
1answer
89 views
Do shader program compilers optimise divide-by-PoT-constants to bitshift operations?
So just to restate that, let's say we have this:
float f = g / 2;
Given the divisor is a constant, will the shader compiler auto-optimise this to a bitshift operation, as some language compilers are ...
3
votes
1answer
281 views
Spherical to Cartesian Coordinates
Well I'm reading the Frank's Luna DirectX10 book and, while I'm trying to understand the first demo, I found something that's not very clear at least for me. In the updateScene method, when I press A, ...
0
votes
0answers
146 views
How export .xsi or .x files from maya 2013
Is it possible to export a Maya 2013 scene as a .x or a .xsi file? i have no animations on this scene, its just a fancy cube?
I need to then convert this to a .mdx file?
Ive goggled this but there ...
0
votes
2answers
219 views
How can I capture every frame in DirectX 9 using a shader
This is actually a follow up to this question
How to capture the screen in DirectX 9 to a raw bitmap in memory without using D3DXSaveSurfaceToFile
The proponent of the best solution suggested that I ...
3
votes
1answer
581 views
In HLSL pixel shader , why is SV_POSITION different to other semantics?
In my HLSL pixel shader, SV_POSITION seems to have different values to any other semantic I use. I don't understand why this is. Can you please explain it?
For example, I am using a triangle with the ...
4
votes
1answer
314 views
Zooming into Mouse Position
I'm trying to implement my camera class for a simulation. But I cant figure out how to zoom into my world based on the mouse position. I mean the object under the mouse cursor should remain at the ...
1
vote
1answer
125 views
Direct3d - Code structure
I'm learning directx in a master's degree and they taught us to have a GraphicsLayer class which is the one connecting with the direct3d library. That way this class is completly independent from the ...
0
votes
0answers
110 views
Drawing of a huge model - How to regain performance?
I have a huge model I want to draw in my XNA application but because of its size I am experiencing a tremendous loss of performance.
The model has about ~50 000 000 edges and has a size on disk of ...
2
votes
0answers
240 views
Where is the Shader Designer?
I have VS2012 Ultimate and I've been trying to access (find) the Shader Designer. I searched through MSDN's text and Channel9's videos, but they keep failing to mention how to access it...
Can ...
5
votes
2answers
5k views
Does Windows 8 still support DirectX 9?
Is Windows 8 supporting DirectX 9? Because I was looking through some samples written in C++ and DirectX 9 made for Windows 8. It wasn't that, like I know it ( look here ...
1
vote
0answers
164 views
Obtaining a HBITMAP/HICON from D2D Bitmap
Is there any way to obtain a HBITMAP or HICON from a ID2D1Bitmap* using Direct2D?
I am using the following function to load a bitmap:
...
-2
votes
1answer
201 views
Confusing Callbacks
I'm trying to programm now a "game", and started with the EmptyProject that's provided by the DirectX SDK. The problem is that the Callbacks are confusing me.
Can please someone explain me?
Edit:
...
1
vote
2answers
431 views
Optimal way to learn DirectX? [closed]
I am finding it very difficult to learn DirectX 11. The MSDN website is just full of unorganized information that doesn't seem to help at all. I am particularly looking for something that explains ...
2
votes
1answer
94 views
DirectX 9.0c Lights?
I'm still learning DirectX from a book. It says that a graphiccards can only handle 15 lights. I'm just a bit confused , there are a lot of games using more lights, or are this just some alpha ...
-1
votes
2answers
503 views
Game Engine Design
Is there any guide how to or better what a good Game Engine ( for DirectX ) must contain?
I've been reading certain books, but I want to get sure.
My own Engine ( called KaDI ) contains:
...
1
vote
1answer
90 views
Task Core dividing
How can I divide the tasks for diffrent cores?
E.g. 4 Cores
func1() -> core1
func2() -> core2
func3() -> core3
func4() -> core4
Is there special libary for this? Or do I have to use the old ...
2
votes
4answers
389 views
Do games use threads?
I 'understand' that the concept of how a game runs i.e
while (game_loop = true)
{
//handle events
// input/output/sound etc
}
But it has come to my attention while programming in another ...
0
votes
1answer
127 views
Player Movement DirectX
I'm reading on a Book that's about Gamedevelopment with C++ and DirectX 9.
There is something that interrests me:
It says that playermovements are increasing with the power of the CPU. Becouse a ...
1
vote
1answer
85 views
Consistency of DirectX models
Is there a way to check the consistency of a DirectX model (.x) ?
Whilst compiling .x files with XNA GameStudio 3.1 compilation is aborted with the following error message:
Error 2 Could not read ...
4
votes
3answers
1k views
How to capture the screen in DirectX 9 to a raw bitmap in memory without using D3DXSaveSurfaceToFile
I know that in OpenGL I can do something like this
glReadBuffer( GL_FRONT );
glReadPixels( 0, 0, _width, _height, GL_RGB, GL_UNSIGNED_BYTE, _buffer );
And its pretty fast, I get the raw bitmap in ...
5
votes
3answers
172 views
Depth is disabled - How to turn on?
In XNA 3.1 is there any other way to disable depth in 3D Worlds using DirectX models other than
GraphicsDevice.RenderState.DepthBufferEnable = false;
?
The reason for my question is I have quite a ...
2
votes
1answer
268 views
SharpDx: using maximized RenderForm
I'm trying to learn DirectX via SharpDX, very new to this. What I want to do is be able to draw 2D shapes for a game I'm trying to make. So I started with the demo "MiniRect" that came with SharpDX. ...
0
votes
4answers
760 views
DirectX 11 Constant Buffers vs Effect Framework
I'm having some trouble understanding the differences between using constant buffers or using the effect framework of DirectX11 for updating shader constants.
From what I understand they both do ...
-1
votes
3answers
401 views
How do I switch from XNA to C++? [closed]
So, I heard somewhere that Microsoft intends to phase out XNA in favour of using the DirectX method. I've always wanted to learn, but all I ever did in XNA was simple 2D games. I was wondering if ...
0
votes
0answers
76 views
record and replay directinput events
I am trying to build a record and replay system for a couple of games. I was wondering if I can make a general replay engine using directinput rather than doing an specific implementation for each ...
11
votes
1answer
204 views
Best practice for setting Effect parameters in XNA
I want to ask if there is a best practice for setting Effect parameters in XNA. Or in other words, what exactly happens when I call pass.Apply(). I can imagine multiple scenarios:
Each time Apply is ...