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
31 views
Any possibility to render XNA scene via POV-Ray
We are creating special purpose application. Its not game but its 3d Application that functions like game. We require app to have different places and we want to allow user to roam inside such places ...
2
votes
1answer
35 views
Direct3D reducing DrawIndexed CPU usage
I am trying to optimise some of my rendering to get is useable on lower end machines (in my case a 2GHz i5 laptop with a GT 520M).
A quick investigation showed that the GPU isnt actually getting to ...
1
vote
0answers
41 views
2D Camera transformation sidescroller
i am currently trying to dive into 2D programming with DirectX, especially bulding a tile based sidescroller. I have worked with some chapters from a book (Advanced 2D Game Development) but always ...
3
votes
0answers
24 views
What is the difference between DXGI_SWAP_EFFECT_DISCARD and DXGI_SWAP_EFFECT_SEQUENTIAL?
I have difficulty understanding the difference between those two values of the DXGI_SWAP_EFFECT enumeration. MSDN documentation states:
DXGI_SWAP_EFFECT_DISCARD
Use this flag to specify the ...
0
votes
0answers
25 views
No Triangle on-screen after following Braynzarsoft DirectX 11 tutorial
I've never done any DirectX stuff (only OpenGL) so I thought the best way to migrate was start from the start to really see what would be different.
I decided to go for the Braynzarsoft tutorials ...
1
vote
0answers
70 views
Drawing multiple objects with directx and problem with displaying them
I have problem with displaying multiple objects in DirectX. From logic engine I'm getting vertices, indices and also some constant data per object. All data from logic engine is valid so this is not ...
2
votes
2answers
40 views
How to correctly Dispose a SourceVoice once its finished
i am starting to play a sound with XAudio2 and SourceVoice and once its finished, it should be correctly disposed to not have any leaks.
i was expecting it to be something like this:
...
2
votes
2answers
90 views
Does DirectX implement Triple Buffering?
As AnandTech put it best in this 2009 article:
In render ahead, frames cannot be dropped. This means that when the
queue is full, what is displayed can have a lot more lag. Microsoft
doesn't ...
2
votes
1answer
49 views
Shader Variable Types
I have a simple question. what are the meaning of :
half4 myHalf;
myHalf.yyyy;
myHalf.xxzz;
// or
myHalf.yw
Thanks a lot !
1
vote
2answers
60 views
How to blend the sprite into background?
I try to blend the character into game but I still cannot remove the blue color in the sprite sheet and discover that the white area of sprite is semi-transparent.
Before that, the color ...
2
votes
0answers
66 views
SSAO Distortion
I'm currently (attempting) to add SSAO to my engine, except it's...not really work, to say the least. I use a deferred renderer to render my scene. I have four render targets: Albedo, Light, Normal, ...
2
votes
0answers
33 views
Writing to a D3DFMT_R32F render target clamps 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, I set an integer constant ...
1
vote
1answer
28 views
How can I compile SM 3.0 effects in D3D11 in SlimDX?
var bytecode = ShaderBytecode.CompileFromFile("shaders\\testShader.fx", "fx_5_0", ShaderFlags.None, SlimDX.D3DCompiler.EffectFlags.None, null, null, out str);
var effect = new ...
1
vote
0answers
48 views
Mixing DirectX & OpenGL backbuffer
I have main render loop in which initially OpenGL drawing is done on SDL window and after that the same window handle is pass to a DirectX device. This device is then doing rending on the same window. ...
-1
votes
0answers
51 views
How can I determine why my program closes immediately? [closed]
I have been following this code from "Beginning Game Programming Through DirectX 10" and I can't get my window to appear. The program exits with code 0 but automatically closes.
My code:
...
0
votes
2answers
76 views
HLSL Pixel Shader Compile, Flow Control, Instruction Count, XNA Issue
im trying to find help with an issue im having moving from the XNA 3.1 framework to XNA 4.0. The shaders I wrote for my 2D game work fine in XNA 3.1, but wont even compile in 4.0.
At first I got ...
0
votes
1answer
75 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. ...
0
votes
0answers
47 views
Blur Shader strange behaviour
I tried to implement the blur shader shown here.
But instead of having a simple 2D texture I use Unity GrabPass function to capture what's behind the plane to have a transparent effect.
Then I apply ...
2
votes
1answer
99 views
Simple Optimized Blur Shader
I have a vertex-fragment shader that use the Unity3D GrabPass functionality (it grabs the screen). And I apply my GrabPass to have a transparent effect.
GrabPass {
"_GrabTex"
}
sampler2D ...
1
vote
0answers
54 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 ...
1
vote
1answer
85 views
DirectX11 Gamma Correction
I am writing a game using SharpDX with DirectX11 and I have been reading that it is important to apply gamma correction to my engine in order to perform correct linear lighting calculations.
So I ...
5
votes
2answers
78 views
What range of values can HLSL's tex2D function return?
When using the tex2d function in a HLSL shader, as so:
float height = tex2D(heightMap, IN.texCoord).r;
What range of values can be returned to the height variable? Is it always a number between ...
2
votes
0answers
36 views
Creating a d3d surface from pre-allocated system memory?
I thought I read somewhere that one could create a OffscreenPlainSurface from an existing system memory buffer, but I cannot seem to find the reference anymore.
My use case is copying a frame from ...
1
vote
0answers
71 views
3D Model Loading in DirectX 11 [duplicate]
At the moment I am trying to implement fbx model loading in my DirectX 11 code. This is old code I had create for use with DirectX 9 and I'm simply trying to bring it back up to date.
Since I first ...
7
votes
1answer
211 views
2D Water top surface profile
I am trying to create the effect of the water surface thickness with a vertex-fragment shader.
I am in a 3D game environment but It's a scroll view so a "2D" view.
Here is a good tutorial of creating ...
2
votes
1answer
366 views
Is the “impossible object” possible in computer graphics?
This may be a silly question but I want to know the answer to it. I saw this thing called the "impossible object", while they're many different images of this online, it's suppost to be impossible ...
2
votes
2answers
127 views
3D Distortion Effect
I'm trying to make a distortion effect similar to this:
However I'm not making a 2d screen space effect. I'm applying it to a 3d scene and I want it to be placed IN the world, so it can be blocked ...
-2
votes
2answers
78 views
Rendering structure [closed]
my question is "What is the best way to structure rendering code".
Is it better to make a class with a render function that iterates through all game objects
based on there name or type and have no ...
-3
votes
2answers
70 views
Can you use a struct instead of an array to hold vertices in directx?
So instead of using an array to hold vertices information use a struct instead.
Is this possible, does the Idirect3dvertexbuffer allow it?
0
votes
1answer
103 views
Why DirectInput is not recommended?
I have read that the Windows messages are recommended way over DirectInput to control mouse and keyboard.
From http://msdn.microsoft.com/en-us/library/windows/desktop/ee416842(v=vs.85).aspx
The ...
3
votes
2answers
102 views
Extract smaller frustum from camera frustum?
Background:
I was thinking of implementing multiselection by performing a frustum culling on a sub-part of the screen.
Problem:
Given total screensize, a rectangle on the screen (pos, size), and ...
0
votes
0answers
35 views
DrawIndexedPrimitive bug
Hello I have problem with DrawIndexedPrimitive function.
I create vertex buffer for each wall like that:
1----2
| |
3----4
I put 1,2,3,4, and then I create index buffer this way:
short * ...
1
vote
1answer
122 views
How should I setup my minecraft-like world rendering for the best performance?
I want to know what technique will give me most fps in game. I have minecraft-like world and I need to display it. Now I have only one cube, created as VBO and if i need to display cube I just display ...
0
votes
0answers
66 views
Skeletal Animation in DirectX [closed]
A few weeks back I asked the following question: Are there alternatives to Vertex Tweening?
I was pointed towards Skeletal Animation, or more specifically: Hardware Skinning. While I found quite some ...
1
vote
0answers
61 views
Why is my XInput gamepad press stamp not working?
I'm trying to add basic gamepad input to my c++ DirectX game but i'm having some trouble creating a press stamp (registers the press only the first time it's pressed if button held down).
The entire ...
1
vote
1answer
92 views
Texture Shaders vs. Pixel/Fragment Shaders?
My question is a simple one.
Functionally, practically, and performance-wise, what are the differences between using a D3DX Texture Shader, and using a Pixel/Fragment Shader rendered with a full ...
-1
votes
1answer
91 views
Are there any open-source Direct X code-bases that I can look at to learn from as a beginning Direct X and graphics programming student? [closed]
I'm a third-year university student and I've recently begun studying Direct X 11. Mostly I've been following the samples from the SDK and reading a lot out of the MSDN. Although I have a decent ...
1
vote
1answer
48 views
PIX and Metro apps
I would like to use Pix on a Metro (Win 8) app. However, Pix wants the path to the application, something that Metro apps don't have. Has anybody been able to get Pix working with Metro?
6
votes
2answers
212 views
In DirectX 11, batching primitives for performance, how does this actually work?
I don't seem to be able to understand this. Microsoft says that one of the possible optimizations of for a Direct3D 11 if to batch primitives draw calls. For example in order to draw say 300 triangles ...
1
vote
1answer
104 views
Can not enable IME to capture Chinese characters in SharpDX
Just found that direct integration of IME is blocked in Windows 8, moving on to TSF now.
By now, there is lack of Microsoft's Document about TSF, this will be hard.
I am using SharpDX and the ...
-3
votes
1answer
173 views
Which should I learn: DirectX or XNA? [closed]
I've worked with the Microsoft Foundation Classes(MFC) and now I want to enter the world of game development.But should I start with directX or XNA? I'm hesitant towards DirectX because I feel it ...
0
votes
1answer
134 views
Render just the pixel under mouse cursor in DirectX
I'm having difficulties rendering just a single pixel which is on the defined coords of viewport. I'm using D3DXMatrixPerspectiveOffCenter function, but the result is not what I expected.
Here is ...
1
vote
2answers
116 views
DirectX How to Gernerate Vertices for Diamond Shape and Render it?
How to generate vertices for 3D Diamond Shape in DirectX?
EDIT:
I am creating an application which receive DIAMETER, CROWN, GIRDLE and PAVILION as parameter and render a model of diamond according to ...
3
votes
2answers
66 views
using DirectX to generate a sprite sheet
I am building a site in HTML5 for my client and it must run on the iPad/iPhone (i.e. Safari on iOS).
They want a 3D effect where they have a simple, yet, specific product they want to show on the ...
-1
votes
1answer
77 views
simple win32 window wont show [closed]
The program compiles and runs successfully but does not show a window, it simply ends immediately.
#include <Windows.h>
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, ...
0
votes
1answer
40 views
Sprite rotation and question about sampler state
I'm not an expert in creating game engines, but I'm doing fine for now. Recently I reached a point that I couldn't solve any of my problems. I have two questions:
I'm using ...
-2
votes
1answer
57 views
How to use D3DXIntersectTri function to find intersected point?
How to calculate direction for D3DXIntersectTri function to find intersected point? And after getting the result in Distance how to get that coordinate(XYZ)?
1
vote
1answer
96 views
Passing multiple colors to a pixel shader in DirectX
I have a pixel shader that sets the output color based on the interaction of an input texture, sort of like:
if (case1)
{
output.Color = float4(0, 0, 0, 0);
}
else if (case2)
{
output.Color = ...
0
votes
0answers
46 views
Best approach to depth streaming via existing codec
I'm working on a development system (and game) intended for games set mostly in static third-person views. We produce our scenery by CG and photographic techniques. Our background art is rendered ...
0
votes
0answers
75 views
Can't Load Shaders [closed]
I have a Windows Phone 8 XAML with DirectX project. I have written some code to load textures and shaders to simulate a particle system. The particles render to the DrawingSurface XAML control. ...