Page 1 of 1

Optional NORMALS directive in PIE format

Posted: 19 May 2019, 18:12
by MaNGusT
I want to present you a new graphic feature for WZ's artists. It will allow us to use modern and flexible tangent-space normal maps.
Spoiler:
What it supports:
-custom per-vertex normals created in 3d editor
-smooth groups
-mirrored and overlapped texture coordinates for symmetric models.
-deform animation (in future)

Shaders requirements:
1) Your tangent-space normal map should use red channel RIGHT(+) and green channel UP(+).
2) Your object-space normal map should use red channel RIGHT(+), green channel UP(+)
3) If you want to use a normal map, you also have to create and specify a specular map for it.
There are a lot of tools on the internet that create specular map from normal map, i.e. xnormal. Or google any lessons how to create `em manually.
4) We've saved support for object-space normal maps for backward compatibility. To use them a pie model must not have NORMALS directive.
5) We've saved original look of vanilla models. If you want to create a model using original color texture. Do not specify SPECULARMAP directive in PIE model.

We have also upgraded the light model from Phong's to Gaussian which is much better in highlights calculation without losing any performance.

What you need if you want to try and test it:
-WZ master build that supports this directive. win or others
-wz shaders that support all these features. (in test4.zip archive)
-Latest WMIT for preview and to convert models from OBJ format to PIE with normals.

example of how to create tangent-space normal maps in GIMP you can find here.

Re: Optional NORMALS directive in PIE format

Posted: 19 May 2019, 19:43
by pastdue
This really is fantastic work.

While it probably won't make the cut for 3.3.0 (we're in the beta phase so we're trying to focus on bug fixes - and hopefully another beta soon), this is an excellent feature candidate for 3.4.0. (And with any luck, release cadence will speed up after 3.3.0).

Re: Optional NORMALS directive in PIE format

Posted: 19 May 2019, 21:01
by MaNGusT
Thank you. It currently works fine but I'm not satisfied with all these inverts in shaders. I'm sure shaders have to be clearly readable to any person which can join in wz's development. We have enough time before 3.4.0 to find the problem of it in wz's code. Probably it's because of sun positioned to -y. So we're still cleaning the code.