Quote:

so weit ich weiß ist das mit gs nciht möglich... da muss man doch sowas wie "tracen" des kappt aber nicht




Doch, das kann gemacht werden mit 3dgs, unter anderem ChrisB hat glaube ich so etwas schon mal geschafft. Auch Rhuarc wenn ich's richtig habe hatte ein projection shader gemacht der funktioniert hat. Leider hat keiner ihren shader code veröffentlicht so weit ich weiss,

Code:

//---------------------------------------------------------------------

// ProjTex_VS

//---------------------------------------------------------------------

OutputVS ProjTex_VS(float4 pos : POSITION0,

float3 diffuse : COLOR0,

float2 tiledTexC : TEXCOORD0)

{

OutputVS outVS = (OutputVS)0;



outVS.pos = mul(pos, gWVP);

outVS.diffuse = diffuse;

outVS.tiledTexC = tiledTexC;



float3 vert2light = gSpotPos.xyz - pos; // vector from vertex to the light

float d = length(vert2light); // distance between the two, need this for attenuation

outVS.attenuation = 1 - (d / gSpotRange); // linear attenuation

outVS.attenuation = clamp(outVS.attenuation, 0, 1);

outVS.spotTexC = mul(pos, gLightMat);

outVS.decalTexC = mul(pos, gDecalMat);



return outVS;

}
//---------------------------------------------------------------------

// ProjTex_PS

//---------------------------------------------------------------------

float4 ProjTex_PS(float3 diffuse : COLOR0,

float attenuation : COLOR1,

float2 tiledTexC : TEXCOORD0,

float4 spotTexC : TEXCOORD1,

float4 decalTexC : TEXCOORD2) : COLOR

{

float3 tile = tex2D(TiledTextureSampler, tiledTexC);

float3 spot = tex2D(SpotLightSampler, spotTexC);

float3 decal = tex2D(DecalSampler, decalTexC);



float3 final = tile * decal * (spot * 2 * attenuation + 0.1);

return float4(final, 1.0f);

}



I'm working on a projection shader too ..

Mfg,


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software