Tag Info

New answers tagged

0

If you use same semantic for SemanticName, then you need to increase number for SemanticIndex. I also see that you are increasing InputSlot. This may be correct or not depending on how your data is layed out. If you really have 4 vertex streams (vertex buffers) then it's fine, but I assume that your instance transform is stored in one vertex buffer. Then ...


2

It's hard to make out exactly what you mean, but it sounds like you are dividing the vertex position by w as part of your computation in your vertex shader. This is incorrect, the division by w is actually done for you by the graphics processor. Consider the standard transformations here: (Original image from: ...


2

The problem is likely VS is trying to compile your Include.hlsl file which doesn't actually contain any functions. Use Include.hlsli instead.


2

Make sure you right click -> properties on each shader file and set the Shader Type as well. The property right above the shader model in your graphic.


2

The .fxo files are compiled shader files. Think of .obj/.o files for C and C++, but for HLSL. They're the result of running the shader compiler fxc.exe over your shader files. The advantages of .fxo files are three fold. First, the make reverse engineering of your shader code a bit more difficult, which is advantageous for some of the higher-end games with ...


0

In theory it should not happen but because of the way the GPU rasterizes triangle lines there are some rounding errors on this particular GPU that differ between the texture coordinates and the pixel coordinates. Texture coordinates does not use the same precision as the vertex coordinates, add to this perspective correction (even though the triangles are ...


0

Officially the uniform keyword indicates it is constant throughout the execution. All uniform variables to a shader must be resolved at compile-time. The HLSL compiler using the legacy Effects profile will generate 3 shaders in this case: A vs_4_0 profile vertex shader using the VS entry-point A ps_4_0 profile pixel shader using the PS entry-point holding ...


0

Disable blending when rendering your depth texture. Or use an actual depth texture as depth buffer in a frame buffer object then use that depth texture in later passes with a sampler.


0

Look into "Shader Constants Buffers" on DirectX and "Uniform Buffers" on OpenGL. These allow sending shader parameters all at once to the GPU and possibly reusing them every frames without having to resend them over the bus.


2

It isn't entirely clear what you are asking. Setting shader parameters IS a bottleneck - that's why engines batch by material - textures, parameters, lights, etc. While CPUs and GPUs are efficient, in order to get the most out of rendering performance you have to think about these things.



Top 50 recent answers are included