massive shader collection...

Posted By: Blink

massive shader collection... - 08/23/10 14:03

is anyone familiar with this collection? for the first time i tried to use some of the effects and i keep getting an error, and the effect wont load. i am trying to use the water refract code that adds the fake refraction that simulates underwater caustics and lights. does anyone know how to use it properly. the error is coming from the mtlFX.wdl. it says too many instructions for a slot or something. slot uses 128 but there are 134 instructions, whatever that means, lol.
Posted By: Blink

Re: massive shader collection... - 08/23/10 14:08

btw, here is the code if you arent sure what i mean.

Code:
////////////////////////////////////////////////////////////////////////
// A6 main wdl:
//		Created by WED.
////////////////////////////////////////////////////////////////////////


path "C:\\Program Files\\GStudio6\\template_6";
path "C:\\Program Files\\GStudio6\\template_6\\code";
path "C:\\Program Files\\GStudio6\\template_6\\images";
path "C:\\Program Files\\GStudio6\\template_6\\sounds";
path "C:\\Program Files\\GStudio6\\template_6\\models";

string level_str = <shaders.WMB>;


include <gid01.wdl>;
include <display00.wdl>;
include <default.fx>;
include <mtlFX.wdl>;



function main()
{
	freeze_mode = 1;
	gid01_level_state = gid01_level_not_loaded;


	mouse_mode = 0;

	wait(3);

	level_load(level_str);

	wait(2);
	gid01_level_state = gid01_level_loaded;


	freeze_mode = 0;

	wait(6); 
	
	camview1();
	
	while(1)
	{
		MOUSE_POS.X = POINTER.X;
		MOUSE_POS.Y = POINTER.Y;
		
		if(gid01_level_state != gid01_level_loaded)
		{
			freeze_mode = 1;
			while(gid01_level_state != gid01_level_loaded){
				wait(1);
			}
			freeze_mode = 0;
		}
		wait(1);
	}
}

bmap flat = <blanknormalmap.tga>;

bmap gray = <grey2.tga>;

bmap black = <black.bmp>;

bmap waterheight = <waterheight.tga>;

bmap waterlight = <water_light.tga>;

var water_level=1;


material fake_refract
{
	skin2=gray;
	
	skin3 = waterheight;
	skin4 = waterlight;
	
	effect = "fake_refract.fx";
}

action light1{
	my.invisible = on;
	my.passable = on;

	my.red=35;
	my.green=32;
	my.blue=28;
	my.lightrange=15000;

}

//action: fx_water_env
//title: Faked water refraction
//skill1: Tile_x 1.0
//skill2: Tile_y 1.0
//skill3: Refraction_strength 1.0
//skill4: Refraction_tiling 2.0
action refract{
	var tile_tex_x=1;
	var tile_tex_y=1;
	var strength=1;
	var refract_tile=2;
	
	if(my.skill1==0){
		my.skill1=tile_tex_x;
	}
	if(my.skill2==0){
		my.skill2=tile_tex_y;
	}
	if(my.skill3==0){
		my.skill3=strength;
	}
	if(my.skill4==0){
		my.skill4=refract_tile;
	}
	
	my.skill41=float(my.skill1);
	my.skill42=float(my.skill2);
	my.skill43=float(my.skill3);
	my.skill44=float(my.skill4);
	
	while(1){
		if(my.z<water_level+100){
			my.material=fake_refract;
		}
		else{
			my.material=null;
		}
		wait(1);
	}
}

function camview1{
	var move[3];
	
	player=ent_create("ball.mdl",vector(168,-184,68),null);
	player.passable=on;
	
	camera.pan=160;
	camera.tilt=-24;
	
	while(1){
		
		camera.pan -= 14 * mouse_force.x*time;
		camera.tilt = clamp(camera.tilt+8 * mouse_force.y*time,-90,90);
		
		vec_set(move,nullvector);
		
		if(key_w){
			move.x=15*time*(key_shift+1);
		}
		if(key_a){
			move.y=15*time*(key_shift+1);
		}
		if(key_s){
			move.x=-15*time*(key_shift+1);
		}
		if(key_d){
			move.y=-15*time*(key_shift+1);
		}
		
		player.pan=camera.pan;
		player.tilt=camera.tilt;
		player.roll=camera.roll;
		
		c_move(player,move,nullvector,glide+ignore_passable);
		vec_set(camera.pos,player.pos);
	 	wait(1);
	}
}

bmap bmp_envcube1=<envi_snow+6.tga>;
bmap rainbow=<waves2.tga>;

