Q uake3:Arena Shader Editor

 
 
C  ontents
 
   
 
B  ackground
Textures in Quake3:Arena are no longer a simple texture combined with a lightmap, but are fully scripted entities which can be used to control practically every option OpenGL exposes when it comes to texture positioning, transformation, blending and whatnot. To facilitate the creation and editing of such scripts, this tool will parse a script and present it as a Windows GUI which is easier to understand and navigate than the bare C-like text files.

The current version supports :

  • Opening and browsing through the PAK files; reading of Targa and JPEG images directly from the PAK without extraction of temporary files
  • Realtime preview of the shader in an OpenGL, hardware accelerated subwindow
  • Easy editing of the frames in an animation
  • Support for the RGB GEN keywords, including a dialog box for easy specification of the waveform to be used, with realtime preview of the resulting grey values
  • Support for the blending functions
  • Support for the TCMOD commands, including scrolling, rotation, turbulence, stretching
  • Support for the TCGEN commands, including environment mapping and projected textures
  • Support for unlimited layers per shader (although Q3A may have a limit) with option to preview the entire shader, the shader up to the current layer, or the current layer only
The most important TO DOs are :
  • Saving the settings to a file for further handtuning by the level builder (ie add non-OpenGL commands like noclip etc) (started)
  • Deform and Normal manipulation keywords
  • Parsing of existing shaders
  • Support for (aparently experimental) detail textures maybe ?
  • Support for most of the other subtle stuff like skies, alphagen, ...
  • Check my code with the engine. TCMod is pretty subtle stuff, I can only guess what order the operands are applied in. Combining scrolling and rotation doesn't make much sense in the tool, I'm not sure if it should
  • Try to integrate this thing with Robert Duffy's Q3Radiant ?
  • Add an expert mode which switches the GUI to use the doc's keywords instead of the 'friendly' variants
 
   

 
S  creenshots
04/02/2000 (43Kb)
Small shot showing the cascade preview option : this clearly shows the 3 layers a bouncepad is made off. At the right are the navigation buttons, and the |<| and |>| buttons to move the current layer around (closer/deeper).

03/02/2000 (165Kb)
Just another snapshot of what it currently looks like. I'm really running out of screenestate by now. The alphagen function doesn't have all the options an rgbGen has, and I'm not sure if it should, the docs are kindof brief on this. Also missing is support for detail textures. Other than that, I think this version pretty much sums up everything there is to a single layer. Time to move on to the global keywords :)

28/01/2000 (190Kb)
This shot shows most options have been implemented. I still have quite a few to go and I'm not sure where I'll put them :) Probably I'll have to use a tabsheet. The shot shows a texture built with the tool that should look familiar. The base layer is a normal texture. The second layer is a texture shown additively, but with an RGBGen which makes it pulsate in a sine wave. The third layer is a texture shown with additive blitting and a stretch to make it pulse in size; to hide the phase of the stretch which makes the ring "grow" again, an RGBGen is added with a square wave to hide the texture (by making it black) during this time.
This is the example from the shader manual, and it was built entirely in this tool. A save gives :

	{
	 map TEXTURES/SFX/METALBRIDGE06_BOUNCE.JPG
	 rgbGen identity 
	 tcGen base 
	}
	{
	 map TEXTURES/SFX/BOUNCEPAD01B_LAYER1.JPG
	 blendfunc add
	 rgbGen wave sin 0.5 0.5 0 1.5 
	 tcGen base 
	}
	{
	 clampmap TEXTURES/SFX/JUMPPADSMALL.JPG
	 blendfunc add
	 rgbGen wave square 0.5 0.5 0.25 1.5 
	 tcMod stretch sin 1.2 0.8 0 1.5 
	 tcGen base 
	}
