North Face (Updated 22 May 07)

Started by Harvey Birdman, May 17, 2007, 04:34:12 PM

Previous topic - Next topic

Harvey Birdman

-

Harvey Birdman

#1
-

bigben

#2
Hi Harvey

Had a quick look at this and it's definitely a lot easier to use. There appears to be a slight problem with the shading though.

The attached image uses a black and white level of 0 and 1 respectively, so it should be shaded from white to nothing (underlying grey). Instead, it appears that there is a sharp cut off half way between the black and white levels.  I'll have a closer look on the weekend while I'm brushing up my maths for animating populations linked to camera position/orientation... icky geometry  ;)  At least the angles are working correctly, so you're pretty close.

Harvey Birdman

#3
It probably has to do with checking/unchecking the clamp white/clamp black boxes in the color adjust node at the output. Also note that altitude and slope constraints are added at the next step (same as you did it, I just don't include the final distribution shader in the face mask).

<edit>

Also note that the effect of the black level and white level is much more pronounced, since it affects the whole 360 degree circle, instead of just one quadrant.

</edit>

Harvey Birdman

#4
-

bigben

I was thinking along similar lines but using a circular gradient image with a curves adjustment (or just an increase in gamma) as a displacement function.  It's very hard to judge the effect of the edge of the mask on a normal terrain.  Got a bit side tracked so I haven't had a close look at your setup yet.

I fixed a problem with mine, but it's worth persisting with this as it makes selecting the angle of the face possible. Mine is more simplified, with only 4 direction options... and I exclude flat surfaces. If you're going to include flat surfaces it may help to leave them out until the end so that you can exactly see which parts of the terrain the functions are actually including.

Harvey Birdman

#6
-

bigben

Most of my population masking is going to be linked to the camera for animations so the math will be a little easier in that it will involve calculating the angle between two coordinates. One will be an fov mask, similar to the mask generated by a through camera mask, but extending back to the camera position (and a wee bit wider than the camera's fov).  I've used an image map successfuly for this but it doesn't allow for changing fov. 

The circular masks I use are derived from camera distance (both spherical and non-spherical) but I'm sure people will find a use for a similar mask that they can place around a specific object (as one example) without having to add another camera.

You can nest conditional nodes nodes...  something like this: http://forums.planetside.co.uk/index.php?topic=1493.msg15004#msg15004 

Harvey Birdman

#8
-

bigben

#9
Hi Harvey

It's getting close.  I ran a few tests on my "bump" map (included in the zip from my current version).  The face range works really nicely. I think you'll find TG works with radians rather than degrees. All you need is to divide the input by 2Pi. I added this in but there still seems to be a small error in there. Try using face range settings of black = 0.499 and white = 0.5, and check out the results for 0,90,180 and 270°.   Below are the first few images I tested (default face range).

bigben

#10
Hi Harvey

I just fixed another glitch that we both had regarding flat surfaces.  It didn't make sense that my mask was showing flat surfaces, even though they were apparently in the correct direction.  This was because my reference "bump" was placed at the origin.

When the surfaces are flat the Y vector = 1 (and X,Z = 0) and the resulting colour of the mask is the angular vector of the position from the origin, not the vector of the normal in the XZ plane.

I added a condition setting the scalar to 0 if Y = 1 which fixed this in mine.  If you move the bump away from the origin with you setup you get the same thing.

Harvey Birdman

Re flat surface - that's just how I check. I don't check for Y = 1, but I check sqrt(x^2 + Z^2) ; when that equals zero it's flat.

Re rads - crap. Figures. I really need to get some test terrain going before I muck with it more. How did you do yours?

bigben

You can use mine.

http://forums.planetside.co.uk/index.php?action=dlattach;topic=1520.0;attach=4122.

It's just a small image map (radial fill with curves adjustment) fed into the function of a displacement shader.

Harvey Birdman

Cool - thanks. I'll play with this for a bit and see if I can debug it.

Harvey Birdman

#14
-