Page 35 of 59
Re: Models by MaNGusT (AR)
Posted: 23 Feb 2012, 14:00
by MaNGusT
have Just rebaked old normal map to see how it looks in wmit. don't look at bolts, they are screwed!

- old

- new
Re: Models by MaNGusT (AR)
Posted: 23 Feb 2012, 17:33
by Jorzi
The old one is clearly more accurate, is this with or without my shader changes?
Re: Models by MaNGusT (AR)
Posted: 23 Feb 2012, 17:36
by MaNGusT
Jorzi wrote:The old one is clearly more accurate, is this with or without my shader changes?
with

I think the angle less than 60* is acceptable for hard edges in smooth groups, 90* produce too much shadow distortion.
Re: Models by MaNGusT (AR)
Posted: 25 Feb 2012, 01:34
by Searge-Major
Forgive me for not going through all these posts to find out, but
what is it?
Don't get me wrong, I am seriously impressed, I just can't tell if it's meant to be a vehicle body, or something weird that I haven't heard of before.
Whatever it is, the detail you've put in is amazing.

Re: Models by MaNGusT (AR)
Posted: 25 Feb 2012, 05:28
by driver4
Searge-Major wrote:Forgive me for not going through all these posts to find out, but
what is it? 
A viper body model.
Re: Models by MaNGusT (AR)
Posted: 28 Feb 2012, 03:32
by MaNGusT
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 09:28
by Jorzi
Tried your link and normalmaps work strange for me too. I checked the shader and the only change I could see was that the tbn matrix was calculated in the fragment shader instead. Maybe this screws up something since the axes get renormalized for each pixel. Tried messing with the shader, uncommenting he old method and commenting out the new, and it's still screwed...
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 13:42
by i-NoD
Jorzi wrote:Tried your link and normalmaps work strange for me too. I checked the shader and the only change I could see was that the tbn matrix was calculated in the fragment shader instead. Maybe this screws up something since the axes get renormalized for each pixel.
Its just a workaround for tests that slipped in this build, since crappy intel drivers can't correctly interpolate mat3 from vertex-to-fragment on my rig

On a second thought tnb vectors shouldn't be renormalized in fragment shader...
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 13:49
by Jorzi
Tried changing stuff around and whatever I do it's still not going back to the old behaviour... I'll try replacing the shaders with those from the old build...
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 14:21
by i-NoD
Jorzi wrote:Tried changing stuff around and whatever I do it's still not going back to the old behaviour... I'll try replacing the shaders with those from the old build...
Nothing changed in code logic, so it something in shader. The only useless thing I can think of is gl_NormalMatrix multiplication for tangent in some previous builds...
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 14:58
by Jorzi
I replaced the new shaders with the old and it worked
One thing I noticed was that "#pragma debug(on)" was commented out in the new shader.
What does that one do anyway?
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 15:47
by i-NoD
Jorzi wrote:I replaced the new shaders with the old and it worked
One thing I noticed was that "#pragma debug(on)" was commented out in the new shader.
What does that one do anyway?
Uhh.. Which one is that 'old'? There are dozens in my scrapyard...
GLSL specs 1.20 wrote:The debug pragma
#pragma debug(on)
#pragma debug(off)
can be used to enable compiling and annotating a shader with debug information, so that it can be used
with a debugger. It can only be used outside function definitions. By default, debug is turned off.
Gives nothing if you aren't using a special shader debugger.
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 18:39
by MaNGusT
i-NoD wrote:
Uhh.. Which one is that 'old'? There are dozens in my scrapyard...
wmit-win32_tangent.zip
Re: Models by MaNGusT (AR)
Posted: 29 Feb 2012, 19:56
by Jorzi
Ok, after some fiddling I found the errors.
-In vertex shader, tangent should be transformed by the normal matrix.
-t, b and n shouldn't be normalized in fragment shader when creating the matrix
-normalmap texture shouldn't be normalized before use
I attached a zip with working shaders, preserving the "export t, b and n as vectors" change

Re: Models by MaNGusT (AR)
Posted: 01 Mar 2012, 04:01
by i-NoD
Here is
WMIT with 'correct' shader and wzm file duplication fix.
Mirroring now works fine, provided that you'll supply correct green channel in normal map. Vertex shader could be tweaked with -tangent.w in bitangent calculation to avoid mass nm edit
Material GUI isn working yet, but values are saved/loaded in wzm format, so you can tweak them by hand (order: EMISSIVE, AMBIENT, DIFFUSE, SPECULAR and SHININESS).