Tag Info

New answers tagged

0

Turns out I needed to make the identity matrix static.


0

Thank you a lot, the solution with tex2Dgrad work perfectly ! I don't have tested the solution with texldb, because there use registers and I want to avoid that.


0

Shader Model 2.0 has no such function, but "tex2Dgrad" can be used to the same effect if your shader has access to the dimensions of the texture. (Note that tex2Dgrad availability is subject to the caps bit D3DD3DPSHADERCAPS2_0_GRADIENTINSTRUCTIONS, so this isn't a sure thing) Instead of: color = tex2Dlod(map, uv, lod); Do: float scale = ...


1

Look at the pixel shader instructions in Shader Model 2. I found "texldb" : Biased texture load instruction. This instruction uses the fourth element (.a or .w) to bias the texture-sampling level-of-detail just before sampling Syntax texldb dst, src0, src1 https://msdn.microsoft.com/en-us/library/windows/desktop/bb206217(v=vs.85).aspx


1

D3D9 doesn't support constant buffers but all uniforms are placed into one global "constant buffer". You can set multiple float4 constants at once with IDirect3DDevice9::SetPixelShaderConstantF() by passing the number of constants as the last argument.


1

screenPosition is not at the right scale for texture coordinate lookup. Texture2D::Sample expects texture coordinates (0..1) while Texture2D::Load expects texel coordinates (0..[Width or Height]-1). So you're probably sampling way off the edge of the texture and either hitting the border color, or clamping to the edge which happens to be black. As a ...


0

So, after @Jon helped me understand HLSL and render targets, I could understand more tutorials on the internet and I found my answers in the following links, if anyone is interested: First I read some of the Riemer's tutorials of HLSL to understand its basics. Second I read RB Whitaker's HLSL/Effect tutorials to get some more information. Third I read the ...



Top 50 recent answers are included