Decals

Having a problem with a shader or texture
User avatar
xandaxs
Posts: 959
Joined: Wed Aug 17, 2011 5:22 pm
Location: Oeiras, Portugal

Decals

Post by xandaxs »

Hey guys!!

As some of you might know, decals are a major part of a map.
I believe it was in 2005 that the game F.E.A.R caused great impact by using decals a long with parallax mapping, giving the feeling of depth.

As any of you tried this in Urban Terror? Does it look good? Is it worth trying?
I'd like to try it, but I don't know how Parallax mapping works.
So far, the only one I know who made it work in Rayne.

What do you guys think?
[12:25] <JohnnyEnglish> morning Nounou
[12:25] <JohnnyEnglish> wotcha doing?
[12:25] <Nounou> hello
[12:26] <Nounou> nothing much, i've nothing to do at work so
[12:26] <Nounou> modeling woman
[12:26] <JohnnyEnglish> woo
[12:26] <JohnnyEnglish> real women?
[12:26] <Nounou> realistic yes, on maya

Image

User avatar
DagF
Posts: 277
Joined: Thu Aug 18, 2011 8:40 am
Location: Norway
Contact:

Re: Decals

Post by DagF »

I think the _b maps are parallax mapping,

This is a test i made some time ago:

Image

This tesxture have one normal map made with the gimp plugin and a _b map that was made from the normal map.

I made it first to greyscale then loverd the contras making it less detailed.

I've never seen the game so i dont know how they have done it, but i think you can do enough with just parallax mapping combined with bumpmapping.

I'm proberly not 100% correct and i hope Rayne will correcte me and give you an clearer awnser when he get time.
Image

User avatar
xandaxs
Posts: 959
Joined: Wed Aug 17, 2011 5:22 pm
Location: Oeiras, Portugal

Re: Decals

Post by xandaxs »

That looks rather good!
[12:25] <JohnnyEnglish> morning Nounou
[12:25] <JohnnyEnglish> wotcha doing?
[12:25] <Nounou> hello
[12:26] <Nounou> nothing much, i've nothing to do at work so
[12:26] <Nounou> modeling woman
[12:26] <JohnnyEnglish> woo
[12:26] <JohnnyEnglish> real women?
[12:26] <Nounou> realistic yes, on maya

Image

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Decals

Post by Rayne »

PLEASE LOOK AT PICTURES FROM BOTTOM TO TOP, OTHERWISE THEY'LL MAKE NO SENSE
Don't make _b maps from _n maps.
You have to learn the difference between _b maps used for bump mapping and _b maps used for parallax mapping.
_b maps used for bump mapping are used to add some depth and reflection. So they can be more detailed, but they have to be .tga files and have to contain an alpha channel.
Unlike of _n maps alpha channel doesn't works the same way. Clean _n map without an alpha channel has 100% reflectivity. A _b map without an alpha channel however doesn't look like that and the reflection is rather low.
One problem i encountered with parallax mapping is that it always look boring due to lack of shadows.
There are couple of ways this can be fixed.
One way is to bake occlusion directly into a diffuse map. Downside to this technique is that the occlusion is always visible no matter the light intensity.
Another way is to add it through _n maps. By selecting the red and green channel, painting those 2 into the blue channel then raising the brightness and lowering the contrast we get occlusion. This occlusion is light dependent, which means occlusion fades out on parts of the surface that are closer to the light.
Attachments
And this is how it looks like when you add a little too much occlusion :D
And this is how it looks like when you add a little too much occlusion :D
Here i combined my occluded _n map and my _b map (clean one made for parallax mapping).<br />Now we have parallax mapping that is actually visible and has some proper depth.
Here i combined my occluded _n map and my _b map (clean one made for parallax mapping).
Now we have parallax mapping that is actually visible and has some proper depth.
from left to right:<br />_n map<br />_n maps blue channel<br />alpha channel<br />One thing you MUST DO, is add the blue channel to the alpha channel, the blue channel must never be allowed to create reflections. The specular level generated by the blue channel has no sense at all and always look bad. <br />Blue channels only purpose is to add occlusion, and that occlusion can be as fine as you want. The surface isn't distorted.<br />This technique successfully replaces parallax mapping on surfaces with low depth or high amount of  fine details.<br />It can add depth to rough surfaces such as concrete walls and tree bark. <br />Another interesting thing about it is that it can diminish the effect of bloom. So the surface doesn't turns white everywhere but only on brightest parts.
from left to right:
_n map
_n maps blue channel
alpha channel
One thing you MUST DO, is add the blue channel to the alpha channel, the blue channel must never be allowed to create reflections. The specular level generated by the blue channel has no sense at all and always look bad.
Blue channels only purpose is to add occlusion, and that occlusion can be as fine as you want. The surface isn't distorted.
This technique successfully replaces parallax mapping on surfaces with low depth or high amount of fine details.
It can add depth to rough surfaces such as concrete walls and tree bark.
Another interesting thing about it is that it can diminish the effect of bloom. So the surface doesn't turns white everywhere but only on brightest parts.
Through an _n map we add details without adding distortion like with _b maps.<br />When and _n map is used in combination with a _b map we get parallax mapping. <br />For parallax mapping our _b map (also referred to as height map) should be as simple and clean as possible. Smaller details add distortion and destroy the surface. <br />So don't  try to parallax map small dents and holes as you will only get a distorted surface that looks horrible.<br />_b map for parallax mapping can (and should) be a jpeg. Alpha channel in _b maps doesn't affects the effect so using a .tga _b map is just a waste of space in your pk3 file.
Through an _n map we add details without adding distortion like with _b maps.
When and _n map is used in combination with a _b map we get parallax mapping.
For parallax mapping our _b map (also referred to as height map) should be as simple and clean as possible. Smaller details add distortion and destroy the surface.
So don't try to parallax map small dents and holes as you will only get a distorted surface that looks horrible.
_b map for parallax mapping can (and should) be a jpeg. Alpha channel in _b maps doesn't affects the effect so using a .tga _b map is just a waste of space in your pk3 file.
a _b map was derived from the diffuse map by turning the saturation down to 0, alpha channel is high contrast and controls the strength of the effect.<br />Higher contrast _b map (not the alpha channel but the desaturated diffuse map we made to serve as our _b map) adds more details and in the same time distortion (noise) to the surface, so don't raise it's contrast too much
a _b map was derived from the diffuse map by turning the saturation down to 0, alpha channel is high contrast and controls the strength of the effect.
Higher contrast _b map (not the alpha channel but the desaturated diffuse map we made to serve as our _b map) adds more details and in the same time distortion (noise) to the surface, so don't raise it's contrast too much
clean _b map from previous example only this time with an alpha channel derived from the diffuse map, increase in surface reflection is substantial even with a lower contrast alpha channel
clean _b map from previous example only this time with an alpha channel derived from the diffuse map, increase in surface reflection is substantial even with a lower contrast alpha channel
clean _b map, no alpha channel, low level of details, best for parallax mapping
clean _b map, no alpha channel, low level of details, best for parallax mapping

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Decals

