Posted By: Fab4
shade-c terrain - 09/24/09 09:00
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
and thats my complete code (i used the entities from the demo for trying)
i always get a syntax error in line 14 'skin1' undeclared identifier
by changing
to
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.
for changing the tile set you have to
if i said something wrong, please feel free to spit on me
but it worked this way in my script
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
Code:
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)
Code:
#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 identifier
by changing
Code:
MATERIAL* mtl_myTerrain () { skin1 = myTerrainColor; effect = "sc_obj_terrain.fx"; }
to
Code:
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.
Code:
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
Code:
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