Page 1 of 1

Changes to WRF/PIE relevant to artists

Posted: 01 Sep 2013, 00:44
by Per
First, in master / future 3.2 I have removed the need to add 'TEXPAGE' and 'TCMASK' directives to WRF files for any textures. When present, they are now ignored. Instead, textures are loaded in by the game as needed. Previously, this requirement was merely relaxed for some content (PIE files, mostly).

Second, I believe that adding support for materials was a mistake, and want to remove support for this again. As above, I intend to make the 'MATERIALS' directive in PIE files be ignored if present. This also includes removing materials from the shaders. Instead, I would like to add support for specular maps. This change of course applies also only to master / future 3.2.

Let me know if this negatively impacts anyone.

Re: Changes to WRF/PIE relevant to artists

Posted: 01 Sep 2013, 11:05
by NoQ
As for me, great news about WRF (no idea what we could have lost there) (and no clue about materials).

Re: Changes to WRF/PIE relevant to artists

Posted: 01 Sep 2013, 11:20
by Jorzi
Spec maps are great (no more abusing the alpha channel of normal maps :D)
One thing that could possibly be useful is an option to specify a custom shader for a .pie file, rather than materials options.

Re: Changes to WRF/PIE relevant to artists

Posted: 02 Sep 2013, 00:23
by Per
Ok. Materials removed, specular support added. The new SPECULARMAP directive can be added in the PIE file after a NORMALMAP directive. The specular map code is mostly untested, since I did not have the any proper specular maps to test it on.

I will have a look at custom shader support in PIE files.

Note that removing materials support breaks support for current ARmod, since its shader assumes it is set. For future-proofing, I'd recommend removing materials support from the shader - this should not have any negative consequences, I think.

Will calculating tangent and bitangents automatically during loading and sending them to the shader help? I know you want to import these, but I can add that as a stopgap solution until we get the infrastructure for this.

Re: Changes to WRF/PIE relevant to artists

Posted: 02 Sep 2013, 09:56
by Jorzi
Precalculating tangents & bitangents would probably work for me since blender also uses a fairly simple algorithm and doesn't allow tweaking them individually. I assume, of course, that we would be talking about interpolated vertex normals and not the current "flat" shading, since this is essential for proper use of tangent space normal mapping.

Re: Changes to WRF/PIE relevant to artists

Posted: 02 Sep 2013, 20:34
by Per
Added possibility of setting a shader for each model now, by adding a new PIE directive called SHADERS. It must go after the TEXTURE directive and after any of the optional NORMALMAP and SPECULARMAP directives, if they are present. It must contain a useless number (please use '2') just like the above directives, and then the path to the vertex shader and the fragment shader. Since this is intended as a special case and/or experiment at the moment, it does not cache / reuse the shaders, so each model gets its own shader program on the GPU if the same shader is referenced in multiple models. But I can fix this quickly once the need for it arises.

Re: Changes to WRF/PIE relevant to artists

Posted: 04 Sep 2013, 23:31
by MaNGusT
Since texture's dependencies in wrf files have been removed, would it be possible to add a "reload textures" console command? Just like the "vid_restart" command in Q3 that reloads the all graphics data(textures, configs) without restarting the game.

Re: Changes to WRF/PIE relevant to artists

Posted: 05 Sep 2013, 15:09
by Jorzi
Are there any good snapshot builds out there? I could try to whip up some examples of multiple shaders and maybe some other goodies.

Re: Changes to WRF/PIE relevant to artists

Posted: 05 Sep 2013, 23:18
by Per
Sorry, buildbot is still down.

Re: Changes to WRF/PIE relevant to artists

Posted: 07 Sep 2013, 16:33
by Per
For master / future 3.2, I have removed the need to add 'IMD' directives to WRF files to load models. When present, they are now ignored. Instead, models are loaded in by the game when they are referenced from other files.

The piestats.wrf file has been removed. This might impact mods if they reference it but do not include it.

Re: Changes to WRF/PIE relevant to artists

Posted: 07 Sep 2013, 22:22
by Goth Zagog-Thou
Nice, that should cut down memory and GPU usage considerably. Thanks Per. :)

Re: Changes to WRF/PIE relevant to artists

Posted: 07 Sep 2013, 22:35
by stiv
It would be nice if the PIE Format docs in the wiki were updated to match the new specs. Or at least a single post summarizing the changes.

Re: Changes to WRF/PIE relevant to artists

Posted: 07 Sep 2013, 23:17
by Per
stiv wrote:It would be nice if the PIE Format docs in the wiki were updated to match the new specs.
Done.

Re: Changes to WRF/PIE relevant to artists

Posted: 08 Sep 2013, 19:44
by stiv
Done.
Woo woo! And thanks.