|
|
Re: @Steempipe (urgent)
[Re: Steempipe]
#25176
01/15/05 00:06
01/15/05 00:06
|
Joined: Dec 2004
Posts: 11
Galiot
Newbie
|
Newbie
Joined: Dec 2004
Posts: 11
|
Hello, Currently I'm using the script found on Steempipe's webpage(http://steempipe.technicalfoundry.com/terrain/terraintexffp_4-7-04.zip) and I've got the terrain up and looking pretty well, although I am having some problems when I try to Publish the project. Here is a screenshot of the error message. Not having any luck figuring out what is causing this error, any help would be appreciated. The game runs fine if I run it from the WED.
|
|
|
Re: @Steempipe (urgent)
[Re: ello]
#25178
01/15/05 01:42
01/15/05 01:42
|
Joined: Dec 2004
Posts: 11
Galiot
Newbie
|
Newbie
Joined: Dec 2004
Posts: 11
|
Quote:
try putting the fx into a separate fx-file. this things happen when to much shadercode is inside the wdl/material
I'm not sure exactly what you mean by this, if you could explain in more detail it would be very helpful.
Thanks for the input.
|
|
|
Re: @Steempipe (urgent)
[Re: Galiot]
#25179
01/15/05 01:52
01/15/05 01:52
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
What he means is, that you should copy your code into a new file and save it as (for example) shader.fx ...
Code:
///////////////////////////////////////////////////////////
// FFP Terrain MultiTexturing Effect
//
// By: Eric A. Hendrickson-Lambert (Steempipe)
//
// Rev. 04.05.04.1
//
// Description:
// Using 2 tileable textures and an alphamap for blending.
// This code uses (2) passes because more than 2 stages would be needed
// for 1 pass. The First Fallback Technique is just a 2 stage 1 pass but
// has the transformation. The second fallback has no transformation.
//
//////////////////////////////////////////////////////////
// A tileable texture
//bmap grass = <tilegrass.bmp>;
//RGB Channels are blank
//The A channel has the blending weight (pattern)
bmap blendmap = <blendme.tga>;
// A tileable texture
//bmap sand = <tilesand.bmp>;
function mtl_terraintex_init()
{
//bmap_to_mipmap(mtl.skin1);
bmap_to_mipmap(mtl.skin2);
//bmap_to_mipmap(mtl.skin3);
//
// Adjust the texture transform to do some tiling of the textures
//
mtl.matrix11 = float(18); // default u scale
mtl.matrix22 = float(18); // default v scale
}
material mat_terraintex
{
//skin1 = grass;
Skin2 = blendmap;
//skin3 = sand;
// define a material effect string
event = mtl_terraintex_init;
effect =
"
matrix matMtl;
texture entSkin1; // Grass
texture mtlSkin2; // Alpha Blending Map
texture entSkin2; // sand
texture entSkin3; // detailmap
texture entSkin4; // Basic Skin
// default technique
technique ffp_terrain_tex
{
pass P0
{
alphablendenable=false;
//
// Stage 0
//
Texture[0] = <entSkin1>;
magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;
TextureTransformFlags[0] = Count2;
TextureTransform[0] = <matMtl>;
texcoordindex[0]=0;
ColorArg1[0] = Texture;
ColorOp[0] = selectarg1;
alphaop[0]=disable;
//
//stage 1
//
colorop[1]=disable;
alphaop[1]=disable;
}
pass P1
{
// We need to enable alphablending
alphablendenable=true;
srcblend=srcalpha;
destblend=invsrcalpha;
//
// Stage 0
//
Texture[0] = <mtlSkin2>;
magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;
//
// We don't want the alphamap to tile
//
TextureTransformFlags[0] = disable;
texcoordindex[0]=1;
ColorArg1[0] = current;
ColorOp[0] = selectarg1;
alphaarg1[0] = texture | alphareplicate;
alphaop[0]=selectarg1;
//
// Stage 1
//
Texture[1] = <entSkin2>;//sand
magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;
TextureTransformFlags[1] = Count2;
TextureTransform[1] = <matMtl>;
texcoordindex[1]=0;
ColorArg1[1] = texture;
ColorOp[1] = modulate;
alphaarg1[1] = current | alphareplicate;
alphaop[1]=disable;
//
// Stage 2
//
colorop[2]=disable;
alphaop[2]=disable;
}
}
technique firstfallback
{
pass P0
{
//
// Stage 0
//
Texture[0] = <entSkin4>;
magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;
texcoordindex[1]=0;
ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;
ColorOp[0] = Modulate;
//
// Stage 1
//
Texture[1] = <entSkin3>;
magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;
TextureTransformFlags[1] = Count2;
TextureTransform[1] = <matMtl>;
texcoordindex[1]=1;
ColorArg1[1] = texture;
ColorArg2[1] = Current;
ColorOp[1] = addsigned;
}
}
technique secondfallback
{
pass P0
{
//
// Stage 0
//
Texture[0] = <entSkin4>;
ColorArg1[0] = Texture;
//ColorArg2[0] = Diffuse;
ColorOp[0] = selectarg1;
//
// Stage 1
//
Texture[1] = <entSkin4>;
ColorArg1[1] = texture;
ColorArg2[1] = Current;
ColorOp[1] = modulate;
}
}
"; // end of the effect string
}
action ffp_TerrainTex
{
my.material = mat_terraintex;
}
Is this the code you are using?
Cheers
|
|
|
Re: @Steempipe (urgent)
[Re: ShoreVietam]
#25184
01/16/05 19:03
01/16/05 19:03
|
Joined: Jul 2002
Posts: 2,002 Europe
ShoreVietam
Expert
|
Expert
Joined: Jul 2002
Posts: 2,002
Europe
|
Ok I got it now! Set AlphaBlendEnable = True; AlphaTestEnable = True; at the beginning of every pass to make camera transparency repossible. The terrain is a bit dominant, but better than nothing!
|
|
|
|
|
|