which is pretty close to the document version, except for the missing lightmap (wasn't added) and the redundant tcGen's. With a little touch up (such as adding a shader name etc) this could go into the level editor.
 
   

 
C  hanges
16/02/2000 (Release 0.3)
  • Tried adding a workaround for the Win95 bug which saves files as .sha
  • Depthfunc is no longer ignored in the preview window, so images layered on top of grates with depthtest Equal now render correct. This is automatically disabled in cascade preview mode.

10/02/2000

  • Changed preview window again so it stretches textures in 2D mode. Should help visualize how textures will look on non-square brushes
  • Added "Autosize" button which will make the preview window the same size as the first texture of the first (deepest) shaderstage

09/02/2000

  • Fixed up the Win32/MFC/OpenGL interaction; the tabsheets are here to stay.
  • Tucked a GUI on all the surfaceparm attributes. No in-tool visual effects, just saves typing
  • Added editing box for a shadername; adopted texture list browser for selecting a qer_editorimage; same thing for q3map_lightimage

08/02/2000

  • Bugfix : Texture browser preview stopped working on textures that were previously assigned to a stage frame.
  • Started splitting the controls into a "Stage: Sources" sheet and "Stage: Effects" sheet. Kindof buggy to get OpenGL + sheets to work together though

07/02/2000

  • Bugfix : when switching from Debug to Release code, I lost a #define and files are saved as .jpg again instead of .tga. #@$!& :(

06/02/2000 (Release 0.2)

  • Bugfix : printed rgbGen on same line as animmap; also changed printing to be more standard (use tabs)
  • Turns out all Q3A files are called '.tga' even if they are '.jpg's. Ugh; hacked Q3ASE to try finding file.jpg if file.tga doesn't exist, and save filenames always with .tga extension in the .shader...
  • If an error is found during config loading, reset to a decent state
  • Preserve original case of filenames; should make the generated .shaders work on Unix
  • Added Entity, One minus entity, vertex, one minus vertex and specular to the list of alpha gen sources.
  • Packed the GUI a bit to accomodate all the new controls. Everything fits but it starts to look like a Boeing cockpit.

05/02/2000

  • Bugfix : loading evil textures like xiandm9doorc.jpg crashed the app
  • Bugfix : certain custom blends would print without a space between the keywords
  • Bugfix : used to print the frames of an animmap on separate lines for readability. Apparently, that's illegal shader syntax.
  • Made the "Preview" check box in the texture browser persistent
  • Query hardware for actual maximum texture size and clip loaded files accordingly
  • Added an edit control for alphagen portal fade out distance
  • Ask the user to try 32bit bitdepth; if you answer Yes and it doesn't work, delete q3ase.cfg and when it asks again, say No ;)

04/02/2000

  • Added customisable background color option
  • Replaced alphaGen portal checkbox with more general "Identity, Waveform, Portal" radio list including editor for waveform case
  • Added a diagnostic mode in which all calls to OpenGL are logged; if the app crashes this should help find out if it was inside Q3ASE or inside the driver (currently logging : texture management). Enable by setting the last "0" in q3ase.cfg to "1"
  • Added a cascade-mode preview; this shows all layers in 3D stacked after eachother; gives better insight in how things relate (screenshot)
  • Added menu options and buttons for moving the currently selected layer back, or closer. Works particularly well together with the cascade preview
  • Added an "Is Detail Texture" toggle. When trying to set it, the tool checks if (a) the current layer is layer #2 in the stack, (b) if the layer below it is a lightmap, (c) if the correct blendfunc is used. I think I now have every stage-specific option there is.

03/02/2000

  • Changed save code to append to an already existing .shader file instead of replacing it
  • Bugfix : browsing layers reset the preview radio buttons
  • Bugfix : resizing window to >1 :1 aspect clipped the image in 2D view
  • Added support for $lightmap and $whiteimage texture sources
  • Added a check to detect a missing lightmap layer and ask to auto-add one at save time. (This check will be disabled if nolightmap is set, once added) Note this adds just a filter'ed $lightmap at the end, might look wrong in nontrivial cases.
  • Removed Identity as a waveform and added it as an RGBSource, together with identityLighting (as "Overbright" radio option)
  • Added support for depthFunc and depthWrite. These options are ignored in the preview window.
  • Added alphaFunc and alphagen portal. Not sure if alphagen is supposed to have all the RGB options ? (waveform etc)
  • Removed printing of default "tcgen base".
  • Bugfix : spinning cube in nonsolid mode (such as Additive) would sometimes cull backfacing planes - update : removed this feature again; 99% of the cases there's a solid layer below an additive one, and making the entire cube non-culled just doesn't look right in the additive layer.
  • Bugfix : after debugging why alpha looks funny, turns out I uploaded textures with RGB5_A1. DOW !
  • Upped the preview bitdepth to 32bit
  • Bugfix : Targa's had their alpha channel inverted. DOW again !
  • Added the possibility to preview the currently selected texture in the main preview window.

02/02/2000

  • Added possibility to add a directory to the list of texture sources (eg "c:/quake3/baseq3")
  • Upped the max texture size to 512x512. Thus textures above 256x256 are no longer clipped, but 3dFX hardware might freak out.

01/02/2000 (Release 0.1)

  • Added dialog to edit the list of .pk3 (and .zip) files to import textures from.
  • Saving the list of .pk3's used to a config file
  • Added a pretty ugly logo as the default texture
  • Saving & loading of the texturefilter in the config
  • Correct updating of the dialog visuals as you browse the layers

29/01/2000

  • Changed the "textures/" prefix toggle into a more general editable prefix to filter on
  • Added an About box with basic info. It credits Larian Studios as my sponsor, since they agreed to pay me to build this tool (it's useful to them) and still allow me to release it on the net. I think this is mighty cool of them :) If you agree, be sure to pay their site a visit sometime !

28/01/2000

  • Added support for clampmap
  • Added Clear All button to framelist editor
  • Changed preview window to clear background (helps in Additive mode ;)
  • Controls for Animation Frequency, lightingDiffuse
  • Saving of individual stages to .shader files
  • Added option to draw texture on spinning cube for easy TCGen preview
  • Improved preview window, opens and closes automatically and goes inactive when in an editing subdialog
  • Added TCGen support including environment mapping and projected textures. Tool probably won't be much help in positioning the projection vectors though.
  • Added support for layers : navigating, selected displaying
  • Added option to filter out filenames not starting with "textures/" in frame editor
 

 
R  eleases
Since this program, and the tech behind it, is of use to the company I work for, Larian Studios, they agreed to pay me to work on this, while at the same time allowing me to release this tool for free on the net. If you agree that this is pretty damn cool, be sure to visit the site :)

This program is freeware : you can distribute and copy it at will as long as you do so at no charge, except for charges to cover the carrying media. The software may be repacked as part of a package as long as the original ZIP file is included unmodified.

If you happen to use this tool for production work, credit would be cool ;)

