Changes to WRF/PIE relevant to artists

Improving the artwork in Warzone2100 - not for mod discussions
Post Reply
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Changes to WRF/PIE relevant to artists

Post 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.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Changes to WRF/PIE relevant to artists

Post by NoQ »

As for me, great news about WRF (no idea what we could have lost there) (and no clue about materials).
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Changes to WRF/PIE relevant to artists

Post 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.
ImageImage
-insert deep philosophical statement here-
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Changes to WRF/PIE relevant to artists

Post 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.
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Changes to WRF/PIE relevant to artists

Post 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.
ImageImage
-insert deep philosophical statement here-
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Changes to WRF/PIE relevant to artists

Post 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.
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Changes to WRF/PIE relevant to artists

Post 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.
Last edited by MaNGusT on 05 Sep 2013, 23:29, edited 1 time in total.
Image
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Changes to WRF/PIE relevant to artists

Post 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.
ImageImage
-insert deep philosophical statement here-
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Changes to WRF/PIE relevant to artists

Post by Per »

Sorry, buildbot is still down.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Changes to WRF/PIE relevant to artists

Post 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.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: Changes to WRF/PIE relevant to artists

Post by Goth Zagog-Thou »

Nice, that should cut down memory and GPU usage considerably. Thanks Per. :)
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Changes to WRF/PIE relevant to artists

Post 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.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Changes to WRF/PIE relevant to artists

Post by Per »

stiv wrote:It would be nice if the PIE Format docs in the wiki were updated to match the new specs.
Done.
stiv
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 876
Joined: 18 Jul 2008, 04:41
Location: 45N 86W

Re: Changes to WRF/PIE relevant to artists

Post by stiv »

Done.
Woo woo! And thanks.
Post Reply