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 rgbgen, alphagen, ... 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 most of the other stuff like skies, fog, ...
  • Try to integrate this thing with Robert Duffy's Q3Radiant ?
 
   

 
S  creenshots
08/03/2000 (72Kb)
There may not be a new release for a while, so I figured I'd show a shot of the latest changes. The reason for the delay is my busy schedule, and the fact that Q3ASE is not really suited for heavy duty work with it's current interface. In the future, I'll probably focus more on the treeview and use parts of the current GUI as dialog boxes when you actually want to edit values in this tree (the Waveform edit/preview for instance probably still beats typing in a number in the treeview).

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 stretc h 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
10/04/2000 (Release 0.4)
  • Added sort and cull keywords (cull is currently ignored by the renderer)
  • Fixed a few memory leaks (but some remain)

9/04/2000

  • Bugfix : texture matrix stack sometimes was underrun

29/03/2000

  • Reduced render speed doesn't help much, GUI still misses events too much. Brought it back to 30 FPS and completely changed the way the renderer is threaded.

28/03/2000

  • Reduced render speed to 20 FPS to get as much time free for the GUI. GUI still sometimes misses mouseclicks though
  • Bugfix : 'cascade preview' + 'current layer only' mode would sometimes display polygons slightly offcenter

27/03/2000

  • Partially rewrote the preview renderer to use threading for it's timing. The jerkiness is largely gone now.

26/03/2000

  • .. and once more a tcMod rewrite. This time turb is just dead on right thanks to code generously revealed by John Carmack -- thanks !

25/03/2000

  • .. and yet another attempt at a more accurate tcMod imitation
  • Faster loading of JPGs, making browsing with Preview on much more comfortable

24/03/2000

  • Bugfix : clampmap got broken
  • Bugfix : tcmod turb printed in the treeview with a waveform, which is not the right syntax
  • Better handling of time should fix the slightly-too-slow animation of textures
  • Support for any number of tcMod transforms. Also works properly together with other tcMods now
  • Funky new bitmaps from Eutectic
  • Wrote an even stranger tcMod processing loop -- and the result seems more correct. The actual turbulence function is pretty far off though, will need a better guess
  • Bugfix : removing a shader stage which used the same texture as another stage, accidentally removed the texture from memory

22/03/2000

  • Bugfix : tcMod popup menu was unreliable at times
  • Bugfix : a positive tcMod rotate value should rotate clockwise, not counterclockwise
  • Changed the way tcMod is rendered, apparently I had a few things backwards, coordinate-transform wise.

21/03/2000

  • Bugfix : when saving certain shaders, the $lightmap would be missed and the Warning about a missing lightmap would pop up
  • Some reorganisation in the Stage and Shader specific popup menus
  • Removed the "Set trans ?" warning, because there's too many reasons why trans should or should not be set to verify
  • Main dialog can be minized now; waveform editor lists items in the same order as the script
  • Changed animfreq to mean "frames per second" instead of "animation repeats per second". This is an error in the shader manual (thanks Jason Wilkins)
  • Setting tcGen to vector brings out the vector-editing dialog

