Page 1 of 1

Help with shaders

Posted: Sun Jun 14, 2015 7:23 pm UTC
by Scampi
I require a bit of help with shaders. Not with syntax or the actual shader content, there are plenty of guides for that. I need help with where to put them file-wise so that Netradiant can access them properly.

Here's what I think I know about shaders: The shaders for a map are located in the shader file in the scripts folder for the pk3s of Tremulous maps. Netradiant accesses these to use in the map you're making. But how does a mapper get Netradiant to use shaders they've made themselves? My map is still very early in development, so I haven't made a pk3 for it yet. So if I can't store my shader in my maps pk3, where could I put it so Netradiant can use it?

I have tried making a pk3 containing only the shader file and the required textures, all folders and whatnot within it titled and organised properly. But Netradiant won't accept it. It does not show up in the menu at all. Using the surface inspector, I applied the name of my shader to the brush anyway, but it does not show up when I test my map.

Other info: I can use shaders perfectly fine, as long at it's used in another map. As well, certain maps and pk3s will not load at all, in Netradiant or Trem. If I download a map for Trem, sometime it works and sometimes it doesn't. Maps like Pulse, Procyon, Flap and UTCS work but Citadel, Spacetraks, and Antares won't. Why this happens is unknown. Perhaps this could relate to why my pk3 didn't show up?

I haven't come across any others encountering this problem, so either the solution is so obvious I'm a fool for not getting it solved by now or it is yet another anomalous unsolvable error. Anyway, I would have posted this to the Trem forums, but this place is more active and you fellas have helped me before. Thanks for your time.

Re: Help with shaders

Posted: Sun Jun 14, 2015 11:09 pm UTC
by Viech
Short answer since I don't have a lot of time right now: NetRadiant as well as Unvanquished treat directories ending in .pk3dir as if they were pk3s, so you can put all your files inside such a pk3dir and zip its contents (not the folder itself) once you want to make a proper pk3. Note that pk3(dir)s need a proper name format (see versioning guideline) to function.

Re: Help with shaders

