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.

learn more… | top users | synonyms (1)

1
vote
0answers
34 views

Align Object With Triangle

I currently am trying to figure out how rotate an object so it's aligned with a triangle along the Z Axis. I have the world matrix of the object and a triangle, which has it's 3 points and the normal. ...
5
votes
1answer
383 views

What does HLSL's tex2D return at (0,0)?

I'm trying to understand the mapping of texels to pixels, especially in the context of pixel shaders. I already found out the following: When I define a standard quad with vertices at integer ...
2
votes
1answer
490 views

The View-Matrix and Alternative Calculations

I'm working on a radiosity processor in DirectX 9. The process requires that the camera be placed at the center of a mesh face and a 'screenshot' be taken facing 5 different ...
1
vote
0answers
168 views

Connecting smoothly N textures on terrain

I started to create my own terrain in a quite common way, just like this: http://www.rastertek.com/tertut18.html . It is infinite and automatically generated (by using coherent noise). The areas are ...
12
votes
1answer
279 views

Accounting for waves when doing planar reflections

I've been studying Nvidia's examples from the SDK, in particular the Island11 project and I've found something curious about a piece of HLSL code which corrects the reflections up and down depending ...
0
votes
1answer
197 views

An API independent way of managing video memory?

I'm developing a game. The game architecture is very modular. I have a "Graphics Engine", which uses either a Direct3D or OpenGL renderer. However the user does not have access to the renderers ...
3
votes
2answers
67 views

Local shape color blending

I am trying to implement this in Unity 4 Pro. But I am stuck in the blending part. I don't understand how you could blend multiples textures/colors using multiples volumes on an object. How could you ...
4
votes
2answers
258 views

Open World Object Management

I'm currently creating a system that essentially creates a world at run-time based on a seed I choose. In this system, I made it so that there are certain "chunks" that divide up different sections of ...
3
votes
1answer
440 views

Vertex Buffer Sharing between DirectX11 and Directx9

In my d3d9 engine i want to take benifit of compute shader of d3d11. So firstly I created a vertex buffer in d3d11 with D3D11_BIND_UNORDERED_ACCESS and then tried to create the d3d9 vertex buffer ...
0
votes
0answers
50 views

C++, Direct3D - Creating mesh from texture [duplicate]

I am making a game similar to Minecraft. I want to create the mesh for the tool held in the players hand (e.g. a pickaxe). I have a texture for the tool which is 32x32 pixels and I want to be able to ...
1
vote
1answer
284 views

How do I copy the depth buffer to CPU memory in Direct3D 9?

I have code in OpenGL that uses glReadPixels to copy the depth buffer to a CPU memory buffer: glReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_FLOAT, dbuf); How do I achieve the same in Direct3D? I ...
3
votes
1answer
223 views

Adding false if statement to pixel shader produces a lag

One of lines in pixel shader produces a lag (lower fps). I can't understand why. if (TextureEnabled) color *= texDiffuse.Sample(texDiffuseSam, input.UV); Interesting fact is: TextureEnabled is ...
4
votes
4answers
808 views

Face-Click Detection ( like in Minecraft )

I am working on a box-based game engine like minecraft and I was wondering how to detect the "clicked face" when placing blocks. I have created this engine in C++ ( DirectX / D3D ), C# ( XNA ) and ...
0
votes
3answers
561 views

XNAMath: Question on types XMFLOAT3/4, XMVECTOR (D3D 11)

I don't want to use XMVECTOR which i currently use in my DirectX 11 C++ game code. Because it is too much for me in memory. I want to use XMFLOAT3 or 4, but the problem is there is no matrix/vector ...
0
votes
2answers
437 views

First person camera: problem

I have created a simple camera class, moved it from my C# (XNA) source to C++ for d3d. Commonly it is okay, but something is wrong with rotation. If i increase its pitch/yaw values, according to ...
2
votes
1answer
307 views

Early Z-test / depth-test in DirectX 11

As a DirectX noob i'm trying to wrap my head around depth buffers and specifically how pixel shaders are called for obscured pixels. From what i understand, the rasterizer calls the pixel shader for ...
0
votes
1answer
555 views

Direct3D11 + Assimp imported model corrupted/failed

