Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (vicknick, 7th_zorro, 1 invisible), 890 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to assign materials to level geometry in A6 #229144
09/24/08 19:45
09/24/08 19:45
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
Again a shader-noob-question:

How can i add a material to my level geometry (a6) ?
Give the material a level-texture-name ?

I want to add this dot3 shader to my level blocks:

Code:
material mat_bumpmap{
flags=tangent;
effect="  
matrix matWorldViewProj; 
 matrix matWorld; 
 texture entSkin1; 
    //Colormap  
texture entSkin2;     
//Normalmap   
vector vecLight; 
 vector vecFog; 
 vector vecSunDir;  
  technique dot3mapping  {  
  pass p0    {     
 AlphaBlendEnable = False;    
  AlphaTestEnable = False;    
  Lighting = True;   
   DitherEnable = True; 
           Texture[0] = <entSkin2>;
      Texture[1] = <entSkin1>; 
     ColorOp[0] = Dotproduct3; 
     ColorArg1[0] = Texture;  
    ColorArg2[0] = Diffuse;  
    ColorOp[1] = Modulate; 
     ColorArg1[1] = Texture; 
     ColorArg2[1] = Current; 
     VertexShaderConstant[0]=<matWorldViewProj>;
      VertexShaderConstant[4]=<matWorld>;  
          vertexShaderConstant[9]= <vecFog>;
      vertexShaderConstant[10]=<vecSunDir>;
      vertexShaderConstant[11]=<vecLight>; 
     VertexShaderConstant[12]={0.5f, 0.5f, 0.0f, 0.0f}; 
           VertexShader =        asm	{
				vs_1_1	// Declarations	
dcl_position v0 	
dcl_normal v3	
dcl_texcoord0 v7	
dcl_texcoord1 v8 	
// Transform position to clip space	
m4x4 oPos, v0, c0	
// Tranform normal and tangent to world space	
m3x3 r3, v8, c4	
m3x3 r5, v3, c4	// Compute binormal 	
mul r0, r3.zxy, r5.yzx	
mad r4, r3.yzx, r5.zxy, -r0	
// Transform (Sun)light vector to tangent space	
dp3 r0.x, r3.xyz, -c10	
dp3 r0.y, r4.xyz, -c10	
dp3 r0.z, r5.xyz, -c10	
// Normalize transformed light vector	
dp3 r0.w, r0, r0	
rsq r0.w, r0.w	
mul r0, r0, r0.w	
// Put light vector in range from 0 to 1	
mad r0, r0, c12.x, c12.x	
// Adjust the intensity 	
mul r0, r0, c12.y	
// Add environment light then send it down the diffuse pipe
	add oD0.xyz,r0,c11	        
	// Fog calculations	
mov r1.w,c9.w				
dp4 r0,v0,c6			
// distance to camera position	
add r0,r0,-c9.x		       
 // distance-fog_start	
mad r0.x,-r0.x,c9.z,r1.w	
// 1-(distance-fog_start)*(1/(fog_end-fog_start))	
max oFog,r0.x,c12.w		
// clamp with custom max value	
// Pass the texture coordinates through
	mov oT0, v7	
mov oT1, v7	
};   
 }  
}
";
}



Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: How to assign materials to level geometry in A6 [Re: rayp] #229567
09/28/08 17:21
09/28/08 17:21
Joined: Mar 2003
Posts: 1,095
Germany
nightshade Offline
Serious User
nightshade  Offline
Serious User

Joined: Mar 2003
Posts: 1,095
Germany
Hi, yes the material-name must be the same as the texture-name (without .bmp,etc).

Re: How to assign materials to level geometry in A6 [Re: nightshade] #229579
09/28/08 18:43
09/28/08 18:43
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
Ok but this dot3 shader fex needs the normalmap file in the
second skin (normally assigned to models).
WALLTEX1 (assigned in Wed on a wall)
MATERIAL WALLTEX1{...} (written in script)
But how can i assign the normalmap (fex WALLTEX1.TGA) to
the material/wall ?


Please help again guys!


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: How to assign materials to level geometry in A6 [Re: rayp] #229589
09/28/08 19:39
09/28/08 19:39
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
rtfm

Re: How to assign materials to level geometry in A6 [Re: lostclimate] #229677
09/29/08 15:28
09/29/08 15:28
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
Wow very helpfull!

lmaa


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: How to assign materials to level geometry in A6 [Re: rayp] #229680
09/29/08 15:44
09/29/08 15:44
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
your welcome laugh
no but it is in the manual, and if you can't find it in there, then you don't fully understand how the manual is laid out, which means you need practice using the manual, and if you need practice, this would be a perfect thing to use.

Re: How to assign materials to level geometry in A6 [Re: lostclimate] #229686
09/29/08 16:21
09/29/08 16:21
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
My question is, how to use the dot3 shader (above) with the level geo. I can
attach materials to walls....but not this shader. This is my question.
If i hadnt tryed it for weeks i wouldnt write such questions in a forum.
So, thanx for nothing.

Any people there who "want" to help ?


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: How to assign materials to level geometry in A6 [Re: rayp] #229687
09/29/08 16:29
09/29/08 16:29
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
you attach the shader to the materials...

Re: How to assign materials to level geometry in A6 [Re: lostclimate] #229697
09/29/08 17:01
09/29/08 17:01
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline OP

X
rayp  Offline OP

X

Joined: Jul 2008
Posts: 2,107
Germany
"But how can i assign the normalmap (fex WALLTEX1.TGA) to
the material/wall ?"

this dot3 shader needs to skins (colormap, normalmap). Colormap = Levelwall..ok
But how can i say the material to use a file like WALLTEXNORMAL.TGA instead
of EntSkin2 and WALLTEX.TGA instead of EntSkin1 ?!?

Tryed things like
bmap Normal_Map_Test...
ENTSKIN1 = Normal_Map_Test
...wont work...


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: How to assign materials to level geometry in A6 [Re: rayp] #229704
09/29/08 18:41
09/29/08 18:41
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
that has more to do with how materials work than it does with it being geometry, look up mtlSkin1-4

Page 1 of 2 1 2

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