Discussion:
What will be return value of tex1D( Sampler, Index ), when sampler texture format is an 8 bit one.
(too old to reply)
Santhosh
2008-09-16 12:35:59 UTC
Permalink
If my Sampler Texture is a D3DFMT_A8.

float4 Output = tex1D( Sampler, index );

what will be the content of Output.a, Output.r,Output.g,Output.b.

In which component I will get the correct value from Sampler texture.
legalize+ (Richard [Microsoft Direct3D MVP])
2008-09-16 23:49:00 UTC
Permalink
[Please do not mail me a copy of your followup]
Post by Santhosh
If my Sampler Texture is a D3DFMT_A8.
float4 Output = tex1D( Sampler, index );
what will be the content of Output.a, Output.r,Output.g,Output.b.
In which component I will get the correct value from Sampler texture.
You could find out by trying it really quick in FX Composer or
RenderMonkye.

My guess is that it would go to the alpha or be replicated across all
components of the float4.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>

Legalize Adulthood! <http://blogs.xmission.com/legalize/>
S***@gmail.com
2008-09-17 10:41:58 UTC
Permalink
Post by Santhosh
If my Sampler Texture is a D3DFMT_A8.
float4 Output = tex1D( Sampler, index );
what will be the content of Output.a, Output.r,Output.g,Output.b.
In which component I will get the correct value from Sampler texture.
As DirectX SDK says

"If the source texture contains fewer than four components, defaults
are placed in the missing components. Defaults depend on the texture
format as shown in the following table:

Texture Format Default Values
D3DFMT_R5G6B5, D3DFMT_R8G8B8, D3DFMT_L8, D3DFMT_L16, D3DFMT_R3G3B2,
D3DFMT_CxV8U8, D3DFMT_L6V5U5 A = 1.0
D3DFMT_V8U8, D3DFMT_V16U16, D3DFMT_G16R16, D3DFMT_G16R16F,
D3DFMT_G32R32F B = A = 1.0
D3DFMT_A8 R = G = B = 0.0
D3DFMT_R16F, D3DFMT_R32F G = B = A = 1.0
All depth/stencil formats R = B = 0.0, A = 1.0

Loading...