shaders on LAN

Posted By: sheefo

shaders on LAN - 10/19/06 16:20

How can I make a shader appear on the client.

I have "initialize_shaders" function which is called from main, which sets up the shader for my terrain.
Posted By: zSteam_

Re: shaders on LAN - 10/19/06 19:43

hello
test this
Code:
 
entity* terrain;

function main()
{
...
ifdef client;
...
while(!terrain){wait(1);}
{
terrain.material=multitex;
endif;
...
}

action terrain_LOL
{
terrain=me;
...
}



hope this is helpfull
Posted By: Excessus

Re: shaders on LAN - 10/19/06 19:48

The action in zStreams code will only be executed on the server. Either the terrain must be created localy (ent_createlocal) on the client, or dplay_localfunction must be on.
Posted By: zSteam_

Re: shaders on LAN - 10/19/06 19:55

oh right (for the server (reason: pointer)) sry
Posted By: sheefo

Re: shaders on LAN - 10/19/06 20:18

ent_createlocal works but I don't know if it is the best way to create a terrain for a LAN RTS.
Posted By: zSteam_

Re: shaders on LAN - 10/19/06 20:29

u must use handles, but i dont know how to use it

sry for bad english ^^
Posted By: sheefo

Re: shaders on LAN - 10/19/06 21:15

I can "ent_create" it only on the server now but the shader doesn't want to work.

zSteam, handles sound like a good idea, but I too don't know how. These are material handles were talking about, right?

BTW, I tried "ent_sendnow(my)" but it doesn't work.
Posted By: William

Re: shaders on LAN - 10/21/06 00:33

Place "dplay_localfunction = on;" before your level load. This sets everything loaded in the level to local, then have your shaders applied through the level entities actions. If your loading an entity for only one computer use ent_createlocal. If it's for all computers, use ent_create and apply the material to each entity on each client thru use of proc_local, proc_client, and server side functions. However, all this has been covered many times before; i'd reccomend doing some searchs in the multiplayer forum, the majority(if not all) of your Q's would probably have already been answered.
© 2023 lite-C Forums