I use Assimp library to import vertex and index data from model file. I don't know how to correctly create index buffer from mFaces array of aiMesh. Or something wrong, because i my model is ...
3
votes
1answer
230 views

Gamepad thumbsticks active range

for my current project I use gamepad. I was successfull in hooking it up in C# through SlimDX. Everything works fine, only problem is that thumbsticks don't fully use the active range. If I move ...
1
vote
2answers
227 views

How can I use D3DXLoadMeshFromX with Direct3D 11?

I'm trying to write some class for loading meshes from X files. But I can't use the function D3DXLoadMeshFromX because its third parameter is LPDirect3DDevice9. In my D3D initialization code I ...
1
vote
1answer
135 views

Whats the point of this LPDIRECT3DDEVICE9 reference?

I'm going through the DirectX 9 MSDN documentation Which lead me to something rather peculiar, do you need a class reference in DirectX 9? Can someone tell me what the point of the class ...
0
votes
1answer
48 views

DirectX D3DXVec3Normalize unresolved external symbol

I have simple DirectX project: #include <d3dx10.h> #include <d3dx10math.h> #pragma comment(lib, "d3d10.lib") #pragma comment(lib, "d3dx10.lib") int main() { D3DXVECTOR3 u(1.0f, ...
2
votes
1answer
281 views

Do I need to update my DirectX SDK in order to fix a crash with D3D10_CREATE_DEVICE_DEBUG?

I am currently using the DirectX June 2010 SDK. Everything was working fine with my installation until recently. Unfortunately I'm not sure what changed or when, but now when I create a device with ...
2
votes
3answers
183 views

Is creating vertex/index buffer optimized this way?

I have some vertices in an array from which I create a vertex buffer. Let's say I have vertices: v1, v2, v3, v4 I use indices: 0, 1, 2, 3 Is there any performance impact if I change the indices ...
2
votes
0answers
165 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 DVD so I'm not able to download the ...
-1
votes
1answer
729 views

Is SDL a game engine? [closed]

I would like to ask if SDL is considered a game engine, or just a library like Open and Direct3D?
1
vote
0answers
69 views

Directx Texturing problem [closed]

I've recently started exploring Directx 11. I'm almost done the introduction so I started making my own *.obj parser and it works beautifully. I accounted for the right-hand coordinate system of 3ds ...
1
vote
2answers
430 views

how to set image resource path for D3DXCreateTextureFromFileEx method?

I try to merge all the image resources to a folder called resource. So, set image path as "resource/" but my directX framework only works if I compile at VS 2010. If I run from the debug folder it ...
2
votes
1answer
67 views

Is it possible to retrieve shader function names associated with a technique pass using the DirectX Effect API?

For example, given the pass pass p0 { SetVertexShader(CompileShader(vs_4_0, VSFunction())) SetPixelShader(CompileShader(ps_4_0, PSFunction())) } Ss it possible to retrieve the names ...
2
votes
1answer
116 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 ...
3
votes
1answer
326 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
235 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
1answer
130 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 ...
3
votes
2answers
208 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
2k 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
131 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
482 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 ...
3
votes
0answers
161 views

SSAO Distortion [closed]

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
110 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
203 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
1answer
186 views

How can I use OpenGL and D3D to render to the same window at the same time?

I have main render loop in which initial drawing is done via OpenGL to an SDL window, and after that the same window handle is passed to a Direct3D device, which does subsequent rendering. Once I ...
0
votes
2answers
152 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 ...
2
votes
1answer
343 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. ...
1
vote
1answer
212 views

Why does my blur shader implementation produce this strange result?

I tried to implement the blur shader shown here. Instead of having a simple 2D texture I use Unity's GrabPass function to capture what's behind the plane to have a transparent effect. Then I apply ...
2
votes
1answer
536 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
107 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
1answer
672 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
611 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
1answer
81 views

Can I create an offscreen plain surface with a pointer to pre-allocated surface data?

I thought I read somewhere that one could create a 'offscreen plain surface' from an existing system memory buffer, but I cannot seem to find the reference anymore. My use case is copying a frame ...
1
vote
0answers
81 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 ...
8
votes
1answer
501 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 ...