A new feature (w/patch): shader priority for brush content.


(SCDS_reyalP) #1

I followed up on the suggestion I made here http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=8210#77783 by coding it.

zip with modified q3map2.exe, source patch, examples and readme:
http://www.collectivecomputing.com/~reed/et/mapstuff/q3map-reyalp-2.zip
edit: the above is the most recent version, which contains a better example contentprio shader, as well as patchmeta control as described in this thread: http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=11949
The original version can be found at http://www.worldwidegaming.org/developer/reyalp/q3map-contentpriority.zip

Important stuff from the readme:
Problem:
Some shader keyword (such as nonsolid, *clip, liquid, and so on) affect the contents of a brush rather rather than just a given side. Since shaders are only specified on brush sides, this raises the question of which side specifies the brush contents. In past version of q3map (and q3map2) the ‘first’ side of the brush was used. Unfortunately, which side is ‘first’ is not under user control and tends to change every time the map is saved.

Solution:
This patch adds a new compiletime shader keyword

q3map_contentpriority <N>

where N is a signed integer, specifying the priority of sides using this shader. If not specified, the default priority is 0. q3map2 will use side whose shader has the highest priority side to set the contents (and other shader specified brush attributes) of the brush. If the highest priority exists on more than one side, the first one encountered will be used (mimicking the old behavior). If no side specifies a priority, then everything will work as it did in previous versions.

Examples:
Suppose you want to make a fence, where one face uses fence texture, and the remaining 5 sides are ‘clipped’ with missileclip. If you create a missileclip shader with
q3map_contentPriority 1
then you do not have to worry about the content parameters of the fence shader. This prevents your fence from randomly changing contents, and saves you making shaders for all your alpha textures with different clipping options. Instead, you only need one set of high priority clips.

Another common situation is to want to have some faces of a water brush non-drawing. If you create a nodraw shader with a content priority of -1, then you can safely use this on your water, without affecting its liquid state. (This example is somewhat contrived, since it wouldn’t be any more work to make nodrawwater, but it shows what you can do with a lower-than-default priority.)

Since it is a compiletime only option, you can safely modify your existing common shaders, although it might be a better idea to create a set that show the priority clearly in the name or editor image. Anyone compiling the map, will of course have to use a version of q3map2 that understands this option.

A couple of examples are included in prio.shader

You can use priority values other than +/-1, but in general, this isn’t likely to be useful.

Installation:
Use the included q3map2.exe in place of your previous version. If your q3map2 was old, you may need some .dlls, which can be found in the latest official q3map2 distribution, at http://www.shaderlab.com/q3map2/2.5/

If you are on a non-windows platform, you will have to patch and compile yourself.

The patch:
The patch was created using subversion, and should work with most patch utilities. You may have to convert line endings. You will also have to figure out how to build q3map2. Source for q3map2 is available from http://zerowing.idsoftware.com/ via subversion https://zerowing.idsoftware.com/svn/radiant

Big thanks to ydnar, id, and the gtkradiant team. :beer:

If you have comments, suggestions or bug reports, post them here. You can also email me (reyalp@gmail.com) or find me on #splashdamage (quakenet) or #wwgn (gamesurge)


(Twisted0n3) #2

http://www.collectivecomputing.com/~reed/et/mapstuff/q3map-reyalp-2.zip times out. Where else is this mirrored?


(SCDS_reyalP) #3

http://www.sonic.net/~rfm/et/q3map-reyalp-2.zip (includes patchmeta control too) or http://www.sonic.net/~rfm/et/q3map-contentpriority.zip for the old one


(Twisted0n3) #4

Thanks – the first link works (didn’t check the second one, as the first one’s the one I want).


(aaa3) #5

does the q3map2 which (2.5.17) is in the latest 1.5.0 gtkradiant (april26, 2007), have this option?


(SCDS_reyalP) #6

I don’t think so.


(C) #7

thanks SCDS_reyalP…
This is what i needed some month ago… i might need it again.

btw: :nag: = :tapir: is always true… so :beer: it is… :wink: