Hey thanks GG I was about to let you know about this
Quote: "The plane receives vertex diffuse lighting. Have you allowed for that?"
Uh, Have I? Sorry I do not fully understand the question, isn't that by default?
This is the DBPro code, but it needs the media attached in the previous post:
Rem Project: Test ScreenQuad VS Sprite
Rem Created: 22/09/2010 20:03:22
Rem ***** Main Source File *****
Sync On
Sync Rate 0
Set Display Mode 800, 600, 32
Set Window Off
Draw Sprites First
Backdrop Off
Load Image "test1.jpg", 1, 1 rem filtering off
Make Object Plain 1, 2.0, 2.0
Load Effect "quad.fx", 1, 0
Set Object Effect 1, 1
Make Vector4 1
Set Vector4 1, Screen Width(), Screen Height(), 0, 0
Set Effect Constant Vector 1, "ViewSize", 1
Texture Object 1, 0, 1
Sprite 1, 0, 0, 1
Do
Set Cursor 0, 0
if ShiftKey()
Show Sprite 1
Sprite 1, 0, 0, 1
Hide Object 1
Print "SPRITE: GOOD TEXTURE ALIGN"
Print "Release Shift Key To Show Screen Quad"
else
Print "SCREEN QUAD OBJECT: BAD TEXTURE ALIGN"
Print "Hold Shift Key To Show Sprite"
Hide Sprite 1
Show Object 1
endif
Sync
Loop
And this is the Quad.fx code:
float2 InvViewSize;
texture background < string Name=""; >;
sampler2D background_smp = sampler_state
{
Texture = <background>;
AddressU = Clamp; AddressV = Clamp;
//Original line:
//MinFilter = Linear; MagFilter = Linear; MipFilter = None;
//Filtering off:
MinFilter = None; MagFilter = None; MipFilter = None;
};
struct output
{
float4 opos : POSITION;
float2 uv : TEXCOORD0;
};
output VS( float4 pos : POSITION )
{
output OUT;
OUT.uv = pos.xy * float2(0.5,-0.5) + 0.5;
pos.xy = pos.xy + float2( -InvViewSize.x, InvViewSize.y );
OUT.opos = pos;
return OUT;
}
float4 PS(output IN) : COLOR
{
return tex2D(background_smp,IN.uv);
}
technique screenquad
{
pass p0
{
VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}
}
There is no lighting for the plane, other than the one at the shader.
The key problem for me is that I need precise texture output for the star background, preferably using a screen quad for full screen shaders, and so far only a sprite can give the expected precision.