Planetside Software Forums

General => Terragen Discussion => Topic started by: Dune on December 21, 2019, 08:19:00 AM

Title: snow against side of, say trees
Post by: Dune on December 21, 2019, 08:19:00 AM
Nice challenge for you guys and girls. I've tried a lot f things, like rotation of slope, camera projection, and get normal and such, but I can't get a decent mask on one side of an object.
Like so:
Title: Re: snow against side of, say trees
Post by: Hannes on December 21, 2019, 08:46:11 AM
I guess, in this thread:
https://planetside.co.uk/forums/index.php/topic,17370.msg168424.html#msg168424
you could maybe find some solution?
Title: Re: snow against side of, say trees
Post by: WAS on December 21, 2019, 09:28:47 AM
Yeah I was just about to say, the NSWE masks would probably be the best bet. I'd imagine the tricky part is blending this with your terrain/snow.

https://planetside.co.uk/forums/index.php/topic,25781.msg255686.html#msg255686 (To save you some setup)
Title: Re: snow against side of, say trees
Post by: Dune on December 21, 2019, 10:15:42 AM
Thanks guys. I had forgotten about that thread (even found my own solution there, back then). But I now see what I probably did wrong; I think the get normal needs a compute terrain, and I often delete that. Have to check!
Title: Re: snow against side of, say trees
Post by: Dune on December 21, 2019, 10:47:17 AM
Works without plugging in a compute terrain, but I can't seem to rotate Y, even when using a get normal in texture. Or rotating vector first, but maybe it needs to build a vector first from something. Well, experimentation is always nice....
Title: Re: snow against side of, say trees
Post by: Hetzen on December 22, 2019, 12:04:05 PM
Here's a mask that works with degrees to set the angle on a XZ projection. It uses a sine curve wrapped around 360 degrees, the peak is the angle you set, the black and white points can be adjusted to tailor the tightness of the mask.

XZ Angle Mask.jpg
Title: Re: snow against side of, say trees
Post by: WAS on December 22, 2019, 01:20:38 PM
Quote from: Hetzen on December 22, 2019, 12:04:05 PMHere's a mask that works with degrees to set the angle on a XZ projection. It uses a sine curve wrapped around 360 degrees, the peak is the angle you set, the black and white points can be adjusted to tailor the tightness of the mask.

XZ Angle Mask.jpg

Wow, great share Hetzen. That single handily solves the blending issues I was having without even changing anything.

I'm trying to imagine what else this could be helpful for.
Title: Re: snow against side of, say trees
Post by: Dune on December 23, 2019, 02:29:44 AM
Thanks, Jon. But I am not entirely convinced. There are some strange hard edges and soft areas with certain angles.
Title: Re: snow against side of, say trees
Post by: Dune on December 23, 2019, 02:33:42 AM
So I've made another setup. Very simple, but works.

The only thing I'd like to know (and I remember having mentioned this way earlier); would it be possible to get an angle mask over larger areas, kind of smoothing terrain first? Then you'd really get the North slope of a mountain and not all tiny 'North slopes'.
Title: Re: snow against side of, say trees
Post by: Hetzen on December 23, 2019, 06:05:42 AM
Quote from: Dune on December 23, 2019, 02:29:44 AMThanks, Jon. But I am not entirely convinced. There are some strange hard edges and soft areas with certain angles.

Not sure what's going on. The only thing I can think of, are rounding errors when the surface is flat. The mask on the cone is correct.
Title: Re: snow against side of, say trees
Post by: Hetzen on December 23, 2019, 06:11:57 AM
Quote from: Dune on December 23, 2019, 02:33:42 AMSo I've made another setup. Very simple, but works.

The only thing I'd like to know (and I remember having mentioned this way earlier); would it be possible to get an angle mask over larger areas, kind of smoothing terrain first? Then you'd really get the North slope of a mountain and not all tiny 'North slopes'.

