Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
? only geting black and white ? #20794
12/06/03 11:17
12/06/03 11:17
Joined: Mar 2003
Posts: 60
wyldecatt Offline OP
Junior Member
wyldecatt  Offline OP
Junior Member

Joined: Mar 2003
Posts: 60
There must be something im missing when trying to add any of the shader scripts in these past threads ive tryied several from the bump mapping to the terrain multitertexturing and every time i only get a black and white shaded mdl or terrain no color maps is there something simple im missing?

Thanks in advance Wyldecatt

Re: ? only geting black and white ? [Re: wyldecatt] #20795
12/06/03 12:43
12/06/03 12:43
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Post the code you are using currently...i cant tell what the problem is by your description


Sphere Engine--the premier A6 graphics plugin.
Re: ? only geting black and white ? [Re: Matt_Aufderheide] #20796
12/06/03 12:52
12/06/03 12:52
Joined: Mar 2003
Posts: 60
wyldecatt Offline OP
Junior Member
wyldecatt  Offline OP
Junior Member

Joined: Mar 2003
Posts: 60
Current code im using
material mat_terrain_multitexture
{
effect=
"
texture texSkin1;
texture texSkin2;
texture texSkin3;

matrix matWorldViewProj;
matrix matWorld;
matrix matWorldView;

vector vecSunDir;
vector vecDiffuse;
vector vecAmbient;
vector vecLight;
vector vecFog;
vector vecSkill41;

technique multitexture
{
pass p0
{
Texture[0]=<texSkin1>;
Texture[1]=<texSkin2>;
Texture[2]=<texSkin3>;

MagFilter[2]=linear;
MinFilter[2]=linear;
MipFilter[2]=linear;

ZWriteEnable=true;

VertexShaderConstant[0]=<matWorldViewProj>;
VertexShaderConstant[4]=<matWorld>;
VertexShaderConstant[8]=<matWorldView>;

VertexShaderConstant[16]=<vecSunDir>;
VertexShaderConstant[17]=<vecDiffuse>;
VertexShaderConstant[18]=<vecAmbient>;
VertexShaderConstant[19]=<vecLight>;
VertexShaderConstant[20]=<vecFog>;
VertexShaderConstant[64]=<vecSkill41>; //(u_scale1, v_scale1, u_scale2, v_scale2)
VertexShaderConstant[95]=(0.0f,0.0f,0.0f,0.0f);

VertexShader=
decl
{
stream 0;
float v0[3]; //position
float v3[3]; //normal
float v7[2]; //uv
}
asm
{
vs.1.1
m4x4 oPos,v0,c0 // transform position to clip space

m3x3 r0,v3,c4 // transform normal to world space
dp3 r0.w,r0,r0 // renormalize it
rsq r0.w,r0.w
mul r0,r0,r0.w

dp3 r0,r0,-c16 // normal.light -> lighting constant
mul r0.xyz,r0,c17 // modulate against material diffuse color
add oD0.xyz,r0,c19 // add environment light

mov r1.w,c20.w // r1.w=1
dp4 r0,v0,c10 // distance to camera position
add r0,r0,-c20.x // distance-fog_start
mad r0.x,-r0.x,c20.z,r1.w // 1-(distance-fog_start)*(1/(fog_end-fog_start))
max oFog.x,r0.x,c95.w // clamp with custom max value

mul oT0.xy,v7.xy,c64.xy // output scaled uvs - stage 0
mul oT1.xy,v7.xy,c64.zw // output scaled uvs - stage 1
mov oT2.xy,v7.xy // output uvs - stage 2
};

PixelShader=
asm
{
ps.1.3
def c0,0,0,0,1
tex t0 // sample t0
tex t1 // sample t1
tex t2 // sample t2
lrp r0.rgb,t2.a,t0,t1 // blend t0 with t1 using the alpha channel of t2
+mov r0.a,c0
//add r0.rgb,r0,t2_bias // add(signed) rgb of t2
mul r0.rgb,r0,v0 // modulate with diffuse vertex lighting
};
}
}
";
}
/*
starter mat_terrain_multitexture_init
{
vec_set(mat_terrain_multitexture.ambient_blue,mat_terrain.ambient_blue);
vec_set(mat_terrain_multitexture.diffuse_blue,mat_terrain.diffuse_blue);
vec_set(mat_terrain_multitexture.specular_blue,mat_terrain.specular_blue);
mat_terrain_multitexture.power=mat_terrain.power;
}


///Action of my entity
action terrains
{
my.skill41=float(10);
my.skill42=float(20);
my.skill43=float(5);
my.skill44=float(10);

my.flare=off;
my.transparent=off;
my.material=mat_terrain_multitexture;
}
///This is the curent code im trying although i get the same effect on all the shader codes ive tried to include Matts 2nd pass
i have A6 game studio comercial 6.2
im assumimng i dont know how to asign the textures correctly of something
Thank you Wyldecatt

Re: ? only geting black and white ? [Re: wyldecatt] #20797
12/06/03 14:12
12/06/03 14:12
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
texture texSkin1;
texture texSkin2;
texture texSkin3;

Chenge all cases of "texskin.." to "entSkin.." that was chnaged from the earlier betas. It should work then


Sphere Engine--the premier A6 graphics plugin.
Re: ? only geting black and white ? [Re: Matt_Aufderheide] #20798
12/06/03 16:21
12/06/03 16:21
Joined: Mar 2003
Posts: 60
wyldecatt Offline OP
Junior Member
wyldecatt  Offline OP
Junior Member

Joined: Mar 2003
Posts: 60
Oh wow thank you so much that was the fix looks like ill have some fun with things now


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1