Posted: Mon Jun 15, 2015 1:37 am UTC
by Scampi
Thanks for the reply. Unfortunately, I appear to need special permissions to read the link you sent me (so I've been unable to use the pk3dir idea yet). Since then, I have made a whole number of different pk3s, all named different random titles, to trick netradiant into thinking they are maps. They all contain the right file structure, and many of them contain other textures & sounds to be as convincing as possible. However... none of them succeeded. And then things took a turn for the worse. Not only will any newly installed Trem maps not show up in game or in Netradiant, but I cannot add any more existing shaders to my map. Well, I can add them, but they either behave like a flat texture or do not show up at all. I feel I may have accidentally dug myself into a deeper hole.

There is also another much older problem problem: Tremulous and Unvanquished appear to have installed themselves on my computer in a ... strange manner. There are two locations (possibly more) for each one. For Tremulous: The visible one in program files x86, contains the .exe, the uninstaller, a promotional video, a folder called gpp, a few other things and the base folder for maps. The second, invisible, one can only be located by a drive search and contains individual folders for Trem mods, a few other things as well as another base folder for maps. This time, the base folder has a section for screenshots and for non-pk3 maps that get edited by Netradiant. When I downloaded any Trem maps, I put the pk3 in the base folders in both the visible and invisible Tremulous folders. I've also done this for all of my tricksy pk3s. My question for this is: It this situation normal? If not... could it be the source of all these problems? Sorry for burdening you will all these issues!

Re: Help with shaders

Posted: Tue Jun 16, 2015 7:50 am UTC
by bsp1t
Basic netradiant -

Make your shader in /scripts/ directory of your map's pk3dir. Make sure it is named yourmap.shader. Open shaderlist.txt, make an entry
'yourmapname' (one shader per line). Reload radiant and you should see it in your texture list. Also be sure that under your preferences that the paths section is correct, just to be sure.

If you see placecards in your texture window, it means either the texture path ( textures/floors/floor1.tga ) in the shader is wrong, or its in a format netradiant cant load. I believe it only supports jpg/tga/png (they work for me) dds/crn etc wont show up. Make sure to hit 'c' for your console and it will usually tell you where its choking on texture/assests loading. There is a converter on the forums here made for converting textures to optimal format for the engine. You end up with your work directory having jpg/crn duplicates etc when you do the run with the texture tool. Just copy/paste the main pk3dir and rm -rf *.tga etc, from the test one, to remove the unused files from the final production pak. Make sure to keep a backup before you run any of those tools - just in case.

Also make sure you have fs_game set to unvanquished (game files for radiant for unv are on the forums - you need these), and leave fs_mod
blank. Seems to work for me...

The link to the wiki/tools is right here :

Re: Help with shaders

Posted: Tue Jun 16, 2015 4:32 pm UTC
by Viech
Scampi wrote:I appear to need special permissions to read the link you sent me

The only technical limitation is that the file (folder) name is map-name_version.pk3(dir). The post just constitutes a standard for the version bit:

Viech wrote:Sharing temporary pk3 files

When sharing pk3 files that are not supposed to be standalone files of the game installation, please use one of the following two formats, so that it will be easier for others to find out the latest version:

  • name_year-month-day-time.pk3
  • name_year-month-day-time-author.pk3

The date and time is the time when you package the pk3 and uses the following format:

  • year: <2000-2100>
  • month: <01-12>
  • day: <01-31>
  • time: <00-24><00-59> (hour and minute, in GMT/UTC)
  • author: Nickname as lowercase alphanumeric

For example:

  • drill_2014-05-29-1527.pk3
  • drill_2014-05-29-1527-viech.pk3

In case you're having issues with UTC: If your time zone's offset is positive, substract it, otherwise add it (e.g. 20:00 UTC+2 = 18:00 UTC; 20:00 UTC-6 = 02:00 UTC of the next day). Keep local daylight saving in mind. If you're using the 12 hour time format read here.

The reason for using this time format is that it can be sorted by using lexicographical order and is still human readable (as opposed to the unix timestamp, which also isn't easily available for windows users).

Sharing preview versions of standalone pk3 files

For pk3 files that are to be included with the release, for example maps and texture packages, there are two scenarios. If you are the main author of the package in question and it is unlikely that others will want to release a version of their own, you can use the following format:

  • name_targetversion~counter.pk3

For example:

  • map-spacetracks_1.0~1.pk3

The "~" tells the engine that the pk3 is to be ordered before the specified target version. For example, "tex-common_1.0~1.pk3" will be considered older than "tex-common_1.0~2.pk3" which in turn will be considered older than "tex-common_1.0.pk3", so the target release will always overwrite any preview version.

If you are not the only regular author of the pk3 in question, please use the date & time format above instead of the counter:

  • name_targetversion~year-month-day-time.pk3
  • name_targetversion~year-month-day-time-author.pk3

For example:

  • unvanqushed_0.28.0~2014-05-29-1637.pk3
  • unvanqushed_0.28.0~2014-05-29-1637-viech.pk3

Releasing fixes to standalone pk3 files

If you are not the main author of a pk3 but want to release a version with additions or bugfixes, use "+" instead of "~" to order your version after the regular release:

  • name_currentversion+counter.pk3

For example:

  • map-spacetracks_1.0+1.pk3

Here "1.0" was the author's original release and "+1" was added to mark an update without interfering with the author's versioning scheme.

Re: Help with shaders

Posted: Fri Jun 19, 2015 12:58 am UTC
by Scampi
Thank you for your assistance, everyone! There seems to be two final problems (for now), however. Netradiant seems unable to access my C:\Program Files (x86)\Tremulous\base location. I have the path set perfectly in the paths section for preferences, but Netradiant always ends up in an obscure location instead, C:\Users\myusername\AppData\Local\VirtualStore\Program Files (x86)\Tremulous\base. I was wondering why this is happening and how to get Netradiant stop doing this. If that is impossible, that is workable because I circumvented this problem by making a new folder on my desktop containing the base folder. In this base folder, I've placed all the pk3s of maps I'm using textures and shaders from, the Netradiant and tremulous packages as well as a maps folder for all of my .map files and their other bits. This new folder copies the base folder in C:\Program Files (x86)\Tremulous\base, the place Netradiant can't find anymore. This new folder works, Netradiant is able to path to this folder no problem, and will happily open up the maps there. The problem with this system however, is that Netradiant can't pull up the textures and shaders anymore. My maps pk3 and soon-to-be pk3dir will also probably not show up in Netradiant if all these maps won't as well. My questions are:

1 Why does Netradiant path to C:\Users\myusername\AppData\Local\VirtualStore\Program Files (x86)\Tremulous\base when directed to path to C:\Program Files (x86)\Tremulous\base, and how can I fix this?

2 Why is Netradiant unable access the shaders and textures of existing maps when I change its path, even if I move the pk3s it used to its new location; and how can I fix this?

Sorry I took this thread away from shaders, but I must resolve these in order to proceed with those. Anyway, thanks for reading.

Re: Help with shaders

Posted: Fri Jun 19, 2015 1:42 am UTC
by illwieckz
1 Why does Netradiant path to C:\Users\myusername\AppData\Local\VirtualStore\Program Files (x86)\Tremulous\base when directed to path to C:\Program Files (x86)\Tremulous\base, and how can I fix this?

Hi, I’have not used Windows on my Personnal computer since more than 10 years, but I know that modern Windows does not expect users to write on C:\Program Files because Windows does not expect anymore that normal users have administrative rights (which is a good thing). I’ve heard that many legacy programs were broken when installed on Vista/7 because they expect to be able to write in places like that (which is not a good thing) and perhaps netRadiant (wich is an old tool) try to open this directory with write permission and is triggering an obscure workaround.

I’ve never heard something before about a built-in workaround, but the C:\Users\myusername\AppData\Local\VirtualStore\Program Files (x86) sounds like a workaround, and this workaround is perhaps on Windows side (not netRadiant side). Since I’ve not heard something about such a workaround like that in Windows 7, are you using Windows 8 ?

If you are the only user of your computer (and only if), you can try to change permissions to C:\Program Files (x86)\Tremulous\base to be able to modify it as user (doing something like that), so it will allow netRadiant (launched by you) to modify (or just open with write permission) this directory like you.

Re: Help with shaders

Posted: Fri Jun 19, 2015 6:04 am UTC
by killing time
The easy way to allow a program to write files in whatever necessary locations is to choose "Run as administrator" when launching it.