View Full Version : Animation Shaders not working in the Main menu

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:

animmap 0.5 textures/aap/screen02.tga textures/aap/screen01.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
name animap_pic
group none
rect 0 0 140 180
asset_shader "shaders/myshader"
forecolor 1 1 1 1
visible 1

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:


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?

07-22-2002, 12:16 AM
This is a very wild stab in the dark, but are the tga files meant to cached?

Also (another stab in the dark) nstead of using shaders, you might want to use ROQ files (I think you add "cinematic xx.roq" where xx is the name of the ROQ file)...

Sorry if that didn't help, I am not good with coding but I'm trying to learn....

07-22-2002, 03:20 AM
Atleast a reply =), thanks, i'll give it a try ASAP

07-22-2002, 07:18 AM
you can also use ownerdraw and display the shader from within the ui code, check the ui_main.c for ownerdraw.
and then create a new menu def and in the big switch add your's and then draw it with :
that should make it .
i used it to draw my rgb visualisation box in my mod but i think it could work for you.

07-22-2002, 10:56 AM
i think u mean Item def instead of menudef, so what i need todo is something like the following:

UI_DrawAnimap(&rect, scale, color, textStyle, ui????, 1, 2, iMenuFont);

in the ownerdraw function, and then make a item def in main.menu and call it like this ownerdraw "ui_animap_test"

did i understood correct?