20/03/2000

  • Added a Cancel button to the dialogs for rgbGen, alphaGen, blendfunc. The Cancel button on the texture source dialog only restores the source (map/lightmap/whitemap), not the frame selection
  • "Remove" on an rgbGen identity now actually removes that keyword, although the stage behind the scenes still is set to rgbGen identity
  • Added menuitems for tcMod : Insert before/after, Move up/down, Remove, Edit, with matching item-specific dialog boxes for Edit. (Note : the transform box is a bit pro-forma : only the last in a series of transforms has an effect, plus it's not clear if the final two terms (m4 and m5) are supposed to be timescales, ie animated scrolling instead of just a transform) This pretty much wraps up the conversion from 0.3 to 0.4, so this is a release candidate.

16/03/2000

  • Bugfix : Autosize command popped the preview window back to position (0, 0)
  • Added a workaround for the strange restriction Win32 imposes on the Preview window's size. This window is now always at least 128 pixels wide, even for smaller textures.
  • Bugfix : the treeview was not always refreshed properly, eg when setting detail, shuffling layers, etc
  • Bugfix : rightclick would bring out the right popup menu, but affect the wrong stage of a shader sometimes
  • Changed alphaGen portal to print as an integer in the treeview, since this value is measured in world units
  • Re-added the printing of the default rgbGen identity to the treeview
  • Added checkmarks to the Options/Preview submenu to indicate the current modus
  • Changed the Texture Source dialog to have a separate map item; you no longer need to know that a map really is an animmap with only one frame. If you build an animmap and switch to a map, that map will automatically be the first frame of your animation. Furthermore, if you switch back to animmap, your animation is remembered.
  • Created a separate dialog box for the selection of just one single texture. This is the animation-building dialog, but with all the animation specific features deleted. It pops up for map, clampmap, qer_editorimage and q3map_lightimage
  • The Preview window now can be minimized, maximized, etc. It also shows up in the taskbar now
  • Rightclicking on an animmap subitem brings up the correct popup menu

15/03/2000

  • Moved the blendfunc in a popup menu; the custom blends are created in a dialog box
  • Deleted the Stage:Effects sheet. The Redraw and Autosize buttons are in the menu. Net result : only the Treeview remains as a GUI element. This means that right now tcMod cannot be used.

13/03/2000

  • Added proper context sensitive menus for every kind of item, although most of them are empty for now
  • Moved qer_editorimage and q3map_lightimage from the tabsheet into the popup menus
  • Moved the texture source controls into a separate dialog, accessable from a popup menu
  • Moved the shader name edit field into a separate dialog. The General Properties sheet thus no longer exists
  • Moved rgbGen and alphaGen into a dialog each, again with a popup menu entry. The Stage: Sources sheet disappears
  • Added alphaFunc to the popup menus; added Move Stage Up/Down
  • Moved detail, depthFunc and depthWrite into menus
  • Moved tcGen into a popup menu

09/03/2000

  • Some cosmetic changes to the TreeView (already)
  • Removed the entire set of Preview/Render/Geometry buttons and moved these into the menu. I'll add a Toolbar and give the Preview parameters a button there; Layer navigation disappear, although reshuffling and deleting/adding stays for now (the treeview is still passive)
  • Removed the surfaceparm tabsheet into a separate dialog box, which is accessable by rightclicking on (currently any, later 'Stage') items in the treeview and hitting 'Edit SurfaceParm'
  • Added bitmaps for easy differentiation between the various components

08/03/2000

  • Not much happening because of a lack of time, and because I've become convinced the current GUI is doomed. Expect a major overhaul :)
  • Changed the blending mode to accept any existing OpenGL blending mode for both source and dest.
  • Added a Treeview control at the far right; pressing "Redraw" will output the shader in this tree, giving a read-only preview of the shader syntax. This view is not interactive for now, but will probably replace the tabbed GUI over time (screenshot)
  • Fixed the renderer to accept any amount of tcMod keywords in any order. There's no new GUI to work with this new functionality yet, though.

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.4 Beta, 10/04/2000

Check out the list of changes for what's new.
    Highlights :
  • Totally redesigned GUI makes for a much more productive, streamlined environment : treeviews and context sensitive popup menus replace the flip a switch jungle
  • Practically pixel-perfect imitation of the in-game Q3A shader stages
  • A truckload of bugfixes and minor enhancements for more stability and better speed

Q3ASE.zip ??? bytes

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

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
  • Quality Assurance : Eutectic -- the person to thank for the streamlined GUI and accuracy of the renderer
  • Beta testing : my thanks to Paul Jaquays for some tips; Jason Wilkins for debunking the broken tcMod and a few other quirks; the Curry team for allowing me to l33ch their TreeView idea =)
  • Programming : Bert Peers
  • Special thanks to John Carmack for helping us reach the final word on how tcMod turb interacts with the other tcMod code
  • This program uses the Independent JPEG group's library
 
 
Back to my homepage