Planetside Software Forums

General => Terragen Discussion => Topic started by: JimHT on June 30, 2008, 12:01:41 AM

Title: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 12:01:41 AM
I've got a problem - I don't believe it's worth posting an image, but here is the issue: I have a terrain shaded with layers of Surface shaders (grass, rock, etc.) I have at the bottom of the shader list a Fake Stone Shader. The stones look correct, textured, and everything the way I want them to look, but if I apply a distribution shader to the stones to limit the slope they can rest on, and the altitude they occur at, the grass texture overruns most of the rock surface texture  and most of the stones look like they have the grass growing over them instead of under them. I've turned off the Fractal Breakup in the Distribution shader, and I have the options "Blend by shader" and "Blend as Stone Density" checked in the Fake Stones shader options. The distribution is correct - the stones only lie on shallow slopes and don't reach to the top of the hills, but the texture is ruined. Without the distribution shader, the stones look correct, but they are everywhere.

Any idea what I am doing wrong?

Title: Re: Fake Stone Distribution over Surface Texture
Post by: Seth on June 30, 2008, 01:20:08 AM
did you try with a surface layer instead of a distribution layer ?
Title: Re: Fake Stone Distribution over Surface Texture
Post by: Kevin F on June 30, 2008, 06:37:26 AM
As Seth says, make a new surface layer and make a fake stones shader a child of it. Now you will have full control of height and slope of the stones.
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 10:37:09 AM
Just tried that - with technology preview 4 - same problem. The ground coloration ends up over top of the rock coloration.

[attachthumb=#]
Title: Re: Fake Stone Distribution over Surface Texture
Post by: Kevin F on June 30, 2008, 10:56:09 AM
Quote from: JimHT on June 30, 2008, 12:01:41 AM
.... I have the options "Blend by shader" and "Blend as Stone Density" checked in the Fake Stones shader options.

well it works o.k.for me. (edit - here's a tgd)
so..
what are you blending (ie what's in the bend by shader box?)
and are you still using a distribution shader?
Title: Re: Fake Stone Distribution over Surface Texture
Post by: Matt on June 30, 2008, 11:12:31 AM
Hi Jim,

There are a lot of unknowns here. It would be helpful to see your .tgd to see exactly what's doing what.

Matt
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimB on June 30, 2008, 11:50:30 AM
Could a larger than necessary Fuzzy Zone somewhere be bleeding the green into the stones?
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 01:26:25 PM
Quote from: Matt on June 30, 2008, 11:12:31 AM
Hi Jim,

There are a lot of unknowns here. It would be helpful to see your .tgd to see exactly what's doing what.

Matt


Ok, I'm including a picture here of what I am getting, and what I want it to give me. The second image uses an awful hack that puts the stones on one planet, and the grass on a second planet that has a displacement offset of 1 unit. The stones pop up through the slightly bigger planet, and the two textures don't interfer. I realize this isn't the right way to do it, but it was a work-around I hacked together. I'm including both .tgd files.

[attachthumb=#]

PS. A big thumbs up so far on the TP4 - been bashing away at it this morning with nary a crash in sight.
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 01:34:06 PM
Quote from: Kevin F on June 30, 2008, 10:56:09 AM
Quote from: JimHT on June 30, 2008, 12:01:41 AM
.... I have the options "Blend by shader" and "Blend as Stone Density" checked in the Fake Stones shader options.

well it works o.k.for me. (edit - here's a tgd)
so..
what are you blending (ie what's in the bend by shader box?)
and are you still using a distribution shader?

Your sample file fails to work the moment I turn the slope limits on. Turn that on, and grass texture ends up on top of the stones.
Title: Re: Fake Stone Distribution over Surface Texture
Post by: moodflow on June 30, 2008, 03:25:52 PM
I'll take a quick look.  Hopefully we can figure this out.
Title: Re: Fake Stone Distribution over Surface Texture
Post by: Kevin F on June 30, 2008, 04:48:17 PM
Quote from: JimHT on June 30, 2008, 01:34:06 PM
Quote from: Kevin F on June 30, 2008, 10:56:09 AM
Quote from: JimHT on June 30, 2008, 12:01:41 AM
.... I have the options "Blend by shader" and "Blend as Stone Density" checked in the Fake Stones shader options.

well it works o.k.for me. (edit - here's a tgd)
so..
what are you blending (ie what's in the bend by shader box?)
and are you still using a distribution shader?

Your sample file fails to work the moment I turn the slope limits on. Turn that on, and grass texture ends up on top of the stones.

Yes, I get the same result with slope limits on , BUT only when final normal is selected. With terrain normal selected there's no problem.
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 06:43:41 PM
Quote from: Kevin F on June 30, 2008, 04:48:17 PM
Quote from: JimHT on June 30, 2008, 01:34:06 PM
Quote from: Kevin F on June 30, 2008, 10:56:09 AM
Quote from: JimHT on June 30, 2008, 12:01:41 AM
.... I have the options "Blend by shader" and "Blend as Stone Density" checked in the Fake Stones shader options.

well it works o.k.for me. (edit - here's a tgd)
so..
what are you blending (ie what's in the bend by shader box?)
and are you still using a distribution shader?

Your sample file fails to work the moment I turn the slope limits on. Turn that on, and grass texture ends up on top of the stones.

Yes, I get the same result with slope limits on , BUT only when final normal is selected. With terrain normal selected there's no problem.

That's it! Thank you. :)
Title: Re: Fake Stone Distribution over Surface Texture
Post by: moodflow on June 30, 2008, 06:45:10 PM
Glad you got it figured out  8)
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 07:24:58 PM
Quote from: moodflow on June 30, 2008, 06:45:10 PM
Glad you got it figured out  8)

Darn it, spoke too soon. If there is any fuzzy zone at all in the slope limits, the rocks are "tinted" with the grass color. I'm thinking there is a subtle bug in the slope limits that affects the texturing of the rocks, where it should only affect the density of the rocks.
Title: Re: Fake Stone Distribution over Surface Texture
Post by: Matt on June 30, 2008, 08:04:43 PM
To use "Terrain Normal" instead of "Final Normal" you will need to use a Surface Layer (with the colour set to white, drag the colour slider to 1) instead of a Distribution Shader. When I did this, your stones rendered as expected, without any unwanted green/grey blending.

I intend to add this option to the Distribution Shader in future.

File attached.

Matt
Title: Re: Fake Stone Distribution over Surface Texture
Post by: JimHT on June 30, 2008, 09:29:30 PM
Quote from: Matt on June 30, 2008, 08:04:43 PM
To use "Terrain Normal" instead of "Final Normal" you will need to use a Surface Layer (with the colour set to white, drag the colour slider to 1) instead of a Distribution Shader. When I did this, your stones rendered as expected, without any unwanted green/grey blending.

I intend to add this option to the Distribution Shader in future.

File attached.

Matt


Thank you.  :)  Looks great.

TP4 seems to be running very well here. I've even managed to render out animation frames without having the whole thing blow up 6 or 7 frames in.