///////////////////////////////
#include <acknex.h>
#include <default.c>
#define PRAGMA_PATH "%EXE_DIR%\templates\images";
#define PRAGMA_PATH "%EXE_DIR%\samples";
//bumpmap for wave
BMAP* bump_map="rock.tga";
MATERIAL* test_mat =
{
skin1=bump_map;
effect="
texture TargetMap;
texture mtlSkin1;
sampler2D Map1 = sampler_state
{
Texture = <TargetMap>;
};
sampler2D BumpSampler = sampler_state
{
Texture = <mtlSkin1>;
};
float4 vecTime;
float4 PIXEL_S(float2 Tex:TEXCOORD0 ):COLOR
{
float2 BumpText = tex2D(BumpSampler, float2(Tex.x,Tex.y-0.1*0.1*vecTime.w)).rg*2-1;
Tex += BumpText*(0.01f);
float4 color = tex2D(Map1,Tex);
return color;
}
technique testtech
{
pass p1
{
PixelShader = compile ps_2_0 PIXEL_S();
}
}";
}
//sourcemap
BMAP* lite_c_logo="logo_800.jpg";
//panelmap (targetmap)
BMAP* panelmap="logo_800.jpg";
PANEL* testpan =
{
bmap=panelmap;
flags=SHOW;
}
function main()
{
fps_max=75;
video_mode=9;
video_screen=2;
video_set(800,600,32,2);
wait(3);
//Need this. Otherwise vecTime doesn't work.
level_load("");
//convert rock.tga to normalmap
bmap_to_normals(bump_map,10);
while(1)
{
//render lite-c logo on the panelmap with shader
bmap_process(testpan.bmap,lite_c_logo,test_mat);
//render panelmap on the panelmap? This will not work.
//bmap_process(testpan.bmap,testpan.bmap,test_mat);
//This will not work either.
//bmap_process(testpan.bmap,NULL,test_mat);
wait(1);
}
}