That works. I think smoothing a terrain would be the way to go.
Title: Re: snow against side of, say trees
Post by: Dune on December 23, 2019, 07:07:23 AM
You're right, cone works. I'll experiment a bit with smoothed terrain, but I wonder where the get normal gets its information from; last node or compute terrain? Because you'd need a separate line for the smoothed terrain, for the get normal to relate to, not the normal line.
Title: Re: snow against side of, say trees
Post by: Hetzen on December 23, 2019, 07:25:10 AM
The Get Normal samples 3 points at render time to work out which way the facet is facing. You may have to render out a smoothed terrain mask. I don't think the Get Normal will read one terrain to be applied to another.
Title: Re: snow against side of, say trees
Post by: Dune on December 23, 2019, 08:10:48 AM
That's too bad. A 'visualize normal' (from a sideline) may be handy in that case.
Title: Re: snow against side of, say trees
Post by: WAS on December 23, 2019, 11:28:19 AM
I really wish the get normal/get altitude etc nodes worked with compute terrains in their main inputs. Same for contour. It can only contour main final terrain limiting it's uses. TG should be able to handle hidden pipeways of terrains and handle them as if they were a main terrain on a planet somehow.
Title: Re: snow against side of, say trees
Post by: KyL on December 23, 2019, 12:03:15 PM
I second that, and I would love to be able to use it on object as well. Ideally something to get the curvature of the object, which could then be warped and plugged back to mix materials.... No sure you could do that without raytracing though :/
Title: Re: snow against side of, say trees
Post by: Hetzen on December 23, 2019, 12:46:03 PM
Quote from: KyL on December 23, 2019, 12:03:15 PMI second that, and I would love to be able to use it on object as well. Ideally something to get the curvature of the object, which could then be warped and plugged back to mix materials.... No sure you could do that without raytracing though :

You can warp these processes already. The issue was limiting the facing to a general north slope, which we were thinking would need a smoothed version of the terrain. Or are you talking about looking at one model to be applied to another?
Title: Re: snow against side of, say trees
Post by: WAS on December 23, 2019, 12:48:26 PM
Quote from: Hetzen on December 23, 2019, 12:46:03 PM... talking about looking at one model to be applied to another?
I think that's it. Least for me. There is a lot of flexibility cut out with these limitations. Certainly a lot of creativity.
Title: Re: snow against side of, say trees
Post by: Hetzen on December 23, 2019, 01:02:07 PM
True, but there are usually work arounds. I'm wondering if the best way to define a northern slope more accurately would be to animate a light travelling in the arc of the sun from morning to evening. Then render a series of top down views of your landscape, with all other lighting switched off, so you create a black and white mask of where the sun hits the terrain. Then combine say 12 sequential frames of the suns positions, to use as a mask for your snow / planting / weathering areas.
Title: Re: snow against side of, say trees
Post by: WAS on December 23, 2019, 01:16:18 PM
Quote from: Hetzen on December 23, 2019, 01:02:07 PMTrue, but there are usually work arounds. I'm wondering if the best way to define a northern slope more accurately would be to animate a light travelling in the arc of the sun from morning to evening. Then render a series of top down views of your landscape, with all other lighting switched off, so you create a black and white mask of where the sun hits the terrain. Then combine say 12 sequential frames of the suns positions, to use as a mask for your snow / planting / weathering areas.

That's not a bad idea, certainly a unique approach. Perhaps not the most effecient lol.
Title: Re: snow against side of, say trees
Post by: Hetzen on December 23, 2019, 02:35:49 PM
Probably not, maybe just one render of the sun in a position that gives you what you need for that image.
Title: Re: snow against side of, say trees
Post by: Dune on December 24, 2019, 02:16:40 AM
It would be cool to be able to use a sideline with those sun shadows, use the last node to get a greyscale mask and apply to main line. But then you can still only use actual sun angle. Normals would be better. Smoothed normals...
If you need to render a mask first, want render should that be? Ortho, I presume. But that wouldn't get you complete coverage. Normal render would hide areas, where those 'certain-slope' veggies would not grow then.
Title: Re: snow against side of, say trees
Post by: Dune on December 24, 2019, 03:37:44 AM
Something I don't understand. When taking a (smoothed) vector and using one component to color an angle, adding a later(!) Pf still messes up that angle with 'subangles'. Smoothing a basic finely displaced terrain shader also doesn't work with the smoothing shader. At least not in this 5 minute test.
Coloring angles with a visualize normal works, but I couldn't separate the colors to masks.
Anyway, here's something to play with. I have to devote my time to some biggish commissions now, so won't be able to pursue this much.