Page 1 of 1

Debugging Shaders?

Posted: Sat Oct 10, 2009 12:51 pm
by AEon
I seem to have done something really bad because my 72KB shader for textures_ae no longer is properly loaded by GTKradiant 1.2.13.

What happened:
  • Kept copy/pasting shader versions, carefully I would have thought.
  • Suddenly the latest shader I had added does not show up in the textures window of the GTKradiant.
  • Further inspection shows that *none* of the shaders had been loaded, i.e. all the transparent textures no longer were transparent.
  • Double-checked shaderlist.txt, the proper entry for the shader is still there.
At first I thought that was a size issues, e.g. a .shader file larger than 64KB will not work. But is seems to be some error.

Alas via GTKradiant console (o-key), you don't get much info (the shader is called aegrid.shader):
  • Parsing shaderfile scripts/aegrid.shader
    Error parsing shader /
    Parsing shaderfile scripts/solarae.shade
And the old version of q3ase (v1.5.3) does not load the shader from my pk3 file at all. The tool does not seem to have a console to check what is causing the problem.

Any suggestions on how to find out what the problem is?

Thanks.

Update: In-game the shaders seems to work and Q3A does not warn about shader issues.

Re: Debugging Shaders?

Posted: Sat Oct 10, 2009 1:41 pm
by AEon
I must have changed the .shader's file format in some strange way (some weird Unicode or so), so that GTKradiant could no longer load the file, and would stop at the first character in the file, completely ignoring it.

Fix: I duplicated an original id shader, and copy/pasted the code of my shader into that file. Now things work.

*sigh*

Re: Debugging Shaders?

Posted: Sat Oct 10, 2009 2:57 pm
by obsidian
What program are you using to edit your shader files?

Re: Debugging Shaders?

Posted: Sat Oct 10, 2009 4:37 pm
by AEon
Forgot to mention this... it is UltraEdit v14.20...

After "fixing" the file, I noted the size went down from 72KB to about 24KB... so there definitely was some Unicode going on there. Probably hit the wrong shortcut accidentally converting the shader file into a non-ASCII format.