Models by MaNGusT (AR)

Improving the artwork in Warzone2100 - not for mod discussions
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

Well, I could until my English level allows. Just materials is no longer working and missing some info about pie flags for gfx effect that Cyp did for me

Code: Select all

Change new PIE modes to use flags:
-Premultiplied uses TYPE xx4 
-Additive uses TYPE xx1/xx2 to dis/enable

-TYPE x0x (to not face the camera)
-Roll to camera uses TYPE x1x (to rotate to the camera like a cylinder)
-Pitch to camera uses TYPE x2x (to rotate like a sphere)
You can see use of it with ARmod when buildings destroyed and when minipod fires.
EDIT: What would be the best way to re-implement support for shininess in the pie files for your purposes?
As far as I understand after reading of comments in commit, the only way to re-implement it is to put it into special grayscale texture or unused alpha channel and use via shader. :hmm:
Image
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

well, I still can control shininess as global parameter via shader. It's enough for current use.
Image
Forgon
Code contributor
Code contributor
Posts: 298
Joined: 07 Dec 2016, 22:23

Re: Models by MaNGusT (AR)

Post by Forgon »

MaNGusT wrote: 31 Mar 2019, 21:11 Well, I could until my English level allows. Just materials is no longer working and missing some info about pie flags for gfx effect that Cyp did for me

Code: Select all

Change new PIE modes to use flags:
-Premultiplied uses TYPE xx4 
-Additive uses TYPE xx1/xx2 to dis/enable

-TYPE x0x (to not face the camera)
-Roll to camera uses TYPE x1x (to rotate to the camera like a cylinder)
-Pitch to camera uses TYPE x2x (to rotate like a sphere)
You can see use of it with ARmod when buildings destroyed and when minipod fires.
[...]
Thank you. Could you check the pull request I created based on your comment,
PR 295?
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

Forgon wrote: 03 Apr 2019, 22:10Thank you. Could you check the pull request I created based on your comment PR 295?
Seems that now everything is right. Note, to use premultiplied mode when making explosions an artist should place fire effect to rgb channels and smoke to alpha channel. Cyp had created an easy commandline tool for this called premult, but it also can be done by gimp. We use the same technique with normal maps and specular maps. :)
Image
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Models by MaNGusT (AR)

Post by Jorzi »

I think having global shininess etc parameters are perfectly fine. If we need support for a model with exceptional parameters beyond what the textures can a chieve, we can simply define a new custom shader.
ImageImage
-insert deep philosophical statement here-
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

Jorzi wrote: 04 Apr 2019, 22:07 I think having global shininess etc parameters are perfectly fine. If we need support for a model with exceptional parameters beyond what the textures can a chieve, we can simply define a new custom shader.
Maybe one day we will create shaders for different material types. :-)
Image
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

I've got an idea how to finally introduce tangent-space normal maps into wz engine without changing model format.
Few years ago Vexed showed me that wz's renderer already supported smooth shading technique. This feature is enabled only for terrain because its mesh has enough polygons to look good when shaded. Units have very lowpoly meshes( just cubes) and shading causes lighting artifacts on them, so it's disabled.
Currently wz without textures looks like this.
12 (1).jpg
The idea is to add a new pie3 type flag that will enable shading on a model. If shading is enabled new models will look so, like all triangles are placed into one smooth group in 3d editor and don't have hard edges.
21 (1).jpg
21 (1).jpg (20.05 KiB) Viewed 415154 times
11.jpg
11.jpg (24.96 KiB) Viewed 415153 times
This shading technique will allow us to precalculate vertex normals to smooth co-joined triangles and could be used in shader calculations for tangent-space normal mapping(and many other good stuff).
cons:
-Artists will be limited a bit when creating models - can't use 90* angles.
-New models will "eat" a bit more triangles to avoid 90* angles.
-Increased loading time into a map.
pros:
-Will be significantly increased modelling and texturing time.
-New models will be much more detailed via normal map.
-Tangent-space normal maps are easily editable in 2d editors like gimp, photoshop, xnormal and others.
-No need in swap to a completely new model format.
-Fits wz's step-by-step development flow.

I want to know what do current coders think about this idea? Should we prepare a patch for the master branch? Is anybody interested in such update? I don't ask you to make this, just some searching.:)
Attachments
12 (1).jpg
Image
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

Artifact
Artifact
Image
User avatar
Slye_Fox
Trained
Trained
Posts: 89
Joined: 03 Jan 2007, 22:25
Location: London, UK
Contact:

Re: Models by MaNGusT (AR)

Post by Slye_Fox »

Awesome.
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

I'm writing a shader that could replace current tcmask shader in master. It will improve specular reflections of light and also return back support for specular maps and normal maps. Normal maps will be in tangent-space as standard, so optional per-vertex normals directive is needed. Old models will look same as before.
All these changes will make life of wz's artists easier, so all that a new artist will need - make a model, adjust it in WMIT and place to the game. No need of special knowledge and skills about shaders or texture's limitations, just learn some lessons on the internet about standard low-poly modelling and texturing technique.
Spoiler:
Image
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Models by MaNGusT (AR)

Post by Jorzi »

Good stuff man :)
ImageImage
-insert deep philosophical statement here-
User avatar
MaNGusT
Art contributor
Posts: 1152
Joined: 22 Sep 2006, 10:31
Location: Russia

Re: Models by MaNGusT (AR)

Post by MaNGusT »

Rewrited all light models to work in tangent space and now difference is clearly visible.
Phong
Phong
Blinn
Blinn
Gauss
Gauss
Blinn's light is ideal for rough surfaces while Gaussian light is good for metal surfaces. Phong's light works good with plastic surfaces and show highlights approximately between Gauss and Blinn but too untruly at some view angles, only front-facing specular reflections look good.
Attachments
Blinn
Blinn
Last edited by MaNGusT on 02 May 2019, 17:10, edited 1 time in total.
Image
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Models by MaNGusT (AR)

Post by Jorzi »

Hi
I remember we did some tangent space stuff successfully in the wzm branch. One problem is each program calculates smooth normals slightly differently, so this was solved by including vertex normals and bitangents in the vertex definition. Are you suggesting that this is included into the pie format?
ImageImage
-insert deep philosophical statement here-
Forgon
Code contributor
Code contributor
Posts: 298
Joined: 07 Dec 2016, 22:23

Re: Models by MaNGusT (AR)

Post by Forgon »

@Jorzi @MaNGusT:
Could you review i-NoD's proposed extension to the PIE format (PR 338)?
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Models by MaNGusT (AR)

Post by Jorzi »

Technical question: How will this info be passed into the shader code? In the shader, you will preferably need three vectors (normal, tangent, bitangent) to create the per-vertex normal matrix. If you have two you can of course generate the third one through the cross product, although this might cause problems with mirrored uv:s where some of the tangent spaces are left handed.
I think i-NoD already did this stuff correctly in WMIT (calculating the tangents with mikktspace?)when we were testing the wzm format, but I think the tangents were at that time also exported straight into warzone. However, if the pie format contains only normals, then that code should be included in warzone as well.
ImageImage
-insert deep philosophical statement here-
Post Reply