Post by Rayne »

This is not good, all my attachments are inverted...didn't know this is gonna happen.

User avatar
xandaxs
Posts: 959
Joined: Wed Aug 17, 2011 5:22 pm
Location: Oeiras, Portugal

Re: Decals

Post by xandaxs »

So, it is worth trying i guess :)
Gonna do it! ;)
[12:25] <JohnnyEnglish> morning Nounou
[12:25] <JohnnyEnglish> wotcha doing?
[12:25] <Nounou> hello
[12:26] <Nounou> nothing much, i've nothing to do at work so
[12:26] <Nounou> modeling woman
[12:26] <JohnnyEnglish> woo
[12:26] <JohnnyEnglish> real women?
[12:26] <Nounou> realistic yes, on maya

Image

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Decals

Post by Rayne »

It's definitely worth trying. But keep in mind that making a height map is easy, making a good height map is art.
You have to know the diffuse map and determine what should and what shouldn't be parallax mapped.
Never go nuts with depth, more depth equals more distortion and that never looks good.

User avatar
nemNEMnem
Posts: 271
Joined: Sat Aug 20, 2011 11:11 am
Location: Germany
Contact:

Re: Decals

Post by nemNEMnem »

and what is now better? _n or _b? or _n and _b? and is there a _b-plugin for gimp or ps?
for a big tree, you need a small axe.
--Bob Marley--

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Decals

Post by Rayne »

What is better is a question nobody can answer cause there's no correct answer.
Both maps serve it's purpose and their purposes are quite different.
I rarely to almost never use .tga _b maps to add depth and specular, _n maps do a much better job. _b maps i use only for parallax mapping.
There is no real height map generator, well technically there is but the results are never precise enough.
Height maps are best made manually. In some cases the diffuse map can be used to derive a decent height map, but most of the time you'll have to hand paint it or the result will be a highly distorted surface that can only look bad.
Which is why i use _n maps with a modified blue channel. Occlusion fakes depth and replaces parallax mapping to a certain degree. Of course it's depth is rather limited and doesn't works well on all surfaces but it definitely works better than most height maps created through simple desaturation of the diffuse map (which is how most people create them).

User avatar
xandaxs
Posts: 959
Joined: Wed Aug 17, 2011 5:22 pm
Location: Oeiras, Portugal

Re: Decals

Post by xandaxs »

I've a nice link to a tutorial, I'll post when I get home
[12:25] <JohnnyEnglish> morning Nounou
[12:25] <JohnnyEnglish> wotcha doing?
[12:25] <Nounou> hello
[12:26] <Nounou> nothing much, i've nothing to do at work so
[12:26] <Nounou> modeling woman
[12:26] <JohnnyEnglish> woo
[12:26] <JohnnyEnglish> real women?
[12:26] <Nounou> realistic yes, on maya

Image

Post Reply