QIII Shader File Parser added to Twitch

So after yesterday's post, you *must* have been thinking: "where *are* all those textures"? No one has 30 missing textures in a map level. A few of them seem like something that might have been hard-coded, "noshader" "clip" and the like, but there's no way those "sky" textures were going to be hard-coded to content specific to the map level.

Luckily, I anticipated your keen interest and actually looked into the issue, finding out that there's a whole little customization language for Quake III maps (duh!). There's great documentation on how to write shaders in that language, but not much on how to actually re-implement it. Still, the first step is being able to parse it, so I popped out SimpleParse and spend a few minutes whipping up a grammar (9 lines in all) and a processor that will take the result of the parser and produce something I could imagine actually using to generate code to run in the rendering loop.

The grammar can parse my sample model's shader file, pulling out each production, suite and command/parameter, converting numbers to ints/floats, and basically making it just a problem of figuring out what each command is supposed to do and how to interpret the parameters to it.

I may wind up start out by using the "qer_editorimage" to provide basic support (i.e. look like an editor instead of a live engine), but that, or any more advanced use will have to happen some other day.

Comments

  1. Anonymous

    Anonymous on 12/23/2012 5:28 a.m. #

    I don't know about others, but I was thinking: "where *is* the source"?

  2. Mike C. Fletcher

    Mike C. Fletcher on 12/23/2012 5:26 p.m. #

    bzr branch lp:twitch

  3. Anonymous

    Anonymous on 12/25/2012 10:20 a.m. #

    Thanks.

Comments are closed.

Pingbacks

Pingbacks are closed.