hat sich erledigt, habe es hinbekommen ein logischer denkfehler 5 oder 6 usw geht ja nicht wie du schon sagtes der wert geht ja nur bis 1.00 hier nochmal die richtige darstellung des codes
////////////////////////////////////////////
// lite c - Datei
////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
action test()
{
MATERIAL* mate =
{
effect = "f.fx";
}
my.material = mate;
}
function main()
{
level_load("");
my = ent_create("wuerfel.mdl",vector(0,0,0),test);
}
////////////////////////////////////////////////////
// FX _ Datei
////////////////////////////////////////////////////
float4x4 matWorldViewProj;
Texture entSkin1;
sampler gColorSampler = sampler_state {
Texture = <entSkin1>;
MinFilter = Linear;
MipFilter = Linear;
MagFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};
struct appdata {
float3 Position : POSITION;
float4 UV : TEXCOORD0;
float4 Normal : NORMAL0;
};
struct texposVertexOutput
{
float4 HPosition : POSITION;
float2 UV : TEXCOORD0;
};
texposVertexOutput DiffTexVS(appdata IN, uniform float4x4 matWorldViewProj)
{
texposVertexOutput OUT = (texposVertexOutput)0;
float4 Po = float4(IN.Position.xyz,1.0);
float4 Nn = normalize(IN.Normal);
OUT.HPosition = mul(Po,matWorldViewProj);
float2 nuv = IN.UV.xy;
nuv.x += 0.2; // max 0.00 bis 1.00
nuv.y += 0.9; // max 0.00 bis 1.00
OUT.UV = float2(nuv.x, nuv.y);
return OUT;
}
float4 DiffTexPS(texposVertexOutput IN,uniform sampler2D ColorSampler) : COLOR
{
return tex2D(ColorSampler,IN.UV);
}
technique maine
{
pass p0
{
VertexShader = compile vs_3_0 DiffTexVS(matWorldViewProj);
PixelShader = compile ps_3_0 DiffTexPS(gColorSampler);
}
}
Last edited by ich; 08/11/12 18:07.