Game Development Community

rgb spec maps and alpha issue (solved)

by TheGasMan · in Torque 3D Professional · 07/21/2009 (9:13 am) · 13 replies

I am able to barely see the colorspec maps once added to a material.
The power is astronomically low. I have to use an ultra saturated image to barely see any color come through.

Here is an example..
www.ericrbarth.com/uploadpanel/view/example_rgb_spec_issue_th.jpg


Is the RGB-Spec map use a WIP ?




#1
07/21/2009 (10:05 am)
Post a shot of your texture's alpha channel. I think there's something wrong with yours, since it controls the specular power (matte/shiny effect), and seems it disables specular if you have it fully opaque.
#2
07/21/2009 (10:29 am)
I simply can not have both set. Color-spec maps shut off the other specular component and Vice-Versa. I am unable to recreate the default gideon materials with the default Gideon textures.

@Manoel:
I have tried images with these alpha types: a mask, white, grey @ 30%, grey @ 50%, grey @ 80%, black and even a white to black gradient
#3
07/21/2009 (10:32 am)
If you have an alpha channel, it will use alpha * 255 as your specular power. If you don't want to control per-pixel specular power, don't have an alpha channel.
#4
07/21/2009 (10:55 am)
It worked for me:
i25.tinypic.com/20a9feu.jpg
I believe you have an opaque alpha in your texture. This makes the specular power 255, which is so high that it kills off the specular effect. In my test I used 10% alpha (specular power 25).
#5
07/21/2009 (11:25 am)
removed to avoid confusion by future readers...



#6
07/21/2009 (11:32 am)
//edited out post

I have it working now.

May I suggest to whoever is working on this: to reverse the alpha channel values in use. The human eye can see changes in the white-end-greyscale easier than the black-end-greyscale. Besides, it would follow the rules of texture creation in current gen texture making.
whites = highheight/opaque/gloss
blacks = lowHeight/non-opaque/no-gloss

Or just tell me to "shut it and deal with it", I could care. :P

Thx for the tips Manoel.
#7
07/21/2009 (12:22 pm)
Care to post your specular map (with alpha channel)? Also, what are your sun settings? The specular map is multiplied by the specular color generated by the light. If your sun/scattersky diffuse is dim, it won't show as much.

A full white specular map with 10% alpha should display identical to using constant white specular with specular power 25.

--EDIT--
Ah, sneaky edit! Good ol' alpha confusion. Yeah, proper specular masks should be almost fully transparent most of the time.

A good way to control specular power in Photoshop is painting the alpha channel (or layer mask) using 8-bit RGB values: that way you'll see values that range from 0-255 instead from 0.0 to 1.0. That way the greyscale value translates exactly to the specular power value at that pixel, so a layer transparency mask filled with rgb(32,32,32) will represent a specular power of 32.
#8
07/21/2009 (12:23 pm)
Anyone else see the alpha channel values as backwards ? just curious.
#9
07/21/2009 (12:42 pm)
I have not had a chance to mess with them yet but the logic and all engines and for that matter 3D graphics in general use is the higher the value "whiter" a pixel is the more the specular effect is present.

Although I have to say if things are crapping out at full spec I would call that a bug. I wouldn't think that should happen by design.
#10
07/21/2009 (12:45 pm)
..as it currently stands, the darker the alpha, the more the specular power.
#11
07/21/2009 (1:27 pm)
...but specular "power" doesn't mean what you both seem to be thinking. It's not "power" as in "strength", it's "power" as in "two power two equals four".

Specular power doesn't make specular whiter or stronger the higher it is. It cannot do that, because specular value calculated in the shader ranges from 1.0 to 0.0, which modulates the light color and light intensity. The "specular power" makes the specular intensity decay faster as the as the angle between the reflected eye vector and the light vector increases.

Shiny plastic = high specular power (small, focused specular highlights).
Matte plastic = low specular power (large, diffuse specular highlights).
#12
07/21/2009 (1:38 pm)
sure sure sure..
I spoke without thinking about being literal. ;)

edit: I should have added: thank you for adding color spec maps! [sorry I forgot about that part, it has been a very hectic day thus far.]
#13
07/21/2009 (9:00 pm)
ahh so it controls decay and not intensity. I stand corrected.