hi guys,
ive got a strange problem...
im trying to use the
shade-c terrain shader but it doesnt work...
thats how its in the manual:
How to use:
Set my.material = sc_mtl_obj_terrain;
Set sc_mtl_obj_terrain.skin1 to your colortilemap, or simply create a custom material
BMAP* myTerrainColor = "myTerrainTile.bmp";
MATERIAL* mtl_myTerrain ()
{
skin1 = myTerrainColor;
effect = "sc_obj_terrain.fx";
}
and thats my complete code (i used the entities from the demo for trying)
#define PRAGMA_PATH "shade-c"
#define PRAGMA_PATH "stuff"
#include <acknex.h>
#include <default.c>
#include "sc_core.c";
ENTITY* ent_terrain;
BMAP* myTerrainColor = "terrain_color.dds";
MATERIAL* mtl_myTerrain ()
{
skin1 = myTerrainColor;
effect = "sc_obj_terrain.fx";
}
void main()
{
level_load("empty.wmb");
wait(4);
ent_terrain = ent_create("terrain.mdl",vector(0,0,0),mtl_myTerrain);
wait(2);
//set resolution
video_switch(8,32,0);
//Setup Shade-C
sc_setup();
//
//you can now make full use of Shade-C!
}
i always get a syntax error in line 14
'skin1' undeclared identifierby changing
MATERIAL* mtl_myTerrain ()
{
skin1 = myTerrainColor;
effect = "sc_obj_terrain.fx";
}
to
MATERIAL* mtl_myTerrain =
{
skin1 = myTerrainColor;
effect = "sc_obj_terrain.fx";
}
the error disappers but the engine crashs in by error E1513.
i realy dont know what to do, and i would by happy about every help i can get.
[edit]
ok i did it after hours of trying.
first i had to create the terrain model without shader and change the material later.
ent_terrain = ent_create("terrain2.mdl",vector(0,0,0),NULL);
wait(2);
ent_terrain.material = sc_mtl_obj_terrain;
for changing the tile set you have to
sc_bmap_terrainColor = bmap_create("new_tile.dds");
wait(2);
sc_mtl_obj_terrain.skin1=sc_bmap_terrainColor;
if i said something wrong, please feel free to spit on me
but it worked this way in my script