Planetside Software Forums

General => File Sharing => Topic started by: Harvey Birdman on May 17, 2007, 04:34:12 pm

Title: North Face (Updated 22 May 07)
Post by: Harvey Birdman on May 17, 2007, 04:34:12 pm
-
Title: Re: North Face - V3
Post by: Harvey Birdman on May 17, 2007, 08:41:13 pm
-
Title: Re: North Face
Post by: bigben on May 17, 2007, 10:25:11 pm
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.
Title: Re: North Face
Post by: Harvey Birdman on May 17, 2007, 10:37:31 pm
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>
Title: Re: North Face
Post by: Harvey Birdman on May 18, 2007, 09:40:13 am
-
Title: Re: North Face
Post by: bigben on May 20, 2007, 10:01:20 am
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.
Title: Re: North Face
Post by: Harvey Birdman on May 20, 2007, 03:59:26 pm
-
Title: Re: North Face
Post by: bigben on May 20, 2007, 04:56:23 pm
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 (http://forums.planetside.co.uk/index.php?topic=1493.msg15004#msg15004) 
Title: Re: North Face
Post by: Harvey Birdman on May 20, 2007, 05:56:08 pm
-
Title: Re: North Face
Post by: bigben on May 20, 2007, 07:33:29 pm
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).
Title: Re: North Face
Post by: bigben on May 20, 2007, 08:21:48 pm
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.
Title: Re: North Face
Post by: Harvey Birdman on May 20, 2007, 08:27:57 pm
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?
Title: Re: North Face
Post by: bigben on May 20, 2007, 08:42:11 pm
You can use mine.

http://forums.planetside.co.uk/index.php?action=dlattach;topic=1520.0;attach=4122 (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.
Title: Re: North Face
Post by: Harvey Birdman on May 20, 2007, 08:49:06 pm
Cool - thanks. I'll play with this for a bit and see if I can debug it.
Title: Re: North Face
Post by: Harvey Birdman on May 20, 2007, 11:03:41 pm
-
Title: Re: North Face
Post by: moodflow on May 21, 2007, 07:47:04 pm
Wholly friggin function nodes, Birdman!

Nice work!    8)
Title: Re: North Face
Post by: bigben on May 21, 2007, 10:07:26 pm
Looks like you've got it  ;D

It would be nice if the colour adjust had inputs for the black and white points. You could then set up more useable inputs for the width of the mask.

From a usability point, in the absence of "macros", you might want to produce a simplified layout with three rows.... input, processing and output (but keep the other version for reference). This combined with grouping seems to be a reasonably functional interim. The full node layout is only really needed for redesigning... and of course people can do it for themselves  ;)

[attachimg=#1]
Title: Re: North Face
Post by: Harvey Birdman on May 21, 2007, 11:02:42 pm
Happy to be of service.

;D

BB - Oh, that's nice! (I'd keep the 'Flat Terrain Value' pulled out into the input row, though.) I was wondering how to make the layout a little less of a hog in the node view. Macros would be sweet; I'd even settle for the ability to minimize a group.  :)

Another final modification would be to change 'Direction Input' to 'Direction Control'.

<shameless plug>
And I must mention that these services are available to hire on a contract basis. If any of you have an idea for a cool shader but don't know how to implement it drop me a line. I can't promise I'd know how either, but I'd be willing to take a look at the problem. (I'm a bit of a rookie with the program, I'm afraid, but a little applied mathematics can go a long way.)
</shameless plug>

;) ;D
Title: Re: North Face
Post by: bigben on May 21, 2007, 11:39:55 pm
Quote from: Harvey Birdman on May 21, 2007, 11:02:42 pm
<shameless plug>
And I must mention that these services are available to hire on a contract basis. If any of you have an idea for a cool shader but don't know how to implement it drop me a line. ...</shameless plug>



Do you have a bird image we can use as a mask on a search light?  ;) 
Title: Re: North Face
Post by: Harvey Birdman on May 21, 2007, 11:49:37 pm
  ;D ;D

There you go. Let's see; a dodo? No, that was flightless...

<edit>

Still, the profile is probably about right...

</edit>

:)
Title: Re: North Face
Post by: bigben on May 22, 2007, 07:20:36 pm
Well I'm working on a functional fov mask for animations... if I run into trouble I'll light the beacon

PS. You might want to add the final version of the file to the first post in this thread.
[attachimg=#1]


Title: Re: North Face
Post by: Harvey Birdman on May 22, 2007, 09:07:07 pm
 ;D ;D ;D

That's pretty good! Seriously, I just posted a private message for you with my email address. Drop me a line.
Title: Re: North Face
Post by: Matt on May 30, 2007, 11:01:27 pm
Quote from: Harvey Birdman on May 20, 2007, 03:59:26 pm
Hey, this reminds me - if any Planetside people read this... doing this bit of function node programming makes the lack of boolean operators and constants painfully apparent. A boolean conditional node would be handy, too - have it switch a scalar output between two scalar inputs, dependent on the condition of a third boolean input.


I don't know if Jo was reading this, but a few days ago he added 3 new Boolean functions: Conditional Boolean scalar, Boolean NOT scalar, and Scalar to Boolean scalar (with an optional threshold input). They'll be in the next update.

Matt
Title: Re: North Face (Updated 22 May 07)
Post by: Harvey Birdman on May 31, 2007, 04:38:35 am
-