you didn't need to make a new FVF!
all you needed to do was set some sexture stages,
in d3d_tcache_set
I set it to recersivly call itself to set the glow map to stage 1
this goes at the top
if(bitmap_id != GLOWMAP){
d3d_SetTexture(1, NULL);
d3d_SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
}
//turn off glowmapping right away, if it's needed turn it back on later
this is the bottom (modified from origonal)
// everything went ok
if(ret_val)
{
*u_scale = t->u_scale;
*v_scale = t->v_scale;
if(bitmap_id != GLOWMAP){
d3d_SetTexture(0, t->d3d8_thandle);
}else if(GLOWMAP > 0){
d3d_SetTexture(1, t->d3d8_thandle);
d3d_SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_ADD);
}
//glowmapping stuff-Bobboau
D3D_last_bitmap_id = t->bitmap_id;
D3D_last_bitmap_type = bitmap_type;
D3D_last_section_x = sx;
D3D_last_section_y = sy;
t->used_this_frame++;
}
// gah
else {
return 0;
}
//glowmapping stuff-Bobboau
if(GLOWMAP > 0){
d3d_tcache_set(GLOWMAP, bitmap_type, u_scale, v_scale, fail_on_full, sx, sy, force);
}
this function needs to be modifyed as showen
// This function calls these render state one when the device is initialised and when the device is lost.
void d3d_set_initial_render_state()
{
d3d_SetRenderState(D3DRS_DITHERENABLE, TRUE );
d3d_SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR );
d3d_SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR );
d3d_SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD );
d3d_SetRenderState(D3DRS_SPECULARENABLE, FALSE );
// Turn lighting off here, its on by default!
d3d_SetRenderState(D3DRS_LIGHTING , FALSE);
//new glowmapping code,yay!!!-Bobboau
d3d_SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_CURRENT);
d3d_SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_TEXTURE);
d3d_SetTexture(1, NULL);
d3d_SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
d3d_SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, 0);
}
other than that the code for loading the glow maps ect... has been done for ages