Page 37 of 59

Re: Models by MaNGusT (AR)

Posted: 02 Mar 2012, 23:10
by Jorzi
A dynamic dirtmap system would unfortunately require at least two extra textures as well as a procedural animation system :/

Anyway, the shininess is controlled by the spec map and it can also be controlled with an individual factor for the whole model.

Re: Models by MaNGusT (AR)

Posted: 02 Mar 2012, 23:10
by Emdek
Shadow Wolf TJC, yes, but some approach to make them more individual would be also nice, it's boring to see many exact the same instances. ;-)
To make it more realistic (yes, this is not simulator, but such details are "icing on the cake").

Jorzi, it should be enough to generate it dynamically and then cache, maybe using some fractals to make it realistic.

Re: Models by MaNGusT (AR)

Posted: 03 Mar 2012, 00:53
by MaNGusT
guys. it was just a test shot, I didn't configure textures and light parameters :-)

Re: Models by MaNGusT (AR)

Posted: 03 Mar 2012, 10:29
by Emdek
MaNGusT, sure, but such as details could be nice addition in future (and useful to make new videos better).
Also, wouldn't be shader capable of adding such effects (new texture even in five variants would be too repeating)?

Re: Models by MaNGusT (AR)

Posted: 03 Mar 2012, 11:05
by MaNGusT
Emdek wrote:MaNGusT, sure, but such as details could be nice addition in future (and useful to make new videos better).
Also, wouldn't be shader capable of adding such effects (new texture even in five variants would be too repeating)?
think no.
dmg system I've seen in C&C Generals, units at low health change its duffuse texture from clean to damaged. It's not that necessary for wz at this moment, imho. :-)

Re: Models by MaNGusT (AR)

Posted: 03 Mar 2012, 12:05
by Jorzi
@Emdek: fractals and other procedural textures are rarely used in games because they require a lot of extra computation from the shader.

Re: Models by MaNGusT (AR)

Posted: 03 Mar 2012, 16:30
by Emdek
MaNGusT, sure, there are more important things now, but maybe in future... ;-)
Jorzi, cannot such texture be generated once (or when unit gets hit) and later cached?

Re: Models by MaNGusT (AR)

Posted: 03 Mar 2012, 17:00
by Jorzi
@Emdek: Yes, it's called an image texture ;)

Re: Models by MaNGusT (AR)

Posted: 05 Mar 2012, 04:19
by MaNGusT
latest wmit's pix shader.
-Now light is actually Blinn-Phong that gives a nicer and smother lighting with performance of Phong light.
-Light calculating formulas are 99.9% right, materials can be still in use, for the old models specular parameters should not be greater than 0.2, for a new models with spec maps ambient,diffuse,specular parameters have to be = 1 to do no impact.
-Now shininess map could be putted into alpha channel of a specular map optionally.

but there is still a small bug that I commented in shader. Easy visible with teapot test model in wmit. Idk how to fix it but there is a hint at the bottom of the page.
Jorzi, now is your turn. :wink:
pie3.frag.zip
(1.16 KiB) Downloaded 349 times
P.S. btw
The extension frag is not allowed.
wtf guys? :?

P.S.2. This bug exists in Phong light too..

Re: Models by MaNGusT (AR)

Posted: 07 Mar 2012, 23:57
by MaNGusT
olololo. Jorzi, I've found the solution. Lambert could be clamped or maxed, nvm,I think it's the same things.

Code: Select all

	colour += gl_LightSource[0].diffuse * gl_FrontMaterial.diffuse * diffusemap * lambertTerm;
	colour += gl_LightSource[0].specular * matspecolor * blinnTerm * lambertTerm;
it gives us a smooth edges between lamebert = 0.0 and lambert > 0.0
also if you will comment out the lambert's clamp you will get nice "real" self-shadows that make the ambient light to be almost zero in places where sun doesn't light.

I've attached 2 shaders, regular one has only edge fix and experimental one has a lot of optimizations and adds(i.e. I moved some vertex calculations to vertex shader since the frag shader is a bit overloaded)
pie.frag.zip
(3.61 KiB) Downloaded 380 times
P.S. I think I have to show what we were fixing. :)
clearly visible hard specular edge
clearly visible hard specular edge
fixed!
fixed!

Re: Models by MaNGusT (AR)

Posted: 08 Mar 2012, 10:16
by Jorzi
Hmm maybe this is a good idea, although it does darken the specular highlight quite a bit, making things look less metallic imo.

Edit: what if you multiply it with pow(LambertTerm, 0.25) instead. That will still give a smooth trasition, but not so much light reduction ;) I made a sketch on how the different methods work (red is original cutoff, green is your current solution)

Re: Models by MaNGusT (AR)

Posted: 08 Mar 2012, 17:07
by MaNGusT
Let's compare the real images. :roll:
As you can see, yes, my variant is more darkened than your, but we don't see a such big hotspot at so cut view angle in real life.
shaded side
shaded side
and if we look on the front(lightened) side then we see that hotspots are equal because at this "points" the lambertTerm is 1.0
lightened side
lightened side
Also there could be a good chance to use lambertTerm unchanged. As you can see the hotspot is still same as before but darkened side is black in parts which get almost 0 light; in these parts ambient light color is replaced by -1 values from lambertTerm, as far as I understand. :)
lambertTerm differs from -1 to 1(not clamped to 0 , 1)
lambertTerm differs from -1 to 1(not clamped to 0 , 1)
edit: last variant works only with my fix, using pow() we get graphics artifacts.

Re: Models by MaNGusT (AR)

Posted: 08 Mar 2012, 19:06
by Jorzi
Ok, maybe yours is still better, pow(lambertTerm, 0.25) was sharper than what I thought. Tried your shading on my transport model (converted it into tangent space and re-exported with normals) and it looked quite nice :)

Re: Models by MaNGusT (AR)

Posted: 14 Mar 2012, 04:15
by MaNGusT
Jorzi wrote:Tried your shading on my transport model (converted it into tangent space and re-exported with normals) and it looked quite nice :)
That's the goal. :wink:

btw... Who? and why? removed yellow sandy mist from the game? http://commons.wikimedia.org/wiki/File: ... -_base.jpg look! it looked so nice, it made a feel of the real Arizona desert. I've just understood why I still love the original graphics.. it makes you feel the environment, even with those ugly sharp-ish pixels what they called as a 3d graphics in 1999.

you can find more here http://commons.wikimedia.org/wiki/Warzone_2100

edit:
P.S. the latest build of wmit https://github.com/downloads/iNoDlite/W ... 676e08.zip ,now materials can be adjusted in real-time, added option to disable the vertex merger for vertexes with equal coordinates. thx emdek for help and adequate discussion of materials tab. :)

Re: Models by MaNGusT (AR)

Posted: 14 Mar 2012, 07:38
by NoQ
Who? and why? removed yellow sandy mist from the game?
+1, this happened quite a long time ago, and i still wonder why. Sky is there, but the fog is black or absent (not sure)