DirectX 11 is the latest release of Microsoft's collection of APIs which contain features to aid in game development.
2
votes
1answer
74 views
Using a switch command in one shader vs multiple shaders
If you have multiple shaders, could you instead of switching between shaders all the time just have one shader with a switch and each case will send you along to another shader function which you ...
1
vote
1answer
96 views
Painter algorithm on transparant objects
Why do you have to use the painter's algorithm when drawing transparant objects ? Can't you just use a z-buffer, draw all non transparant/opaque objects, then draw all transparant/opaque objects last?
...
2
votes
1answer
75 views
Mesh objects and a draw function
I'm currently working with a mesh class so I can easily create mesh objects. Now I want a draw function in my mesh class so when ever i want draw it to the screen I can just call it without any fuss. ...
2
votes
1answer
95 views
How do you add rotation to particles?
Today I was working on a particle system and I can't figure out how to give the particle billboards a rotation (so to have them spinning clockwise or counter-clockwise while facing the player). I ...
1
vote
1answer
70 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 ...
-2
votes
0answers
71 views
2d mouse coordinates to 3d coordinates [closed]
I have the following problem: I have my mouse coordinates and I have a Model (Data Points) and I want the 3d Coordinates of my mouse coordinates and my lookAt Vector of this coordinates, so that I can ...
2
votes
1answer
56 views
Implement Displacement Mapping: Gaps along seams
I am implementing Displacement mapping using DirectX 11 with its new tessellation stages.
Diffuse map and displacement map are generated by xNormal.
The result after I applied displacement mapping is ...
0
votes
1answer
54 views
Sharing the effect
my problem is :
If I load 2 models ( the same model zombie ) and give them the same effect I got the following error :
for(int i =0 ; i<2 ; i++)
{
dwarfModel[i].model ...
1
vote
1answer
25 views
Independent blending with DXGI_FORMAT_R16G16_SINT
I'm implementing direct volume rendering engine with volume bricking, but I'm stuck with this problem:
For each volume brick I render to color render target [CRT] (for visualization) and to data ...
3
votes
2answers
78 views
Why is there a different set-constant-buffer function for every shader type?
Why are there VSSetConstantBuffers(), GSSetConstantBuffers(), PSSetConstantBuffers() (and so on) instead of just one SetConstantBuffers() for all shaders?
Should I have completely separate constant ...
0
votes
2answers
74 views
What are registers in HLSL for?
I've read this: http://msdn.microsoft.com/en-us/library/windows/desktop/dd607359%28v=vs.85%29.aspx but it's more of a syntax descrption and not a purpose explanation. What actually are registers in ...
0
votes
1answer
35 views
Constant buffer content packing
I've read this: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476898%28v=vs.85%29.aspx#Shader_Constant_Buffer but there's not much information in it. When creating a constant buffer do I ...
3
votes
0answers
63 views
Multipass shaders and switching between passes
As mentioned here Effects should be avoided in DX11. If I understand correctly, that includes techniques and passes defined in *.FX files. So when doing a multipass shader (like the always-mentioned ...
1
vote
1answer
70 views
How to disable mipmapping?
I'm making a 2D game in which I create some textures dynamically for displaying as simple 2D quads. To achieve this, I call ID3D11Device::CreateTexture2D that requires a D3D11_TEXTURE2D_DESC.
typedef ...
1
vote
1answer
70 views
Compiler cannot find some DX11 types (but can find DX10)?
my problem is probably trivial but I'm new to DX and have some trouble. I've found a code snippet (of a Shader class) with ID3D10Effect and ID3D10EffectTechnique types but I'm using DX11 so I changed ...
1
vote
0answers
29 views
DirectX11 : get number of texture objects
Is it somehow possible to get the number of all texture objects on a device context?
thanks!
0
votes
0answers
51 views
DX11 Tessellation LOD with diameter incorrect tessellation values [closed]
I implemented the LoD with diameter from following withpaper NVidia TerrainTessellation WhitePaper. In Chapter "Hull Shader:Tessellation LOD" Page 7 there is a very good explenantion of the LoD with ...
-2
votes
1answer
60 views
Does it matter where I initialize Directx11's shader constant buffer?
Should I initialize it before Map(), before Unmap() does it make no difference?
-1
votes
1answer
77 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
76 views
When would a GPU need to write data to a vertex (or other) buffer?
I'm trying to understand why, when and how a GPU would need to write data to some buffer inside its own Video Ram.
In Direct3D 11, there are two flags that concern this, which are ...
4
votes
1answer
166 views
How can I use shaders to make a square have a waving effect?
I'm new to using shaders to do some fancy effects and I'm struggling with them. I'm using DirectX 11 and HLSL. I have this square in the middle of the screen:
It's just a square that I've created ...
1
vote
1answer
75 views
Do textures that are inside a shader resource need to be explicitly released too? (DirectX 11)
I have a ID3D11Texture2D (that I've created manually) inside a ID3D11ShaderResourceView. When I want to Release() the resource view, do I need to Release() the texture that it is inside too? Or is it ...
1
vote
1answer
69 views
changing depth stencil state in DirectX11
An example from Frank D Luna's 3d Game Programming with Dx11 shows the following effect technique:
technique11 DrawTech
{
pass P0
{
SetVertexShader( CompileShader( vs_5_0, DrawVS() ) );
...
1
vote
1answer
126 views
Driver error when using multiple shaders
I'm using 3 different shaders:
a tessellation shader to use the tessellation feature of DirectX11 :)
a regular shader to show how it would look without tessellation
and a text shader to display ...
0
votes
1answer
168 views
How do I implement my old OpenGL-based gfx_render_triangle_list using DX11?
I am working at a game that has lots of procedural content. I had built a game engine using OpenGL that handles everything needed for creating a basic 2D game, sprites, primitives, blending, polygons ...
7
votes
1answer
199 views
DirectX11 without window attached?
I just wonder, if it's possible to initialize and use DX11 or DX9 for offscreen rendering only - meaning with no attached window.
My intention is to do some GPU benchmarking before opening actual ...
2
votes
1answer
122 views
How can I render the whole faces instead of only the vertices? [closed]
I'm doing my master thesis in comparing DX9 LoD with DX11 Tesselation LoD. Therefore I use a ShaderManager that calls either the shader for the DX9 implementation, where the model is exchanged by the ...
2
votes
1answer
67 views
Emulate border color texture address mode efficiently
In WinRT the border color texture address mode is not supported.
The best I came up with in emulating the border address mode, is doing this in my pixel shader:
float4 tcol = tex.Sample(texSampler, ...
0
votes
1answer
576 views
Creating a simple 2d engine (C++), best way to create an Sprite class?
Since MS announced that they are not give more support to XNA , for me was an opportunity to start to learn DirectX , so i wanted to learn DX11,
i was following this tutorials
...
1
vote
0answers
135 views
Shaders Working in XNA but not Monogame Win8
Hey so I'm bringing a shader over from XNA to Win8. To test things I'm using josack's tutorial on pixel shaders:
http://blog.josack.com/2011/07/xna-2d-dynamic-lighting.html
I've got it running in my ...
3
votes
1answer
116 views
DXGI and 2+ full screen displays on Windows 7
I am developing a program that needs two full screen Direct3D dispalys. According to the documentation I should create the swap chains in windowed mode and then switch to full screen mode. While this ...
1
vote
2answers
118 views
How to obtain a pointer to the compiled shader in D3D11
My shader creation code looks like this.
std::shared_ptr<IRenderUtility::IVertexShader> D3D11RenderUtility::CreateVertexShader(IShader::INIT_DESC & desc) const
{
HRESULT result;
...
4
votes
2answers
226 views
Geometry shader worldviewprojection
I'm writing a simple geometry shader to create 3D "primitives" in place of a single point. I am performing all of the world-view-projection conversions within the geometry shader after creating the ...
2
votes
1answer
133 views
Creating Input layouts for different vertex types
I'm still in the planning phase for a hobby abstract renderer, and i'm wondering how i should handle multiple vertex types and different shader inputs. (This is my first graphics project, so cut me ...
-1
votes
2answers
468 views
Problem rendering cube using DirectX 11
I'm toying with DirectX 11 and am trying to render a simple cube, but I can't seem to get anything to show (except the clear color, which is a good sign I suppose...)
Everything seems to be working, ...
3
votes
1answer
423 views
Different shaders for different objects DirectX 11
I am learning Direct3D 11, and in all basic tutorials I found on shader writing, Vertex and Pixel shaders are written so they transform whole scene same way. Tutorials like render cube with texture...
...
3
votes
1answer
331 views
Proper use of Dynamic Vertex Buffers for rapid update
I am creating a C#/SharpDx/DirectX10 application to plot line charts in a fast way.
I have a prototype which uses Dynamic Vertex Buffers and fills a fixed-size buffer, say 1M vertices, with new data ...
0
votes
1answer
94 views
Rendering an object more than once
Right now I'm facing the issue of rendering the same objects more than once in Directx 11, as the object has:
A diffuse shader
A directional lighting shader
A texture shader
Now the final color ...
1
vote
1answer
208 views
Render video from file to DirectX11 texture
Is there a way to render a video from file (avi, mp4, etc...) to a texture in a directx11 environment?
If so, how?
0
votes
1answer
307 views
Loading a vertex shader compiled by Visual Studio 2012
I've got an extremely simple vertex shader that Visual Studio 2012 compiles into a .cso file. Now I want to load this file and create a vertex shader on the graphics device using the ...
0
votes
0answers
41 views
Cascaded Shadow Maps left handed to right handed coord system
Im trying to port the Directx SDK (june 2010) sample (CascadedShadowMaps11) into a right handed version (to later implement in my engine) but i can't figure out the math, so far i got it partially ...
0
votes
1answer
143 views
Stencil buffer and transparent pixels
Do transparent pixels cause a stencil buffer operation (increment, decrement, etc.) to be executed?
My understanding was that only opaque pixels cause a stencil buffer operation, transparent pixels ...
0
votes
2answers
194 views
Multipass shader in DirectX 11
As far as I understand for DirectX11 it is recommended to have multiple single pass shaders, so the the method with multiple passes in one shader file is deprecated. Is my understanding correct and ...
-1
votes
1answer
92 views
How To Buffer Many Vertex, Geometry, and Pixel Shaders
What is the best way to buffer Vertex Shaders, Pixel Shaders, etc into the Device/Device Context without having to reload them from the filesystem every time?
ID3D11Device::CreateVertexShader ...
3
votes
1answer
142 views
Constant Buffer size mismatch on PS, fine on VS and GS
I have the following C/C++ struct:
struct ShadowMapCB {
Math::Matrix4 cropMatrix[4];
Math::Matrix4 textureMatrix[4];
float splitPlane[4];
};
and my HLSL constant buffer:
...
3
votes
3answers
384 views
How to Bind Multiple Shapes/Models to One Vertex Buffer?
If I have two Vertex Arrays, one for Square, and one for Triangle; what is the best way to bind them to the VertexBuffer?
What are the patterns used to write multiple vertices to the VertexBuffer? ...
3
votes
1answer
186 views
Per Instance Textures, and Vertex And Pixel Shaders?
How do you implement per instance textures, vertex shaders, and pixel shaders?
Given:
1. Two different model templates in Vertex Buffer, Square & Triangle
2. Instance Buffer with [n] instances of ...
1
vote
1answer
416 views
DirectX / Instance Buffer - How To Use Instance Buffers To Enable Reuse of VertexBuffer Data?
I created a simple Model framework in C++ 11 so that the same model can be rendered in different parts of a scene.
What I am trying to figure out is how to reference VertexBuffer data already "set" ...
1
vote
1answer
206 views
DirectX post-processing pipeline
I'm trying to make a simple post processing pipeline, depicted as follows with 3 effects in this case:
|------| |------| |------|
I ...
0
votes
1answer
107 views
Weird shader compiler error
I am trying to draw a full screen quad without a vertex buffer.
SV_VertexID should do the trick, although I get a weird error in my shader on the following line:
PS_IN VS(uint VertexID : ...



