Jump to content

Home

Animation Shaders not working in the Main menu


Subject452

Recommended Posts

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?

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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 :

UI_DrawHandlePic

that should make it .

i used it to draw my rgb visualisation box in my mod but i think it could work for you.

Link to comment
Share on other sites

i think u mean Item def instead of menudef, so what i need todo is something like the following:

 

case UI_ANIMAP_TEST:

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

break;

 

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?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...