Lighting
-
Jorzi
- Regular

- Posts: 2063
- Joined: 11 Apr 2010, 00:14
Re: Lighting
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
The material would of course be included in the .pie file, while the light is set up for the map/tileset/game
You do not have the required permissions to view the files attached to this post.


-insert deep philosophical statement here-
-
MaNGusT
- Art contributor
- Posts: 1154
- Joined: 22 Sep 2006, 10:31
- Location: Russia
Re: Lighting
are you going to use specular textures?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
I use them and also think about specular color textures because painted parts of an object shines with mix of dye color.
-
Jorzi
- Regular

- Posts: 2063
- Joined: 11 Apr 2010, 00:14
Re: Lighting
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...
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...


-insert deep philosophical statement here-
-
Jorzi
- Regular

- Posts: 2063
- Joined: 11 Apr 2010, 00:14
Re: Lighting
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:
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?
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;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?
You do not have the required permissions to view the files attached to this post.


-insert deep philosophical statement here-
-
MaNGusT
- Art contributor
- Posts: 1154
- Joined: 22 Sep 2006, 10:31
- Location: Russia
-
Jorzi
- Regular

- Posts: 2063
- Joined: 11 Apr 2010, 00:14
Re: Lighting
You want me to make a tileset?
Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?
Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?


-insert deep philosophical statement here-
-
MaNGusT
- Art contributor
- Posts: 1154
- Joined: 22 Sep 2006, 10:31
- Location: Russia
Re: Lighting
in the end of the postJorzi wrote:Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?
I don't think that it's the good idea.You want me to make a tileset?
Last edited by MaNGusT on 12 May 2011, 18:01, edited 2 times in total.
-
Goth Zagog-Thou
- Regular

- Posts: 1582
- Joined: 06 Jan 2007, 08:08
- Location: Delta Base
Re: Lighting
You guys continue to rock. Well done! Looks great!
-
Jorzi
- Regular

- Posts: 2063
- Joined: 11 Apr 2010, 00:14
Re: Lighting
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;

-insert deep philosophical statement here-
-
MaNGusT
- Art contributor
- Posts: 1154
- Joined: 22 Sep 2006, 10:31
- Location: Russia
Re: Lighting
better post in this thread -> viewtopic.php?f=33&t=4951&hilit=TCMaskJorzi 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;
viewtopic.php?f=33&t=7048&hilit=TCMaskJorzi 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?
-
cybersphinx
- Inactive

- Posts: 1695
- Joined: 01 Sep 2006, 19:17
Re: Lighting
If it's about something in our code, best make a ticket.
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Lighting
Cool. I will commit your new version, then.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.
Let me have a look.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?
Something like the attached patch should give you access to this information.Jorzi wrote:-Is it possible to get the object(droid/building/feature) orientation vector into the fragment shader?
You do not have the required permissions to view the files attached to this post.
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: Lighting
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:
Not much time right now, so I have not tested the patch other than check that it compiles and runs... Hope this helps.
(The zero parameter is just a hack to make it easier to parse...)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
Not much time right now, so I have not tested the patch other than check that it compiles and runs... Hope this helps.
You do not have the required permissions to view the files attached to this post.
-
Safety0ff
- Trained

- Posts: 397
- Joined: 18 Jul 2009, 23:23
Re: Lighting
It is hardcoded at the moment, but you can workaround it by hard coding a different color into the shader.Jorzi wrote:You want me to make a tileset?![]()
Anyway is it possible to change the teamcolor in WMIT or is it hardcoded?
-
Safety0ff
- Trained

- Posts: 397
- Joined: 18 Jul 2009, 23:23
Re: Lighting
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.Per wrote:Cool. I will commit your new version, then.
EDIT: These are the results I am getting here (border is selected tcmask color):
You do not have the required permissions to view the files attached to this post.