Tag Info

New answers tagged

1

Since you override SpriteBatch's default effect with your own, you are now responsible for setting effect parameters, especially matrices. You probably would like to replicate default SpriteBatch behaviour, so set effect.World to identity, and for projection default SpriteBatch effect uses effect.Projection = Matrix.CreateTranslation(-0.5f, -0.5f, 0) * ...


0

This problem may be related to mipmapping. The pixels along the edge are being mapped to a much more copressed LOD than the rest of the sphere, so the entire map is actually being compressed into that line. You may try putting in a tex2Dlod call in the shader and forcing the LOD to 0: return tex2Dlod(TextureSampler, float4(u, v, 0, 0)); Explanation and ...


1

Do not use full screen quads for your light volumes. A simple way is to draw a sphere for each light, in the position that the light occupies and of the same radius. This way, only the fragments actually affected by the light will be affected and your fragment shader will not be executed for the entire screen surface.


1

If you work out your matrix math, you'll see that the resulting w component of a vector/matrix multiplication depends on what's in the 4th column of the matrix. If the last column is [0 0 0 1] (which it typically is for most translation/orientation matrices), then the w component will be whatever the w component of the vector was. However for a typical ...


1

So after a few days of digging i finally found this question which is asking the exact same thing as me. He fixed the issue by using in my opinion a dirty hack. This involves getting the vertex colors from the original BasicShader when the model is created. The when it comes to draw, that color is passed in a parameter to the shader which in-turn uses it as ...


0

Answer: IDirect3DDevice9::SetTexture


1

You can use CheckDeviceFormat to determine if a given D3DFORMAT is suitable for the device's backbuffer; it's unlikely that particular format will be. Instead, try creating the device with any old acceptable backbuffer format (D3DFMT_X8R8G8B8 for example); it doesn't matter since you won't be rendering to it. Then create a new texture with the desired ...


1

Many possible reasons why something would not be rendered but if the difference is only in the matrix, here's some that I think might be most likely: Camera is too far (a triangle of size 1 in distance ~1732 with 45 degree FOV might simply be too small to see) You're looking at the triangle from the other side and culling is enabled (seems a bit unlikely ...


0

It appears there are syntax differences between HLSL for DX9 and DX11. I'm pretty such the above script was written for DX9, so it won't work as-is on DX11. http://stackoverflow.com/questions/2853997/directx-9-hlsl-vs-directx-10-hlsl-syntax-the-same EDIT: After doing research, HLSL is supported both in DX9 and DX11. You generally pre-compile HLSL with ...


0

HLSL is the High Level Shader Language used by Direct X. HLSL Shaders are run on the GPU at runtime and can only be run by the CPU in a special debug mode inside of Visual Studio. HLSL requires a Direct X pipeline to be setup in your application. Visual Studio can compile your shaders for you but you have to load them and feed them to your pipeline. You must ...



Top 50 recent answers are included