Tagged Questions

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)

2
votes
0answers
121 views

How to implement simple shadows on XNA?

UPDATE: See photos below the description I try desperately to implement shadows on my XNA games. My game is a style of games like Voxel (minecraft). The problem is that I do not find support / ...
0
votes
1answer
74 views

HLSL Pixel Shader Sematics

I have a HLSl pixel shader that I'm using to create a deferred buffer, I have simplified the code to show you: struct PS_INPUT { float4 PosWVP : SV_POSITION; float4 ...
0
votes
0answers
20 views

Shader | Special Effect - Unit selection [duplicate]

I would like to know how the shaders used to show which unit is selected are made. Here is an image to illustrate. How the merge effect of the blue circles can be achieved ? I didn't found any ...
8
votes
3answers
653 views

Correct method for choosing the user's video cards?

My game uses DirectX 10, and I'm having a problem where users are reporting that my game isn't picking up on their graphics card. Instead it prefers to run on their integrated Intel card, ruining ...
0
votes
1answer
115 views

Fullscreen triangle SV_POSITION and deferred shading

So I'm trying deferred shading in DirectX11. I am using the following method (used in the FXAA shader and described here: http://www.altdev.co/2011/08/08/interesting-vertex-shader-trick/) to render ...
0
votes
1answer
138 views

DirectX UV coordinates are flipped

I'm loading a simple model, which is composed of vertices that have position, normal and UV texture coordinates. The thing is, displaying that model using DirectX 9 or 10 shows that the UV ...
6
votes
1answer
472 views

How do commercial games engines organise the index/vertex buffers?

Preface: This question is going to be coming from a Direct3D point-of-view, because that's what I'm familiar with. Obviously we incur a slight overhead every time we change the vertex or index ...
1
vote
1answer
65 views

What is DirectX 11's equivalent of D3DCAPS9::MaxVertexIndex of DirectX 9?

I'm porting a DirectX 9 program to DirectX 11. How do I get the value in DirectX 11 that is retrieved using D3DCAPS9::MaxVertexIndex in DirectX 9? Thanks in advance.
1
vote
1answer
128 views

Estimated framerate for custom engine?

I've been writing my own engine with C++ and DirectX 11. I've got 3d models loaded in with diffuse maps, normal maps, and shadows. There's other things with the engine but my question doesn't pertain ...
0
votes
1answer
99 views

DirectX9 Drawing Sprites out of place due to offset

This is my very first time into DirectX. Im trying to make a simple 2D game, just for learning the basics. And i've achieved that. The next step is to draw an animation using sprites. For that, i ...
3
votes
2answers
474 views

Update and render in separate threads

I'm creating a simple 2D game engine and I want to update and render the sprites in different threads, to learn how it is done. I need to synchronise the update thread and the render one. ...
-1
votes
1answer
74 views

Why does this code to render a triangle in SlimDX only show a black screen?

