Watermarking 101

Any questions regarding getting Jaymod running.
User avatar
Jaymod Developer
Posts: 985
Joined: Sun Apr 24, 2005 7:52 pm
Location: Above the 49th Parallel.

Watermarking 101

Post by Chester » Tue Aug 16, 2005 11:02 am

Ok...so you have a picture you would like to use as a watermark on your server.

Your image should be at a resolution of 72 pixels/inch, which can be seen in Image Size, Document Size in Photoshop.
Your image should also be in RGB at 8bits/channel which can be seein in Image, Mode, in Photoshop.

Step 1: Create folders
Create two folders
- "watermark"
- "scripts"


Step 2: Create Picture
Using Photoshop (or other picture editor that supports tga) make a 64x64 pixel, 128x128 Pixel or 256x256 Pixel Picture. (32x32, 512x512 are also supported but a little unrealistic. NEEDS to be a POWER of 2)
Do this by either changing the image size of the picture you would like to use or create it from scratch.

Step 3: Save Picture
Save your finished picture into your "watermark" folder as mywatermark.tga in the format:
TGA - 24 bits/pixel colour in RGB if not using an Alpha Channel
TGA - 32 bits/pixel colour in RGB if using an Alpha Channel

Step 4: Scripting
You need to create a shader file so that the game recognizes your picture.
Open up notepad and type the following:

Code: Select all

watermark/mywatermark //This is the name of your picture
		map watermark/mywatermark.tga //This is the actual file of your picture
		blendFunc blend
		rgbGen vertex
		alphaGen vertex
Step 5: Save shader file
Save this file as mywatermark.shader in your "scripts" folder

Check that the file does not have the extension mywatermark.shader.txt (is it showing as a default txt file).
Do this by right clicking on the file and look at the filename. It should say mywatermark.shader and just below that line have File Type: SHADER File.

Step 6: (IGNORE This step if it is not a txt file)
If it does not look like this, and says text document, do the following:
WinXP: Start Menu, My Computer, Tools, Folder Options, View. Uncheck the box beside "Hide extensions for known file types"
Win2000: Similar to that of XP.
Now you should be able to see the extra extension .txt. Rename the file and remove the .txt from the end.

Step 7: Put it together
So, now you have both of your files. A *.TGA in the "watermark" folder and a *.shader in the "scripts" folder.

Goto where you see both folders as in the red circled picture.
Select both folders and WINZIP (or other zip program) into a "mywatermark.pk3" file.
Put this file into your ETMAIN or JAYMOD directory.
Again, check to see if this is in the proper format by right clicking on the file and checking to make sure the file is mywatermark.pk3 with Type of File: PK3 File. If this file says *.zip at the end (or looks like a zip file) then you should go back to Step 6.

Step 8: Ready for the server
Change in your server.cfg file:

Code: Select all

set g_watermark "mywatermark"
Start your server...you should see your watermark.

If not, try doing a manual /rcon g_watermark "mywatermark" in console and wait until nextmap...or if your server is empty...!nextmap. Depending on your server, you most likely will have to reboot your server just like when you upload other pk3 files. If you are just cycling through watermarks (yes, some clans like to have more than 1 available), then you can just restart the map, load a new map, or do a !nextmap command after /rcon g_watermark "".

I will explain my folder layout in my particular example picture. You may be confused in seeing the "watermark/groundzero/GZEWater". I just have an extra directory in the "watermark" directory called "groundzero" and my "GZEWater.tga is saved in the "groundzero" directory.
If you have this extra directory in your "watermark" directory, you will have to enter that directory extension when you do your g_watermark...

Code: Select all

set g_watermark "groundzero/GZEWater"
Here is a sample file which shows BOTH examples: samplewatermark.pk3
One watermark is located inside just the watermark folder, where the other watermark is located in a sub directory inside the watermark folder.

Code: Select all

set g_watermark "samplewatermark"
set g_watermark "folder/samplewatermark2"
Last edited by Chester on Sun Dec 10, 2006 2:03 pm, edited 2 times in total.