Subject452
07-21-2002, 09:58 AM
Im trying to make some shader animations for the main menu (animap).
So i made a shader file named myshader.shader and placed it in the shaders dir with the content:
shaders/myshader
{
{
animmap 0.5 textures/aap/screen02.tga textures/aap/screen01.tga
textures/aap/screen05.tga
textures/aap/screen03.tga
textures/aap/screen04.tga
textures/aap/screen06.tga
textures/aap/screen09.tga
textures/aap/screen10.tga
}
}
Then i tested it with q3ace and it works, then i made a new itemdef in main.menu under the menu1 entry for the main menu background like this:
// animap Test
itemDef
{
name animap_pic
group none
style WINDOW_STYLE_SHADER
rect 0 0 140 180
asset_shader "shaders/myshader"
forecolor 1 1 1 1
visible 1
decoration
}
offcourse i placed the screen01,02 etc in the directory specified in the shader file.
What it does now is draw a BLANK screen in the defined rectangle of 140 180 (the blank screen u get when it cant find the shader), so what i did i also placed the contents of myshader.shader at the bottom of ui.shader, but that got the same effect then i tried adjusting the asset_shader string to the following things:
"shaders/myshader.shader"
"myshader"
"myshader.shader"
but all gave the same effect, there are no other examples in the .menu files of calling a asset_shader only examples of calling asset_model. However the code for calling a shader through a menu file is defined in the uicode, this the code for it:
// asset_shader <string>
qboolean ItemParse_asset_shader( itemDef_t *item, int handle ) {
const char *temp;
if (!PC_String_Parse(handle, &temp)) {
return qfalse;
}
item->asset = DC->registerShaderNoMip(temp);
return qtrue;
}
and in the itemParseKeywords table:
{"asset_shader", ItemParse_asset_shader, NULL },
Offcourse i tested it all by making a good working pk3 file of it all.
Has anyone else tried this before????? what am i overseeing or doing wrong?
So i made a shader file named myshader.shader and placed it in the shaders dir with the content:
shaders/myshader
{
{
animmap 0.5 textures/aap/screen02.tga textures/aap/screen01.tga
textures/aap/screen05.tga
textures/aap/screen03.tga
textures/aap/screen04.tga
textures/aap/screen06.tga
textures/aap/screen09.tga
textures/aap/screen10.tga
}
}
Then i tested it with q3ace and it works, then i made a new itemdef in main.menu under the menu1 entry for the main menu background like this:
// animap Test
itemDef
{
name animap_pic
group none
style WINDOW_STYLE_SHADER
rect 0 0 140 180
asset_shader "shaders/myshader"
forecolor 1 1 1 1
visible 1
decoration
}
offcourse i placed the screen01,02 etc in the directory specified in the shader file.
What it does now is draw a BLANK screen in the defined rectangle of 140 180 (the blank screen u get when it cant find the shader), so what i did i also placed the contents of myshader.shader at the bottom of ui.shader, but that got the same effect then i tried adjusting the asset_shader string to the following things:
"shaders/myshader.shader"
"myshader"
"myshader.shader"
but all gave the same effect, there are no other examples in the .menu files of calling a asset_shader only examples of calling asset_model. However the code for calling a shader through a menu file is defined in the uicode, this the code for it:
// asset_shader <string>
qboolean ItemParse_asset_shader( itemDef_t *item, int handle ) {
const char *temp;
if (!PC_String_Parse(handle, &temp)) {
return qfalse;
}
item->asset = DC->registerShaderNoMip(temp);
return qtrue;
}
and in the itemParseKeywords table:
{"asset_shader", ItemParse_asset_shader, NULL },
Offcourse i tested it all by making a good working pk3 file of it all.
Has anyone else tried this before????? what am i overseeing or doing wrong?