function mtl_env_init()
{
 	bmap_to_cubemap(mtl.skin1);

	while(1) {
		mat_set(mtl.matrix,matViewInv);
		mtl.matrix41 = 0;
		mtl.matrix42 = 0;
		mtl.matrix43 = 0;
		wait(1);
	}
}

material water{
	skin1=bmp_envcube1;
	skin2=rainbow;
	event = mtl_env_init;
	flags=tangent;
	effect="ocean.fx";
}

action lightray{
	my.passable=on;
	
	my.unlit=on;
	my.bright=on;
	my.transparent=on;
	my.scale_z=25;
	my.scale_y=random(2)+.5;
	
	my.skill1=random(360);
	my.skill2=random(4)+6;
	
	while(my.skill3==0){
		my.pan=camera.pan+180;
		my.tilt=0;
		my.roll=0;
		ang_add(my.pan,vector(0,35,0));
		
		my.skill1+=my.skill2*time;
		my.alpha=12*sin(my.skill1)+2;
		wait(1);
	}
}




material dof{
	effect = "blur.fx";
}

action d_o_f{
	my.transparent=on;
	my.material=dof;
}

sky outside{
	type=<sky_day2_small+6.tga>;
	layer=2;
	z=20;
	flags=cube,visible;
}

material mblur{
	effect = "motionblur.fx";
}

action motionblur{
	my.transparent=on;
	my.material=mblur;
	
	var cam_pos[3];
	var cam_x_change;
	var cam_y_change;
	var cam_pan_change;
	var cam_tilt_change;
	var cam_pan;
	var cam_tilt;
	while(1){
		my.skill41=float(-cam_pan_change*2+cam_y_change);
		my.skill42=float(-cam_tilt_change*2);
		my.skill43=float(cam_x_change);
		
		cam_pan_change=camera.pan-cam_pan;
		cam_tilt_change=camera.tilt-cam_tilt;
		vec_add(cam_pos,my.pos);
		
		vec_sub(cam_pos,camera.pos);
		
		vec_rotate(cam_pos,vector(-camera.pan,-camera.tilt,-camera.roll));
		cam_x_change=cam_pos.x/vec_dist(my.pos,camera.pos)*300;
		cam_y_change=cam_pos.y/vec_dist(my.pos,camera.pos)*300;
		
		cam_pan=camera.pan;
		cam_tilt=camera.tilt;
		vec_set(cam_pos,camera.pos);
		vec_sub(cam_pos,my.pos);
		wait(1);
	}
}


Posted By: Blink

Re: massive shader collection... - 08/24/10 21:40

you know...i can guess why people dont respond. i guess i am the only A6 user active here on a regular basis. i am here everyday. well, if someone can help, great, if not...i will figure something out,lol.
Posted By: painkiller

Re: massive shader collection... - 08/24/10 22:48

why don't you use the default water shader? it's very easy to adapt it to c-script
Posted By: painkiller

Re: massive shader collection... - 08/24/10 22:50

If you want tell me what of the default water shaders do you want to use and i'll try to adapt it to c-script wink
Posted By: Blink

Re: massive shader collection... - 08/25/10 01:58

i just ned the refract to work. when i dive into my pool, its clear, but i want the water to refract to simulate being underwater/caustics. can you advise me on how to use the script i posted? i keep getting an error and the effect wont load. I am using A6 pro btw.
Posted By: Nidhogg

Re: massive shader collection... - 08/25/10 03:50

Why don't you use mytic moods for A6 pro it has a very good water script that uses caustics as well as waves etc.
Posted By: Blink

Re: massive shader collection... - 08/25/10 03:55

well, this is a pool. i just wanted that "wavy" effect in the water like the example in the massive shader collection. have you seen that example? the one by moscogames.
Posted By: Nidhogg

Re: massive shader collection... - 08/25/10 11:33

You can do the same with mystymoods water shader, Just resize the mesh to whatever size you need.
Posted By: Blink

Re: massive shader collection... - 08/25/10 13:01

do you have that watershader code, and the mesh? i had it, but i mustve lost it when i crashed my drive.
Posted By: Nidhogg

Re: massive shader collection... - 08/25/10 14:17

Here is the link for mystymood mystymood A6

I use A8 pro so I don't have any A6 stuff anymore.
Posted By: Blink

Re: massive shader collection... - 08/25/10 20:12

thanks. i tried it, but its not what i was looking for. i just want to have that refracted wavy look like the moscogames shader. getting it to work is the problem. it runs fine in the example, but i dont know why its not working for me.
© 2024 lite-C Forums