Here is the code: var elements = new VertexElement[] { new VertexElement(0,0,DeclarationType.Float3,DeclarationMethod.Default, ...
1
vote
0answers
258 views

Windows Phone 8.1 emulator for DirectX landscape

July 16, 2014 update: I have converted the SharpDX "MiniCube" sample project to a Universal 8.1 project. It is 100% self-contained. It will demonstrate this issue. There is a "READ ME.txt" file ...
0
votes
0answers
45 views

Transform texture coordinates when using shader

Assuming I define four vertices of a quad with texture coordinates that cover a whole texture or region of a texture, I can animate these coordinates by setting a transform using SetTransform( ...
0
votes
2answers
90 views

Was there any equivalent of glVertex3f in Direct3D?

I know that OpenGL's Vertex3f is a bit old but I can't find any information about suitable equivalent for that function that was used in DirectX. Was there any equivalent in DX?
0
votes
0answers
52 views

DirectX9 Normal/Bump Mapping Weird Texturing Artifact

As you can see the artifact here is like a triangle of the mesh getting more light. The important part of my code is below. This is the vertex declaration. VertexElement[0].Stream = 0; ...
4
votes
1answer
119 views

Using sky for indirect lighting - should I remove the sun?

I'm attempting to achieve slightly more realistic ambient lighting in outdoor scenes using the sky cubemap. When rendering an object, I first calculate the direct lighting contribution using ...
0
votes
0answers
63 views

DXGI - IDXGISwapChain::ResizeTarget _com_error 0x887A0022 (DXGI_ERROR_NOT_CURRENTLY_AVAILABLE)

I have (yet another) issue with DXGI in that I get a very strange error when I attempt to change display resolution while in fullscreen and I just can't seem to find the solution to it. This only ...
10
votes
1answer
304 views

Rendering only a part of the screen in high detail

If graphics are rendered for a large viewing angle (e.g. a very large TV or a VR headset), the viewer can't actually focus on the entire image, just a part of it. (Actually, this is the case for ...
2
votes
1answer
119 views

How can I compile a Direct3D 9 effect from a file?

I started working with shaders recently in DirectX9. I noticed that there is a D3DXCompileShaderFromFile function for IDirect3DVertexShader9 and pixel shader. Which compiles the shader and gives you ...
1
vote
0answers
72 views

How do I save my programmatically generated Mesh to a .X file in SlimDX? [closed]

The Mesh has been created properly with SlimDX, but Mesh.ToXFile(barMesh, "foo.x", XFileFormat.Text,CharSet.Unicode); throws a NullReferenceException. I checked that barMesh is not null. Inside the ...
8
votes
1answer
379 views

Picture rendered from above and below using an Orthographic camera do not match

I'm using an orthographic camera to render slices of a model (in order to voxelize it). I render each slice both from above and below in order to determine what is inside each slice. The model I ...
0
votes
1answer
86 views

Load Meshes with Bullet Physics

I just started implementing some physics in my game with Bullet Physics and I was just wondering how would i use bullet physics to load in meshes. For my for DirectX I load in x files into a ...
1
vote
1answer
68 views

How should I interpret these DirectX Caps Viewer values?

Briefly asking - what do the nodes mean and what the difference is between them in DirectX Caps Viewer? DXGI Devices Direct3D9 Devices DirectDraw Devices The most interesting for me is 1 vs 2. In ...
1
vote
1answer
69 views

HLSL 5.0 vector interpolation issues

I'm having issues with the depth components of my shadowmapping shaders. The shadow map rendering shader is fine, and works very well. The world rendering shader is more problematic. The only value ...
1
vote
0answers
97 views

AddFontMemResourceEx and D3DXCreateFont corruption

I'm trying to load a font from a buffer using AddFontMemResourceEx and then creating a D3D font with D3DXCreateFont. This works fine on every platform except Windows XP, where it causes the wrong ...
0
votes
1answer
82 views

How to load a DDS file with mipmaps

I believe there's a D3DX function that can load a DDS file with mipmaps but D3DX is deprecated. Any function/library that can load it and that's not deprecated? I need it for DirectX if it makes any ...
0
votes
0answers
119 views

How do I find the camera direction vector for 3D sound purposes? (C++, DirectX)

Question I'm trying to make a sound class for playing 3D sound effects with DirectSound and DirectX, without using DirectSound's 3D libraries. The plan is to have every game object constantly play ...
3
votes
1answer
347 views

Direct3D 11: Changing fullscreen resolution does not work

In my application I can switch back and forth between windowed and fullscreen mode using IDXGISwapChain::SetFullscreenState. When the WM_SIZE is handled, IDXGISwapChain::ResizeBuffers is called in ...
0
votes
1answer
45 views

DepthStencilView and alphaBlendState

I have create a 2D game with directx11 and i want to use a depth buffer instead of a painter's algorithm to draw the sprites but i have a problem since i'm not really good with directx 3d programming. ...
0
votes
1answer
78 views

Getting access violation because of ID3D11Buffer [closed]

I try to create a simple class store my model variables vertex array and vertexbuffer. So I create an array of myclass to create and manage object dynamically. But when hr = ...
0
votes
2answers
122 views

Can't read .cso files but I can read their .hlsl versions?

Well I've been trying to read a .cso file to use as a shader for a DirectX program I'm currently making. Problem is no matter how I implemented a way to read the file it never worked. And after ...
0
votes
1answer
123 views

Can't read .cso files but I can read their .hlsl versions?

Well I've been trying to read a .cso file to use as a shader for a DirectX program I'm currently making. Problem is no matter how I implemented a way to read the file it never worked. And after ...
0
votes
1answer
39 views

How to create two objects from one vertices array with translate?

I have an object and I can render it but I want to use its vertices twice but I don't know how to. this is my code reading object from txt: fin.open("piyon.txt"); fin >> vertexCountpiyon; ...
2
votes
2answers
123 views

Properly rendering transparent areas of textures

I'm rendering a tree that contains branch meshes with partially transparent textures. If I render it with AlphaTestEffect and set the ReferenceAlpha to something low, I'll get this. I want to ...
4
votes
2answers
125 views

Should I use different input layout for meshes (vertices) with and without normal maps?

I'm writing an DirectX11 game. About 60% of my game models (or "of my vertices") have: Position Texture coordinate Some of them use: Position Texture coordinate Normals And few of them: ...
10
votes
3answers
2k views

How many active shaders at one frame in the game (should I typically use)? 5? Or more like 100?

I have a question: how many shaders are usually active at the same time in one scene in modern games? I mean: I know that multiple shaders are being used (switching between them in each frame). And ...
3
votes
1answer
77 views

Does calling VSSetShader() twice with the same shader have a performance penalty?

Let's say I render 2 objects that are using the same shader (and the same ID3D11VertexShader object). When I call VSSetShader() to set the shader for the 1st object DirectX has to change previous ...
2
votes
1answer
199 views

DirectX particle system. ConstantBuffer

I'm new in DirectX and I'm making a 2D game. I want to use a particle system to simulate a 3D starfield, so each star has to set its own constant buffer for the vertexshader es. to set it's world ...
1
vote
1answer
135 views

Gamma Space and Linear Space with Shader

I am using Unity and I can choose between two color space mode in the settings: Gamma or Linear Space. I am trying to build a Custom Lighting Surface shader but I am facing some problems with those ...
0
votes
2answers
172 views

Directx9, FBX sdk and indices problem

So I've set up my program, know how to get everything going except for one thing: indices. I've been stumped as to how I retrieve that set of data. Does anyone know what I function I need to get them? ...
2
votes
2answers
78 views

What is the advantage of wrapping D3D in a class versus a namespace?

Almost all the tutorials and books use a class wrapper for Direct3D. But I haven't found any scenario in which using more than one instance of Direct3D system (the "device" and state, et cetera) is ...
2
votes
4answers
926 views

Why would you use software rendering over hardware rendering, today?

As opposed to CPU or software rendering I assume? Wouldn't generally all current rendering be GPU based, seeing as you would be using OpenGL or Direct X? Could someone give me some info here, can't ...
0
votes
2answers
348 views

SharpDX.Toolkit setting constant buffer

I am trying to use a constant buffer in a program using SharpDX.Toolkit. I use the Toolkit because it has nice font support for writing on the screen. The problem I face is in assigning data to the ...
1
vote
0answers
180 views

Could not load sound (MonoGame) [closed]

I am using the Window Project (in MonoGame 3.2) which is uisng DirectX instead OpenGL. If I run a game, so its show me: "Could not load wind asset as a non-content file" I think, that is no ...
0
votes
0answers
96 views

Bilinear filter in repeating texture, HLSL

I have a repeating texture that I'm using as a scroll surface. The idea is that as I pan the surface I adjust the texture coordinates, filling in what gets wrapped on the right as it disappears from ...
0
votes
1answer
201 views

OpenGL: How to improve the performance of rendering context [closed]

I have written a benchmark program that compares the performance of OpenGL and DirectX libraries. The problem is that OpenGL gets much lower performance than Direct3D. At the end the program generates ...
0
votes
1answer
54 views

Direct3D: should I use MIXED_VERTEXPROCESSING?

Yesterday on Youtube I watched a video tutorial about creating Direct3D stuff. On that tutorial there was a part about VERTEXPROCESSING compatibility with older video cards. The guy said that the ...
0
votes
1answer
109 views

Why do I have to switch T(v) texture coordinates while importing OpenGL to Direct3D?

I am importing my code from OpenGL to Direct3D. My D3DTS_PROJECTION uses D3DXMatrixPerspectiveFovRH, and my D3DTS_VIEW uses D3DXMatrixLookAtRH to set a view equal to OpenGL's view. My question is why ...
2
votes
0answers
86 views

How can I load an image into the back buffer? [closed]

How can I load and display an Image?... I have tried something but it didnt.. worked.. this is what I've tried.. File : StrikeOps_main.cpp .. void : render_frame : Intro::DisplayIntro(d3ddev, ...