Q uake3:Arena Shader Editor
 
 
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 (apprently 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
 
   
 
S  creenshots
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
01/02/2000
  • 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

  • Change 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 :)

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. Q3ASE.zip

Sites :

Email : rat@larian.com Please mention "Q3ASE" in the Subject.

 
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