Tag Info

Hot answers tagged


You can get this behaviour without a branch using the step function: float blendFactor = step(3.0f, dot(B.rgb, B.rgb)); return lerp(B, A, blendFactor); When B = (1, 1, 1), dot(B, B) = 3.0f, so step returns 1, blendFactor = 1, and the lerp gives a result of A. When B is anything less, dot(B, B) < 3.0f, so step returns 0, blendFactor drops to 0, and the ...


What you need is to retroproject the point on your map, from the inverse Mercator into 3d space, then place the sun as a directional light (not point like your image shows), and adjust the point for earth tilting (according to earth-sun rotation plane), then you can evaluate the light. It will automatically give you the weird valley shape that we see in ...


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


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.

Only top voted, non community-wiki answers of a minimum length are eligible