All about splatting specular SMF - SSMF tutorial - Page 2

All about splatting specular SMF - SSMF tutorial

Tutorials & Resources For Mappers

Moderator: Moderators

User avatar
Nixa
Posts: 350
Joined: 05 Oct 2006, 04:32

Re: All about splatting specular SMF - SSMF tutorial

Post by Nixa »

Hurmph hurmph maybe its time to start mapping again
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: All about splatting specular SMF - SSMF tutorial

Post by Argh »

Tried it out.

So... er...

No offense meant, but why is it doing specular stuff when I've set specular to all zeroes? Didn't I send you that version that didn't have these issues?

<reads shader>

Oh, so basically you didn't get it at all, all the problems are still there. Oh well, not my problem :mrgreen:
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: All about splatting specular SMF - SSMF tutorial

Post by Kloot »

Addendum #2: as of Spring 0.83, SSMF maps can be given more apparent detail through the use of an additive-overlay normal texture. The alpha-channel of this texture serves as the blending factor between the terrain and texture normals. Your map's SMD should contain

Code: Select all

[MAP] {
    ...
    detailNormalTex=detailNormalTex.png;
}
which produces
SSMFDetailNormals.png
(1.73 MiB) Downloaded 4 times
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: All about splatting specular SMF - SSMF tutorial

Post by jK »

Splatting the _detail_map across the whole map is a really bad idea.
It would be much better if you merged it into behe's algo.
Also you shouldn't blend the normalmap, instead you should multiply-add (and use the alpha as multiply-scale) and renormalize it, so the ground normal isn't lost.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: All about splatting specular SMF - SSMF tutorial

Post by Kloot »

Read before you comment, nothing gets lost:

Code: Select all

// blend between original and rotated TS detail normal
normal = normalize((groundN * (1 - a)) + ((TBN * detailN) * a))
It's done with a non-tiling TS normal texture since those are much easier to generate, but I'll add the repeat-distribute variant as well.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: All about splatting specular SMF - SSMF tutorial

Post by Beherith »

Nice stuff kloot, I think I'll give it a whirl. 1k by 1k should nearly match terrain anyway, and not give too much of a file size increase. My current SSMF additions usually result in 5 megs extra sd7 size.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: All about splatting specular SMF - SSMF tutorial

Post by jK »

Kloot wrote:Read before you comment, nothing gets lost:

Code: Select all

// blend between original and rotated TS detail normal
normal = normalize((groundN * (1 - a)) + ((TBN * detailN) * a))
I read it very well and the ground normal is lost with alpha = 1.
The standard approach for merging normals is this:

Code: Select all

normal = normalize(normal1 + normal2 * a);
PS: there is also a blend function in GLSL.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: All about splatting specular SMF - SSMF tutorial

Post by Forboding Angel »

What setting controls the aggressiveness of the splatting?

I'd like to be able to avoid this: Image

NM, found it. Splattex alpha channel.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: All about splatting specular SMF - SSMF tutorial

Post by jK »

erm no?

there are 4 splattex channels (RGBA) and each channel controls a separate splattex.
So you have 2 textures: one with 4 separate channels for the distribution (:= `aggressiveness`) and one detailtex with 4 separate detailmaps (each channel = one intensity-only detailmap).

So the `aggressiveness` is controlled via EACH channel. So if you want to reduce the effect of splattexB then you reduce the value in channelB.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: All about splatting specular SMF - SSMF tutorial

Post by Beherith »

You can reduce the aggressiveness by making the channel closer to 0.5. But there is a method built in for this, its called:
SplatTexMults
Specifies the intensity a texture will be overlayed with. Values of 0 means that the corresponding textures wont be painted at all. Defaults to 1 1 1 1.

Code: Select all

[SPLATS] {
    SplatTexScales =0.006 .006 0.006 0.006;
    SplatTexMults = 0.3 .3 0.2 0.5;
  }
Post Reply

Return to “Map Tutorials & Resources”