Operating System: windows10
Render System: D9D
Hi,
I have several compositors in the SHMUP Creator, and they work with most PCs.
But with some gfx cards, the result of those compositors is black, and I don't know why.
For instance, with the radeon 5700 XT... There is no error message during the shaders compilation.
I'm doing this for the compositor:
Code: Select all
compositor pixelateFX
{
technique
{
texture scene target_width target_height PF_BYTE_RGB
// the scene we want to modulate
target scene
{
input previous
}
target_output
{
input none
shadows off
pass render_quad
{
material modulatePixelate_out
input 0 scene
}
}
}
}
Code: Select all
vertex_program pixelate_out_vp hlsl
{
source outline.hlsl
entry_point outline_out_vp
target vs_1_1 vs_2_0
default_params
{
param_named_auto worldViewProj worldviewproj_matrix
}
}
fragment_program pixelate_out hlsl
{
source pixelate.hlsl
entry_point pixelate_out
target ps_3_0
default_params
{
param_named pixelSize float 1
param_named_auto resoWidth viewport_width
param_named_auto resoHeigth viewport_height
}
}
material modulatePixelate_out
{
technique
{
pass
{
vertex_program_ref pixelate_out_vp
{
}
fragment_program_ref pixelate_out
{
param_named pixelSize float 1
param_named_auto resoWidth viewport_width
param_named_auto resoHeigth viewport_height
}
texture_unit
{
tex_address_mode border
texture white.bmp
filtering bilinear
tex_address_mode clamp
}
}
}
}
Code: Select all
struct VIn
{
float4 p : POSITION;
float2 uv : TEXCOORD0;
};
struct VOut
{
float4 p : SV_POSITION;
float2 uv : TEXCOORD0;
};
struct PIn
{
float4 p : SV_POSITION;
float2 uv : TEXCOORD0;
};
VOut pixelate_out_vs(VIn IN, uniform float4x4 wvp)
{
VOut OUT;
OUT.p = mul(wvp, IN.p);
// clean up inaccuracies for the UV coords
float2 uv = sign(IN.p);
// convert to image space
uv = (float2(uv.x, -uv.y) + 1.0) * 0.5;
OUT.uv = uv;
return OUT;
}
//-------------------------------
//Pixelate
//-------------------------------
float4 pixelate_out(float2 texCoord: TEXCOORD0,
uniform float pixelSize,
uniform float resoWidth ,
uniform float resoHeigth ,
uniform sampler RT: register(s0)
) : COLOR {
half dx = pixelSize*(1.0/resoWidth);
half dy = pixelSize*(1.0/resoHeigth);
texCoord = half2(dx*floor(texCoord.x/dx), dy*floor(texCoord.y/dy));
float3 finalcol = tex2D(RT, texCoord).xyz;
return float4(finalcol,1);
}
S.