TCMask

Team and Website feedback
Constructive criticism is welcome.

TCMask

Postby MaNGusT » 08 May 2011, 16:14

does wmit uses the additive method for tcmask? so what method is used in game? afaik, I-NoD used another method in game... may be the overlay or something similar, so that black areas on a regular texture shouldn't be so bright. I mean that regular texture+tcmask looks much brighter than texture without tcmask.
ImageImage

P.S. Sorry for my English.
User avatar
MaNGusT
Artist
Artist
 
Posts: 218
Joined: 21 May 2010, 00:02

Re: Model conversion tool thread

Postby Safety0ff » 08 May 2011, 17:10

The same method/code as the original tcmask (i.e. it doesn't have the new shader lighting code that per put in).

This is the part that does the colouring in the shader (tcmask.frag):
Code: Select all
// Apply color using "Merge grain" within tcmask
gl_FragColor = (colour + (teamcolour - 0.5) * mask.a) * gl_Color;

mask.a is the tcmask texture's alpha channel, gl_Color is usually white (so it can be ignored) and colour is the texture colour.

If there's a different equation you want to use/experiment with, let me know. :)
Safety0ff
 
Posts: 62
Joined: 19 Jun 2010, 19:23

Re: Model conversion tool thread

Postby MaNGusT » 08 May 2011, 17:16

so... now I think I understand why modern rts games don't paint all units into a team's color. they just use a colored stripes on some parts of texture... simply there is just no method which will not make brighter an original texture. :)
ImageImage

P.S. Sorry for my English.
User avatar
MaNGusT
Artist
Artist
 
Posts: 218
Joined: 21 May 2010, 00:02

Re: Model conversion tool thread

Postby Safety0ff » 08 May 2011, 17:16

maybe this would be better:
Code: Select all
gl_FragColor = (colour + teamcolour * mask.a - 0.5) * gl_Color;

Hmm, but it would make the original texture much darker. hmm
Safety0ff
 
Posts: 62
Joined: 19 Jun 2010, 19:23

Re: Model conversion tool thread

Postby MaNGusT » 08 May 2011, 17:19

the all I want to say is that black+ other color=black color. I don't see this with current shading formula.
ImageImage

P.S. Sorry for my English.
User avatar
MaNGusT
Artist
Artist
 
Posts: 218
Joined: 21 May 2010, 00:02

Re: Model conversion tool thread

Postby Safety0ff » 08 May 2011, 17:38

MaNGusT wrote:the all I want to say is that black+ other color=black color. I don't see this with current shading formula.
Lets look at an example:
Team colour = (34,139,34) (RGB) and take alpha to be 1 (full team colour)
Colour = black (0,0,0)
gl_Color= white (1,1,1)
then:
gl_FragColor = (colour + (teamcolour - 0.5)* mask.a) * gl_Color;
gl_FragColor = colour + teamcolour-0.5;
gl_FragColor = teamcolour-0.5;
gl_FragColor = (0,11,0);

So in this case, black + teamcolour = very very dark teamcolor.

If the team colour was (0,255,0) then the resulting colour would be (0,127,0)
Safety0ff
 
Posts: 62
Joined: 19 Jun 2010, 19:23

Re: Model conversion tool thread

Postby MaNGusT » 08 May 2011, 17:59

Safety0ff wrote:gl_FragColor = (0,11,0);
but it should be 0,0,0. so I think I'm gonna use colored stripes(with 128,128,128 default color) to not brake brightness or another method is adjust brightness of regular texture to make it a bit darker. :)
ImageImage

P.S. Sorry for my English.
User avatar
MaNGusT
Artist
Artist
 
Posts: 218
Joined: 21 May 2010, 00:02

Re: Model conversion tool thread

Postby Safety0ff » 08 May 2011, 19:25

MaNGusT wrote:
Safety0ff wrote:gl_FragColor = (0,11,0);
but it should be 0,0,0.
Why? 139-128 = 11 (or 0.543 - 0.5 = 0.043).
Safety0ff
 
Posts: 62
Joined: 19 Jun 2010, 19:23

Re: Model conversion tool thread

Postby MaNGusT » 09 May 2011, 02:18

Why? 139-128 = 11 (or 0.543 - 0.5 = 0.043).
because black+ other color have to be equal black color.
ImageImage

P.S. Sorry for my English.
User avatar
MaNGusT
Artist
Artist
 
Posts: 218
Joined: 21 May 2010, 00:02

Re: Model conversion tool thread

Postby Safety0ff » 09 May 2011, 03:10

MaNGusT wrote:because black+ other color have to be equal black color.
black multiplied by anything is black.

See: http://docs.gimp.org/en/gimp-concepts-layer-modes.html
Safety0ff
 
Posts: 62
Joined: 19 Jun 2010, 19:23

Re: Model conversion tool thread

Postby MaNGusT » 09 May 2011, 13:28

Safety0ff wrote:black multiplied by anything is black.
yep but resulting image will be very dark.
I've seen this already. for me overlay mode looks not so bright, contrast and saturated but it's only for me. so never mind. i will just use the method that others games use.
ImageImage

P.S. Sorry for my English.
User avatar
MaNGusT
Artist
Artist
 
Posts: 218
Joined: 21 May 2010, 00:02

Re: Model conversion tool thread

Postby Safety0ff » 09 May 2011, 16:25

MaNGusT wrote:
Safety0ff wrote:black multiplied by anything is black.
yep but resulting image will be very dark.
No, it will be pure black.
Safety0ff
 
Posts: 62
Joined: 19 Jun 2010, 19:23

Next

Return to Ideas and suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron