I see!
For a bunch of materials I use the same file but with two techniques (camera + refraction/ special view), like this:

Click to reveal..
Code:
MATERIAL* mat_water_camera =
{
	technique = "camera";
	effect = "water_crcombo.fx";
	flags = AUTORELOAD;
}

MATERIAL* mat_water_refrac =
{
	technique = "refrac";
	effect = "water_crcombo.fx";
	flags = AUTORELOAD;
}

var mat_water_event()
{
	if(render_view == camera) mtl = mat_water_camera;
	else mtl = mat_water_refrac;
	return 0;	
}

MATERIAL* mat_water =
{
	event = mat_water_event;
	flags = AUTORELOAD | ENABLE_RENDER;
}


When I comment out all "technique =" lines in the material definitions there are no TFX memory leaks. Could this be an issue in the engine?
=> seems like it:

Click to reveal..
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

MATERIAL* my_technique_mat1 =
{
	technique = "first";
	effect = "technique.fx";
	flags = AUTORELOAD;
}

MATERIAL* my_technique_mat2 =
{
	technique = "second";
	effect = "technique.fx";
	flags = AUTORELOAD;
}

void main()
{
	fps_max = 60;
	level_load(NULL);
	you = ent_create(SPHERE_MDL,vector(128,0,32),NULL);
	your.material = my_technique_mat1;
	me = ent_create(CUBE_MDL,vector(128,0,-32),NULL);
	my.material = my_technique_mat2;
	while(1)
	{
		my.pan += 5*time_step;
		my.tilt += 5*time_step;
		wait(1);
	}
}

// technique.fx

const float4x4 matWorldViewProj;
const float4x4 matWorld;
const float fAmbient;
const float4 vecSunDir;

texture entSkin1;

sampler ColorMapSampler = sampler_state 
{ 
   Texture = <entSkin1>; 
   AddressU  = Clamp; 
   AddressV  = Clamp; 
}; 
    
void DiffuseVS( 
   in float4 InPos: POSITION, 
   in float3 InNormal: NORMAL, 
   in float2 InTex: TEXCOORD0, 
   out float4 OutPos: POSITION, 
   out float2 OutTex: TEXCOORD0, 
   out float3 OutNormal: TEXCOORD1) 
{ 
   OutPos = mul(InPos, matWorldViewProj); 
   OutNormal = normalize(mul(InNormal, matWorld));
   OutTex = InTex; 
} 
    
float4 DiffusePS( 
   in float2 InTex: TEXCOORD0, 
   in float3 InNormal: TEXCOORD1): COLOR 
{ 
	InNormal = normalize(InNormal);
   float4 Diffuse = saturate(dot(-vecSunDir, InNormal)*2); 
   float4 Color = tex2D(ColorMapSampler, InTex); 
   float4 final = Color*Diffuse;
  
   return (1+fAmbient) * final; 
} 

float4 SecondPS( 
   in float2 InTex: TEXCOORD0, 
   in float3 InNormal: TEXCOORD1): COLOR 
{ 
	InNormal = normalize(InNormal);
   float4 Diffuse = saturate(dot(-vecSunDir, InNormal)*2); 
   float4 Color = tex2D(ColorMapSampler, InTex); 
   float4 final = Color*Diffuse;
  
   return (1+fAmbient) * final*float4(1,0,0,1); 
} 
 

technique first 
{ 
   pass P0 
   { 
      VertexShader = compile vs_3_0 DiffuseVS(); 
      PixelShader  = compile ps_3_0 DiffusePS(); 
   } 
}

technique second 
{ 
   pass P0 
   { 
      VertexShader = compile vs_3_0 DiffuseVS(); 
      PixelShader  = compile ps_3_0 SecondPS(); 
   } 
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends