Quote

//This will not work either.
//bmap_process(testpan.bmap,NULL,test_mat);


That sentence works. The only difference is that the TargetMap shader texture is empty. No more. You can paint bitmaps procedurally that way, or from other texture resources.

Alternatively, you can set a view with PROCESS_TARGET flag set instead of calling bmap_process inside a loop.

Code
///////////////////////////////
#include <acknex.h>
#include <default.c>
#define PRAGMA_PATH "%EXE_DIR%\templates\images";
#define PRAGMA_PATH "%EXE_DIR%\samples";

//sourcemap
BMAP* lite_c_logo="logo_800.jpg";

//bumpmap for wave
BMAP* bump_map="rock.tga";
MATERIAL* test_mat =
{
	skin1=bump_map;
	skin2=lite_c_logo;
	
	effect="
	float4 vecSkill1;
	
	texture mtlSkin1;
	sampler2D BumpSampler = sampler_state
	{
		Texture = <mtlSkin1>;
		AddressU = Wrap;
		AddressV = Wrap;
	};
	texture mtlSkin2;
	sampler2D SourceSampler = sampler_state
	{
		Texture = <mtlSkin2>;
		AddressU = Clamp;
		AddressV = Clamp;
	};
	float4 vecTime;
	float4 PIXEL_S(float2 pos:VPOS ):COLOR // VPOS gives the pixel coords instead of normalized ones
	{
		float2 Tex = (pos + 0.5f) / vecSkill1.xy;
		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(SourceSampler,Tex);
		return color;
	}
	technique testtech
	{
		pass p1
		{
			PixelShader = compile ps_3_0 PIXEL_S();
		}
	}
	";
}


//panelmap (targetmap)
BMAP* panelmap="#800x600x24";
PANEL* testpan =
{
	bmap=panelmap;
	flags=SHOW;
}

VIEW *viewtest = {
	bmap = panelmap;
	size_x = 800;
	size_y = 600;
	material = test_mat;
	flags = PROCESS_TARGET | 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);
	
	// Need this to get the real size of the bitmap
	bmap_lock(lite_c_logo, 0);
	bmap_unlock(lite_c_logo);
	test_mat->skill1 = floatv(lite_c_logo.finalwidth);
	test_mat->skill2 = floatv(lite_c_logo.finalheight);
}


Last edited by txesmi; 04/23/20 16:58.