|
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn),
581
guests, and 0
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: shader for tiling texture ?
[Re: darkinferno]
#360651
02/25/11 19:43
02/25/11 19:43
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
float4x4 matWorldViewProj;
float4x4 matWorld;
float4 vecSunDir;
float4 vecSkill41;
texture entSkin1;
sampler ColorMapSampler = sampler_state
{
Texture = <entSkin1>;
};
void DiffuseVS(
in float4 InPos: POSITION,
in float3 InNormal: NORMAL,
in float2 InTex: TEXCOORD0,
out float4 OutPos: POSITION,
out float2 OutTex: TEXCOORD0,
out float3 OutNormal: TEXCOORD1)
{
OutPos = mul(InPos, matWorldViewProj);
OutNormal = normalize(mul(InNormal, matWorld));
OutTex = InTex*vecSkill41.x;
}
float4 DiffusePS(
in float2 InTex: TEXCOORD0,
in float3 InNormal: TEXCOORD1): COLOR
{
float4 Diffuse = saturate(dot(-vecSunDir, normalize(InNormal)));
float4 Color = tex2D(ColorMapSampler, InTex);
return (0.5+Diffuse)*Color;
}
technique DiffuseTechnique
{
pass P0
{
VertexShader = compile vs_2_0 DiffuseVS();
PixelShader = compile ps_2_0 DiffusePS();
}
}
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|