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.
-3
votes
0answers
32 views
Am I Doing this right?
My question is simple...
I am constructing the game scenario and buttons using Vertex Buffers...
but.. Am I Doing this right?
I am making a v_buffer for each vertex , and then releasing them ... I ...
-1
votes
0answers
35 views
How can I create a camera?
I am making a 2D Game...
How can I create a camera?
I need to create a camera so I can move around the 2D Level.
I have already tried to use the Matrix view transform, but I do not know exactly how ...
0
votes
1answer
46 views
How can I move the view in a DirectX game?
I'm making a game in C++ using Direct3D 9. How do I move the camera at constant rate?
I'm making a Flappy Bird type game and I'd like to move the camera forward through the level.
1
vote
2answers
85 views
Does installing the DirectX SDK add project templates to Visual Studio?
I have Visual Studio 2013 installed on my machine, and I have installed the latest DirectX SDK, but it doesn't seem to have added any DirectX project templates to VS. Should it have? Or do I need to ...
0
votes
0answers
17 views
Dealing with 2D tiled maps in DirectX
I'm new to DirectX. I'm pretty much to the point to where I can create some sprites and attach textures to them, but I'm not fully cognizant of the entire model of textures and sprites or exactly how ...
0
votes
2answers
55 views
How to draw non-triangulated mesh?
I am working with DirectX (C#/C++).
I am wondering is it possible to do not triangulate meshes and what the difference between cases (in loading and rendering code)? If so, how to do this? I know ...
0
votes
1answer
53 views
Texture coordinates for box - multiple coordinates per 8 vertex or single for 24 vertexs or.. sth else?
I have an box model in my DirectX application, stored as 8 verticles:
MyVertex vertices[] =
{
{ DirectX::XMFLOAT3( - 1.0f, + 1.0f, - 1.0f ) /*,tex coord...*/}, //0
{ DirectX::XMFLOAT3( + ...
1
vote
1answer
73 views
Load texture from different thread
I am trying to load textures from a different thread but it fails everytime on this following method:
D3DX10CreateShaderResourceViewFromFile
Turning off my multithreaded routines make the textures ...
1
vote
1answer
26 views
Repeat or wrap texture (DirectX 9)
Sure there's something I'm missing about wrap/repeat textures in D3D 9. I've tried setting the sampler in the shader, i.e. :
sampler DiffuseSampler =
sampler_state
{
Texture = ...
1
vote
1answer
50 views
Problem calculating normals for heightmaps
So far I have been using normal avering to calculate the normals for my vertices in my heightmap, with good graphical result (see picture), however it is terribly slow. With a incresing image size the ...
0
votes
1answer
45 views
Tangent plane vectors smoothing with vertex normals [closed]
I'm trying to find a way to smooth out normals obtained from cross product of tangent and bitangent vectors calculated per face basis. I've already asked a similar question on SO, however with no ...
1
vote
1answer
45 views
How can I programatically determine if I can create a hardware D3D device?
I have a D3D 11 application to which I would like to add support for software rendering. This is because in some circumstances it will be run on over remote desktop or on machines without GPUs. From ...
1
vote
1answer
39 views
moving first person camera with the mouse on right click
I am new to game development and I am trying to get the game input working. I have successfully got all the movement keys for walking/running/looking around working; however, I am having a terrible ...
0
votes
1answer
29 views
Rendertarget and alphablending problem (Offscreen particle rendering)
Today, I have implemented soft particles by rendering them to a separate render target and blending that with the scene, which worked as expected with additive blended particles. In that case I render ...
5
votes
2answers
177 views
Is Batching Geometry Every Frame Always Slower Than Individual Draw Calls
I'm currently have an application that has ~10k draw calls. I implemented a batching scheme where I group all objects that share material, vertex format, etc and pre-transform them by their world ...
0
votes
0answers
41 views
Skinning mesh with Hermite Interpolation
I'm trying to implement an skinning mesh and I use Hermite Interpolation for evaulating frame's position. When I use the normal interpolation t*p1 + (1-t)*p2, it run well, but when I change to ...
0
votes
1answer
39 views
Triangular grid and rendering to a texture (Direct3D 11)
Is it possible to render vertex data from a triangular grid into a texture with a same size (i.e. 3x3 vertices to 3x3 pixels - each pixel is representing one vertex)?
Consider following situation. I ...
0
votes
2answers
140 views
How to mix pixel colors in Shader?
I have a pixel that have a colour RGB. This color is calculated by the shader and can be anything.
How can I override this color by a colour I choose. If my pixel is white it's simple, I can do this:
...
0
votes
1answer
142 views
When should rendering be performed during a frame?
When working with OpenGL or DirectX, should draw calls be done all at once, at the end of the update loop, or is it better to have draw calls occur during the update loop rather than just at the end?
0
votes
1answer
84 views
How to share matrix in HLSL?
I am trying to share this across multiple effect files:
matrix worldMatrix : register(vs_4_0, b0);
If I set this from one effect file, will it effect every effect file which has the same type of ...
1
vote
1answer
60 views
Reuse VertexBuffer or new VertexBuffer object?
I'm trying to render bitmap fonts in directX10 at the moment, and I want to do this as efficiently as possible. I'm having a hard time getting a start on my design because of this question though.
So ...
8
votes
3answers
434 views
How can I create a glitter effect?
I am trying to create a glittering effect for my realtime shader but I don't know how.
Here is one example, and another example.
What technique can I use to implement this?
0
votes
1answer
70 views
Rendering Textured Terrain With SharpDX Toolkit [closed]
So i recently moved from XNA to SharpDX Toolkit and started with some basics. The 2d part was easy since nearly nothing has changed but im really struggeling with the 3d part. For example i wanted to ...
0
votes
0answers
38 views
IndexedInstanced logic
I'm using SharpDX.Toolkit with three buffers: two vertex and one index buffer.
The first vertex buffer is bound to slot 0 for per-vertex data with following data:
static VertexPosition[] vertexData = ...
0
votes
1answer
36 views
DXUT getters are always null using DLL
I'm struggling with a problem for a while and I hope some of you can help me out. The title for this question is vague, so I will try to explain my problem as best as I can!
I'm am creating a project ...
0
votes
1answer
46 views
Changing the maxDepth of viewport
Whenever I change the maxDepth of the viewport from 1.0 to say 300.0f (just for kicks), everything on my screen disappears. Why is that? Is there anywhere else I have to account for this change in ...
1
vote
1answer
50 views
Does `SetResourceArray` copy the data into the GPU?
I am trying to create multiple textures, and only several of them change every few frames. I don't want to have to copy in the whole array via SetResourceArray for just a few textures that change, ...
2
votes
1answer
81 views
How do we apply different textures to different faces generated via geometry shader?
I am trying to render a cube by starting of with one vertex into the shader, then geometry shader to expand into a cube, and then apply a different texture to each side. The part I am facing the issue ...
2
votes
1answer
71 views
Implementing Geometry Instancing in DirectX
I have a project that I'm doing in Managed DirectX (DX9) where I want to render lots of grass. My current method (many draw calls) is slow, but I've heard Geometry Instancing can fix that.
I know ...
1
vote
2answers
145 views
Anti-aliasing a sphere
I render everything in my game in 2D with SpriteBatch with the exception of a spherical entity (orb) that I render as a spinning and dynamically lit (custom effect) sphere in 3D. I capture the sphere ...
0
votes
2answers
103 views
Is there a way to optimize this 2D lighting effect shader? [duplicate]
I'm doing a little 2D game in C++ with Direct3D 11.
In the game I want to render a sort of shadow that covers part of the screen:
To do this I am using this pixel shader:
float4 PS_Main( PS_Input ...
1
vote
2answers
107 views
How can I render 3D dots at object vertex positions?
What is the best way to put a dot on a vertex?
I have a model (a plane for example) consisting of a few thousand vertices. I want to draw a red dot at every vertex's 3D position, just like 3ds Max's ...
0
votes
1answer
107 views
How to get pixel coordinates between 0,1 from SV_POSITION [duplicate]
I am new to HLSL and Directx. I was trying to write a simple gradient Shader by modifying one of Microsoft samples.
1.I can not understand why SV_POSITION is float4? If it is pixel coordinates ...
1
vote
0answers
54 views
Display modes D3D/Win32
i'm was revising some code i wrote some time ago when working on the window wrapper for my rendering framework. The framework is based off DirectX, but it wasn't really using any D3D-related facility. ...
5
votes
1answer
158 views
How can I draw a perspective-correct quad?
I'm trying to draw a quad in 2D (in SharpDX, but that is basically XNA). But texture correction is not working, and I'm getting only an affine textured quad.
I'm using BasicEffect to render it.
...
3
votes
2answers
88 views
How to fill/initialize D3D11_SAMPLER_DESC properly?
If I want to set explicitly every parameter of the structure I just do so and that's it. But what if I want to set only some of them and leave the rest with default values? I've seen in some tutorial ...
8
votes
1answer
249 views
DirectX error with older XP systems
I am a blind programmer, working on an audio game for the blind.
I am using SlimDX, and it has been tested on dozens of systems from XP to Win 8.1.
My code works on most systems just fine, but I ...
6
votes
2answers
186 views
Fixed Function vs Programmable Pipeline performance with many batches
In OpenGL 2.0 I can easily make 10,000 draw calls per frame (with state changes in between each call). However, if i try to do this in either OpenGL ES 2.0 or DirectX9 with shaders, my peformance is ...
2
votes
1answer
193 views
How to create texture using raw RGBA texture data without having to use LockRect
I was previously uploading textures to DirectX by creating texture in D3DPOOL_MANAGED and then calling LockRect to upload the texture data to DirectX. However, I have switched to using DirectX9 Ex, ...
0
votes
1answer
48 views
Multiplying matrices in HLSL
I have code that calculates a position like this in HLSL:
output.ShadowPos = input.VertexPos;
output.ShadowPos = mul(output.ShadowPos, gWorld);
output.ShadowPos = mul(output.ShadowPos, ...
0
votes
0answers
24 views
Blendshapes workflow in mudbox
I am new to mudbox. I want to create a face with blendshapes. Currently my face has 24576 polygons on level 3. I would like to go to level 2 or level 1, ie lower than 6000, but there, detail suffers.
...
1
vote
3answers
102 views
Applying scale to objects appears to have little effect when close up.
I just started out with D3D 11. My goal is to write a cube voxel engine (Minecraft style). Actually it's working pretty solid already, but when I finally tried to change the size of my cubes, I ran ...
-1
votes
1answer
80 views
Dynamically updating a shader resource view which was loaded from D3DX11CreateShaderResourceViewFromMemory?
I've loaded up multiple images from my custom video format into a vector after using D3DX11CreateShaderResourceFromMemory. Inside the rendering loop it's not updating the shader resource view like I ...
0
votes
1answer
128 views
Why am I getting rendered rectangles that are off relative to their bounding rectangles in this code?
I am rendering different rectangles with the help of the DirectXTK (PrimitiveBatch) and surrounding them with a BoundingOrientedBox (DirectXCollision.h). For visualization I draw the corners of the ...
2
votes
3answers
109 views
Can I store D3D9 textures so that they don't consume process memory and also don't require “lost device” handling?
I have an OpenGL application that uses a lot of texture memory. While the texture is stored in the system memory, that texture memory is not part of my application process memory.
When this ...
0
votes
1answer
83 views
Center directional light shadow to the cameras eye
I'm currently drawing my directional light shadow using this view and projection:
XMFLOAT3 dir((float)pitch, (float)yaw, (float)roll);
XMFLOAT3 center(0.0f, 0.0f, 0.0f);
XMVECTOR lightDir = ...
0
votes
1answer
117 views
Anyone know the frames per second that IOS apps run?
Anyone know the frame rate that iphones, ipads, and even android mobiles run?
0
votes
1answer
107 views
Where does XNA 4.0 takes memory from to perform operations?
I found this question which talks around the question I'm interested in. In particular I focused on the line where the guys says that GraphicsDevice object is literally a representation of the ...
1
vote
2answers
128 views
How can I repeat a portion of a texture on a quad?
I want to repeat a selected part of the texture into a quad.
I was looking at this thread, however the solution involved changing my HLSL.
Is there any way to do it without changing my shader ...
1
vote
1answer
85 views
When creating the horizontal blur, how is the vertex shader being called for each pixel?
I am following this tutorial. I am confused as to why the VertexShader is being called each time for the PixelShader. I was under the assumption the VertexShader is called only 6 times during the ...