cb007sax Posted February 2, 2003 Share Posted February 2, 2003 I am having trouble loading my own graphic as my hud graphic... First off, do you have to register your graphic, i saw this in a tutorial //-------------------------------------------------------------------- // In Game HUD Images //-------------------------------------------------------------------- yourimageShader { nopicmip { map gfx/2d/yourimage.tga blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA } } I see nowhere else in the j2k source do they do that, if i have to do that... where do i do it? Link to comment Share on other sites More sharing options...
Wudan Posted February 2, 2003 Share Posted February 2, 2003 That is a shader up there, that's not code. It sounds like you have to have a shader for your hud graphics, that doesn't sound surprising. Link to comment Share on other sites More sharing options...
cb007sax Posted February 2, 2003 Author Share Posted February 2, 2003 Well, i can't find any shader definitions anywhere for shader code, why wouldn't my graphics be loading? I have like a 195x128 picture i think is the size... For the 2 images i want i get a blank picture, but all other images i put in myself work fine. I can't figure this out. . . Does jk2 only accept certain images? Here's my code cgs.media.HUDCustom = trap_R_RegisterShaderNoMip( "gfx/hud/hudleft.tga" ); in cg_main.c and CG_DrawPic( x, y, 128, 128, cgs.media.HUDCustom ); in a draw function And yes, i've tried many different values for the width and height, including the actual width and height, 195x128, nothing works Link to comment Share on other sites More sharing options...
Wudan Posted February 2, 2003 Share Posted February 2, 2003 In order to "trap_R_RegisterShaderNoMip" you need to have a shader. A shader contains specific instructions for the game engine on what to tell your video card to do when handling this graphic. If you only have the graphic, you won't always get the result you were looking for. Link to comment Share on other sites More sharing options...
cb007sax Posted February 2, 2003 Author Share Posted February 2, 2003 Where do i put the shader definition then? Link to comment Share on other sites More sharing options...
Wudan Posted February 2, 2003 Share Posted February 2, 2003 You can use ShaderEd (included with one of the JK2 SDK releases) to make a .shader file. The .shader file goes in your PK3 in the shaders folder. Look under your base folder and look in the shaders folder there, find the shader for the HUD graphic you're trying to replace, or one that is kind of like the one you want, copy the shader into a new .shader file (via notepad, or some text editor), replace all instances of the old graphic with your new one (i'd have them use a different name and path, to avoid complications), put the graphic, and the shader all in the appropriate directories inside the pk3 and see if that does it. Link to comment Share on other sites More sharing options...
cb007sax Posted February 3, 2003 Author Share Posted February 3, 2003 Thanks for helping me with the shader definitions man, i appreciate it... For future reference, textures have to be a power of 2, with 16x16 being the smallest size, and they don't have to be square.... Just remember that Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.