Version 0.3 Beta, 16/02/2000

Check out the list of changes for what's new.
    Highlights :
  • You can type a shader name, and pick a qer_editor image and lightimage; this means this release is the first to output complete, valid shaders which can go into the game unmodified
  • Added support for all the surfaceparm keywords
  • Use of tabsheets for less cluttered and easier to navigate controls
  • Better preview window stretches textures for more in-game like appearance
  • A few bugfixes, notably a more reliable preview in the texture browser

Q3ASE.zip ??? bytes

Version 0.2 Beta, 06/02/2000
Check out the list of changes for what's new.

    Highlights :
  • Much improved file loading : correct handling of alpha channel; stable loading of large JPEGs; workaround for the Q3A jpg/tga extension bug; realtime preview in the texture browser; option to add pakfiles as well as directories
  • Full support for alphaGen, $lightmap, $whiteimage, alphaFunc
  • Tool assists in checking shader validity : missing lightmaps, correct detail textures
  • Easy shuffling around of layers
  • Preview window supports 32bit bitdepths
  • A few bugfixes


Version 0.1 Beta, 01/02/2000
Enough functionality is here to use this tool as a shader designer. It's not strong enough yet to load and edit existing shaders, or to produce complete shaders in itself. It is very handy though for visually combining the layers (the actual creative part of shader design) and toying around with the FX. The Save button dumps the layers in text format, so wrapping it up with the usual shader stuff should allow you to use the shaders in new maps.
Alot is still missing, and not much testing was done :) Released strictly under the "release early, release often" motto.

If it complains about "msvcp60.dll not found", put this file (115795 bytes) in your c:\windows\system.

Sites :

Email : rat@planetquake.com Using this email alias instead of rat@larian.com should provide faster response.
 

 
C  redits
  • Logo : David 'dines' Durrenberger from the third dimension
  • Beta testing : special thanks to EutecTic who speeded development by about 500% :) Also my thanks to Paul Jaquays.
  • Programming : Bert Peers

 
H  owTo
This is not the page for documentation, I actually even don't intend to write any ;) But here's a quickstart :
  • During the first run, browse to the Q3/baseq3 directory and add pak0.pk3
  • If you see the logo, you need to assign a texture. Click "Edit Frames".
  • Type "textures/" in the Filter box, click "Filter"; makes the list easier to manage
  • Select a texture, click one of the arrows "->"
  • Close up, toy around with the options : try some rotation, scaling, etc.
  • Click "WaveForm : Edit" under RGBSource. Select a wave, click Preview and mess with the params until you see a cool white/grey/black fade. Closing should make the texture pulse in the same way now. If you delete a number the preview complains and stops, click "Preview" again to get it going again after you filled in a valid number. Turbulence and Stretch work the same way; in turbulence the wave and base values are ignored; in stretch the value from the waveform controls the amount of stretching.
  • Select File, Save to dump the layer to a .shader file
Some more tips :
  • Clicking "New" under Layer is equivalent to "Layer, Insert After" in the menu : it adds a new layer behind the current one
  • To focus on the layer you're editing without deleting all the layers below it, check "Current Layer only" under "Preview", "Render"
  • If you pick "Reflective" for "Texture Coordinate Generation", you effectively switch to Environment Mapping. To see the in-game effect, select "Spinning Cube" under Preview, Geometry
 
 
Back to my homepage