Page 3 of 9
Re: Lighting
Posted: 04 May 2011, 12:57
by Jorzi
My suggestion for a material system that should cover everything including glow effects.
The material would of course be included in the .pie file, while the light is set up for the map/tileset/game
Re: Lighting
Posted: 04 May 2011, 15:06
by MaNGusT
Jorzi wrote:My suggestion for a material system that should cover everything including glow effects.
The material would of course be included in the .pie file, while the light is set up for the map/tileset/game
are you going to use specular textures?
I use them and also think about specular color textures because painted parts of an object shines with mix of dye color.
Re: Lighting
Posted: 05 May 2011, 08:30
by Jorzi
I've been thinking about it, although for most models, simply using the diifuse texture for specularity works surprisingly well, resulting in a typically metallic look. Structures, however, seem to need more advanced spec maps, since they're made up of multiple materials (metals, concrete, paint, glass etc..).
Making specular maps isn't too hard though, since you can essentially just start from your base color texture, change some colors and brightnesses around a bit, increase contrast, and multiply the ao pass over the result...
Re: Lighting
Posted: 12 May 2011, 12:15
by Jorzi
After fiddling around in SafetyOff's new export tool WMIT, I took a look at the shaders used both in WMIT and warzone trunk. I then rewrote the tcmask blending so that it better preserves the brightness variations of the base texture, resulting in a more natural look imo.
Here's the changed line of code:
Code: Select all
gl_FragColor = ((1.0 - mask.a) * colour + (teamcolour * colour * 2.1) * mask.a) * gl_Color;
Looking at the code, I think I might just have the knowledge necessary to add normal map support.
However, I have a few questions:
-I can see that the Shader has two textures, Texture0 is color and Texture1 is tcmask. How hard is it to add more textures to the shader and where do they need to be specified?
-Is it possible to get the object(droid/building/feature) orientation vector into the fragment shader?
Re: Lighting
Posted: 12 May 2011, 12:39
by MaNGusT
Jorzi wrote:
for what terrain type can be used the purple camo?

Re: Lighting
Posted: 12 May 2011, 13:40
by Jorzi
You want me to make a tileset?
Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?
Re: Lighting
Posted: 12 May 2011, 13:43
by MaNGusT
Jorzi wrote:Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?
in the end of the post
You want me to make a tileset?
I don't think that it's the good idea.

The only thing I can imagine as a new tileset is jungles or forest but I have a great plans on expanding the existed tilesets. also, FlaME doesn't support the new terrain textures, so plans are still only plans.
Re: Lighting
Posted: 12 May 2011, 14:28
by Goth Zagog-Thou
You guys continue to rock. Well done! Looks great!
Re: Lighting
Posted: 12 May 2011, 17:26
by Jorzi
A small optimization (if it even matters on modern hardware) using the built-in function mix:
Code: Select all
gl_FragColor = mix(colour ,(teamcolour * colour * 2.1), mask.a) * gl_Color;
Re: Lighting
Posted: 12 May 2011, 18:04
by MaNGusT
Jorzi wrote:A small optimization (if it even matters on modern hardware) using the built-in function mix:
Code: Select all
gl_FragColor = mix(colour ,(teamcolour * colour * 2.1), mask.a) * gl_Color;
better post in this thread ->
viewtopic.php?f=33&t=4951&hilit=TCMask
Jorzi wrote:-I can see that the Shader has two textures, Texture0 is color and Texture1 is tcmask. How hard is it to add more textures to the shader and where do they need to be specified?
viewtopic.php?f=33&t=7048&hilit=TCMask
Re: Lighting
Posted: 12 May 2011, 18:15
by cybersphinx
If it's about something in our code, best make a ticket.
Re: Lighting
Posted: 12 May 2011, 19:32
by Per
Jorzi wrote:After fiddling around in SafetyOff's new export tool WMIT, I took a look at the shaders used both in WMIT and warzone trunk. I then rewrote the tcmask blending so that it better preserves the brightness variations of the base texture, resulting in a more natural look imo.
Cool. I will commit your new version, then.
Jorzi wrote:Looking at the code, I think I might just have the knowledge necessary to add normal map support.
However, I have a few questions:
-I can see that the Shader has two textures, Texture0 is color and Texture1 is tcmask. How hard is it to add more textures to the shader and where do they need to be specified?
Let me have a look.
Jorzi wrote:-Is it possible to get the object(droid/building/feature) orientation vector into the fragment shader?
Something like the attached patch should give you access to this information.
Re: Lighting
Posted: 12 May 2011, 20:02
by Per
Attached patch should also give you access to an additional texture to be used for normal maps. It adds support for an additional, optional directive in the PIE file called NORMALMAP which can be added after the TEXTURE directive, like this:
PIE 2
TYPE 10200
TEXTURE 0 page-12-player-buildings.png 256 256
NORMALMAP 0 page-12-player-buildings-normal.png
LEVELS 1
LEVEL 1
POINTS 69
(The zero parameter is just a hack to make it easier to parse...)
Not much time right now, so I have not tested the patch other than check that it compiles and runs... Hope this helps.
Re: Lighting
Posted: 12 May 2011, 20:53
by Safety0ff
Jorzi wrote:You want me to make a tileset?
Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?
It is hardcoded at the moment, but you can workaround it by hard coding a different color into the shader.
Re: Lighting
Posted: 12 May 2011, 21:08
by Safety0ff
Per wrote:Cool. I will commit your new version, then.
Before this is done, I think we should compare the differences on a cube, whose diffuse texture is a gradient from white to black in the horizontal direction and tcmask texture is a gradient of alpha values in the vertical direction.
EDIT: These are the results I am getting here (border is selected tcmask color):

- Old - fixed function

- New shader

- Without multiplication by 2.1