Planetside Software Forums

General => Terragen Discussion => Topic started by: TheBadger on January 08, 2014, 09:20:44 PM

Title: Simple shape
Post by: TheBadger on January 08, 2014, 09:20:44 PM
Hi

This is another question on a topic I have been posting about.
This is the last question on this subject from me, and then Ill shut up about it.

I have some files that Ulco and Kadri created for me to play with. And let me just say HOLLY CRAP! They are interesting! And actually I can do some pretty cool things with them. They are two very different takes at thinking on the same subject. Which in its self is really fun to see. And in both cases I wish I thought of it my self :(

Still I would like to ask about the Simple Shape Shader. It really vexes me! (I like that word ;D)

I cant for the life of me understand why there is no way whats so ever to move the Simple shape shader on its axis. Nothing can be connected to it that will add the control not even the planet from which it originates... Which I find to be the strangest part.

If the center of a simple shape is the planet and the simple shape node(s) are directly attached to the planet node, why when the plant is moved on its axis does the simple shape stay put? Because if the simple shape is affecting the planets terrain, and then the planet is moved does the terrain then stay put? Its very confusing!

And hypothetically, if it could be possible to move the Simple shape on its axis, would that control be added to the simple shape, or the planet the simple shape node is attached to?

VEXES ME!  :o :'(
http://www.youtube.com/watch?v=0t2pWUWE1Y8
Title: Re: Simple shape
Post by: Dune on January 09, 2014, 02:47:17 AM
I guess the SSS is just a horizontal XZ based thing, I've tried to get it rotated to no avail, but I guess PS can do that in future (hint hint). Instead of an SSS you could try a white square/circle (have to make one, how hard can it be in PS), and project that vertically.
Title: Re: Simple shape
Post by: Kadri on January 09, 2014, 06:37:12 AM

I think we are thinking more like an object about the SSS shader.
It is more a shape that is affecting the planet it is attached to basically.
Changing the axis would be the same as warping-transforming the shape basically.
And they could probably add something like that but if you want to change the shape of the ground it is attached to you can make all what you want anyway.
So we should not see it is an object.
At least that is how i think about that node .

Try it on the equator and you will see what i mean.

Title: Re: Simple shape
Post by: dandelO on January 09, 2014, 09:07:48 AM
I'm pretty sure I rotated a Simple Shape Shader with a Transform Shader. Use 'position in texture' in the Shape. There's a thread here somewhere called 'Eye Test', I did it there to mask the iris/pupil of the eyeball.
Title: Re: Simple shape
Post by: Kadri on January 09, 2014, 10:03:24 AM

We need you , come back Martin :)
Title: Re: Simple shape
Post by: j meyer on January 09, 2014, 11:04:26 AM
I agree with Martin,I also think I've rotated simple shape shaders with
a transform shader before.

As for the "if the center of the simple shape is the planet" thing:the planet
is an object,too,and is within a coordinate system like anything else.So,if
you move the planet,it moves through the coordinate system,which means
the planets position changes.And that's why you have to move/transform
simple shapes and textures along with it.
That's how I see it at least.
Title: Re: Simple shape
Post by: Kadri on January 09, 2014, 11:34:39 AM

http://planetside.co.uk/wiki/index.php?title=Simple_Shape_Shader

"Rotation: This param sets the rotation of the shape around its centre. You can only rotate the array around the Y (upright) axis. "

I am not sure if we understand us here.
You don't have to rotate the axis of the shader actually.
By changing where it is on the planet you already get different effects like it is rotated.
Hard to say what i mean other then what i already wrote.

Title: Re: Simple shape
Post by: TheBadger on January 09, 2014, 12:37:25 PM
@ Kadri and Ulco

May I post the files you guys gave me. I think that they are clever and would be interesting to people. (or you guys post them). I just think that its so interesting they are both such different and viable solutions to the same problem. Maybe more people looking at them would create more ways of thinking on this?

@ DandelO
I did indeed try a Transform Shader in concert with the simple shape node. But not like you just described. Basically I hooked it in and swore at it. Ill try again now that someone has said it can work. I did not when I tried it, "Use 'position in texture' in the Shape". Ill take a better look at it.
Title: Re: Simple shape
Post by: Oshyan on January 09, 2014, 12:59:13 PM
I believe Kadri and j meyer are correct, do not think of it as an object and remember that objects can be moved through world space, the textures stay where they are unless you move (translate) them too. Some shaders/objects have the option to translate shaders with them, but this is just a convenience and won't necessarily be added in every situation where it might be an issue.

- Oshyan
Title: Re: Simple shape
Post by: Kadri on January 09, 2014, 01:06:41 PM

No problem Michael but there is nothing clever and new about what i made.
It is only a basic mask for the clouds .
Title: Re: Simple shape
Post by: TheBadger on January 09, 2014, 02:40:20 PM
QuoteYou don't have to rotate the axis of the shader actually.
By changing where it is on the planet you already get different effects like it is rotated

Quotethe textures stay where they are unless you move (translate) them too. Some shaders/objects have the option to translate shaders with them, but this is just a convenience and won't necessarily be added in every situation where it might be an issue.

Quotewhich means
the planets position changes.And that's why you have to move/transform
simple shapes and textures along with it.

AHHHH! You guys mean that my only problem is I did not understand/remember to tell the simple shape that the planet has moved, and thats the only reason i could not move the simple shape. Or to put it more directly, if I rotate the planet, I must tell the simple shape that the planet has moved, and thus I gain the ability to rotate the simple shape, by the planet's axis? Yes?

If so, I feel like an idiot! Did I just get this through my thick scull?!

@Kadri, I think its pretty cool. its a pretty easy way to make a spiral galaxy. renders in a bout 5 seconds! I wanted to do a spiral galaxy animation for a while. I will wait to share your file until thats done since it will make more sense in a thread topic like that... that is unless what I wrote above is wrong. 

Title: Re: Simple shape
Post by: TheBadger on January 09, 2014, 11:38:23 PM
Ok, got it. Its more complex in terms of the number of nodes, not just simply adding a transform. But the control is there now. And the planet does not need to be turned. Although that sounds like another way that would work. But with Orge's tree. The one transform node can control the ring by its self.

DandelO, is the tree in Ogre's last post in image sharing the same as what you did for the eye? I saw you posted  a text, but it looked like it was on another part of the scene. Just curious.

Oh, man. Now when this if finished no one will think much of it because I made it so hard, it won't look like it was worth it! Well I still feel a sense of accomplishment! It was hard work getting you guys to tell me the answer ;) No but really, I do feel like I just came out of the darkness or something. So thanks all.

May the force be with you.
Title: Re: Simple shape
Post by: TheBadger on January 10, 2014, 09:08:06 PM
Ok, so ticking the translate texture with planet is very effective too.  8)

Its funny, now that I see a working setup, there are actually lots of ways to manipulate everything and get little different effects. Different kinds of stretching and distortion, so on.

Good for me to know!
Title: Re: Simple shape
Post by: TheBadger on January 11, 2014, 06:54:41 PM
Guess my eyes have not fully adjusted to the light.

I am able to get tilt! And that is really great! See:
[attach=1]
I was even able to make the ring the same size I needed, simply by checking move texture with planet and growing the invisible planet by the slider.

But, no matter which way I try it, I cant get the cloud ring to center. It will only ever sit above the planet. See:
[attach=2]

Here is the node tree:
[attach=3]

I could post my TGD but I think that would make it harder to tell me what I have done wrong because of the changes I made. An un-messed with node tree is in the post by Ogre, P.5 2nd to last post by him:
http://www.planetside.co.uk/forums/index.php/topic,8989.60.html

What on earth have I done wrong now? And no, simply moving the Simple shape to the center like everything else is not the fix (at least its not so far) The problem seems to be in the cloud node? But my changes make the ring disappear, not move.

???
Title: Re: Simple shape
Post by: Kadri on January 11, 2014, 07:13:00 PM

Wrong planet attached (if you have more then one planet it can get messy) or options clicking etc?
Cloud-Atmosphere disconnected from the planet (there was (is ?) a bug) ?

Just guessing...
Title: Re: Simple shape
Post by: TheBadger on January 11, 2014, 07:22:53 PM
Its interesting.
If I enlarge the ring, by checking move textures with planet, in the invisible planet. The ring will eventually be in the middle of the connected planet. If you look at it going by where the planets bonding box is. But its just an illusion or something. Nothing really changes in the render. except size, position stays the same.

A bug, Kadri? It may be. My first thought was I broke the tree somehow when I was playing around.
Title: Re: Simple shape
Post by: Kadri on January 11, 2014, 07:34:52 PM

Change the order of the atmosphere +cloud ring node tree then change it to the original ones more.
The unattached atmosphere will be in it's normal position ones again after this.
If the problem is this of course .
This bug might be fixed by now maybe.

Without seeing the file i can not say much more !
Title: Re: Simple shape
Post by: TheBadger on January 12, 2014, 02:01:31 AM
It works, thanks Kadri.
[attach=1]

The problem was in the altitude constraints of the surface layer. I had thought to try here too. But when I played with it I got a cloud in a perfect sphere. And that made me think that indeed the problem was here. But when I tried to adjust it my clouds just disappeared, and I gave up on that as the source of the problem.

Kadri, how did you figure the correct number value? I really don't know. And I don't think I would have ever found it. YOu must have made a calculation bases on some other parameter, but what?? Or you guessed? Heck of a guess, -5 million and -7 million, in meters no less.

I have some tweaking to do as you can see from the image, lots really. But the mechanics of the scene are all working now!

Thanks!
Title: Re: Simple shape
Post by: jo on January 12, 2014, 04:07:43 AM
Hi Michael,

I would say he used the radius of the earth in metres (6,378,100) as the basis. 5-7 million spans that. It's negative to offset things from the origin to the centre of the planet i.e. from the top to the middle of the planet. That's my guess anyway :-).

Regards,

Jo
Title: Re: Simple shape
Post by: Dune on January 12, 2014, 04:44:44 AM
Do you still have the same problem as I had in the distance shader+cam setup I made for you? The problem that the clouds are only visible in front of the 'invisible' planet, I mean. I noticed it then, and I can see something like that happening in your last image.
Title: Re: Simple shape
Post by: Kadri on January 12, 2014, 11:29:38 AM

It is not so hard as it sounds.
By unchecking the lower limit it was clear that the problem was there.
The number looked small as Jo said, so i basically put one zero then one more zero and the ring was nearly where it should be.
After that you only adjust the upper limit to the lower one.

The worst thing to do is changing more then 1 option at a time.
And by the nature of TG3 don't hesitate to put big numbers in any place.
By exaggerating you can see where the problem is and adjust it faster afterwards.
Title: Re: Simple shape
Post by: TheBadger on January 12, 2014, 07:34:45 PM
Thanks Jo and Kadri.

Ulco,
It is an interesting problem. In the image above I simply ticked the "translate textures with planet" parameter in the planets main node window. And then increased the size of the planet until the ring was the size I wanted. This is the simplest fastest way I saw of making the radius of the ring bigger. But you see it has some problems.

Here is a render of the ring at the default size of Ogre's node tree. Kadri rendered this as a test, the cloud is visible in this shot except for where the planets shadow should be, I think. But when enlarged the way I said, that shadow grows unrealistically.
[attach=1]

I am going to have to return the invisible planet to its regular size, and enlarge the ring the hard way (all setting individually) to see if the problem is fixed.

The file you gave me is a different situation I was guessing. Wasn't where the ring apeared dependent on the camera, and the cameras field of view?

Going to work on it tonight, as soon as its quite around here. My kids are on some kind of rampage or something right now.

Title: Re: Simple shape
Post by: TheBadger on January 12, 2014, 09:39:20 PM
see. The invisible planet at default scale.
[attach=1]

Anyone care to define this?
Title: Re: Simple shape
Post by: TheBadger on January 12, 2014, 11:26:40 PM
K, It works completely perfectly.

[attach=1]

Cloud depth needs to be increased in relation to the size of increase to the Simple Shape shader. However it is not a 1:1 ratio.

The result will be that the missing spots fill in. But you will get a "O" that is really fat at the sides and narrow at the top and bottom. So I had to add a second simple shape and "merge shader". And then mess with the blending "inverts" of other nodes.

Now I get to do the fun stuff! Make the clouds look the way I want them to.

I did render a test from the surface of the planet of the cloud ring in the sky, its a rather pretty effect.


K, now I think I really am out of the darkness this time.   ;)
Title: Re: Simple shape
Post by: Dune on January 13, 2014, 02:49:47 AM
Looking good so far, Michael. Problems are there to solve, and I'm glad you get where you want. And, yes, I meant the cam setup. I wonder though, how high your cloud needs to be on this galactic scale, and high good the quality needs be and thus render time will be....
Title: Re: Simple shape
Post by: TheBadger on January 15, 2014, 12:27:02 AM
Hi,

I have run into yet another strange issue.

I have the cloud ring and the rock ring. Both are perfect Circles when at 0,0,0. However, when I give them the tilt we have been talking about, the rock Circle becomes an oval. The settings in the Simple shapes are identical.
[attach=1]

I have been having some problem pin pointing the parameter that effects this because of some crashes. Does anyone reconize this problem? I need both to be a Circle or an oval. Don't really care which.


@Ulco,
As it is now it adds a good bit to the render time to the time without the cloud ring. But the cloud is super big and thick. And Im just leaving it that way because its really easy to see while I work on everything. Ill change it a lot before its done and render time should be better then too.
Although, just the blue cloud ring in the sky is kinda cool from the ground.

It does need to be as big a radius and distance from the planet that it is too. I don't think faking it would have the same look.
Title: Re: Simple shape
Post by: Dune on January 15, 2014, 02:53:34 AM
Are you sure they're in the same plane?
Title: Re: Simple shape
Post by: TheBadger on January 15, 2014, 03:12:07 AM
Meaning?
Title: Re: Simple shape
Post by: Dune on January 15, 2014, 03:30:51 AM
Well, if the rocks are seen on an angle different than the cloud it would look like an oval, if the view is not perpendicular.

Or maybe your SSS is not a circle, by accident?
Title: Re: Simple shape
Post by: TheBadger on January 15, 2014, 04:16:14 AM
Thats the thing, Dune. They are perfect when they are at 0,0,0. But when I add the tilt and rotation (-15,0,20) Then the rock circle deforms to an oval, but there is no issue with the clouds.

I just checked and rechecked. Only the edge width of some of the SSS where different. But I fixed that and there was still no improvement.

If its normal for the deformation to occur under these circumstances, than why does the cloud circle maintain a perfect form?
There is no difference between the sss in the clouds and in the rocks. I copied the rock sss to use on the clouds.

The only thing I can think of is that I have a fuzzy zone some place. But that does not explain why an oval, only why the rocks can seed outside of the sss boundary.

I hope being vexed is not bad for you kidneys or something. Because Im vexed again.

On a good note I have not had one single crash all night, which I don't understand at all. Last night I could not work for ten min, and tonight no problems. I have no explanation. Vexed I say!
Title: Re: Simple shape
Post by: jo on January 15, 2014, 04:20:24 AM
Hi,

I think what is happening is that the simple shape shaders used to control the population of the rocks are not rotated to match the plane of the population when the population is rotated. This means the simple shape shaders are being projected along the Y axis onto the plane of the populator which results in an elliptical shape. FYI, if you cut a cylinder right across with a plane at an angle you will get an ellipse. I suspect this would work if you put a transform shader with the same rotation as the population between the simple shape shaders and the populator , but I'm not 100% sure.

Regards,

Jo
Title: Re: Simple shape
Post by: TheBadger on January 15, 2014, 04:24:25 AM
That sounds good. should is matter where between the two, there are a few other nodes there? I will play with it. Thank you for the tip jo!

Title: Re: Simple shape
Post by: jo on January 15, 2014, 04:24:47 AM
Hi Michael,

I've just tried my suggestion and it seems to work. I put the Transform input shader between the colour adjust shader and the density shader input of the population.

No problems with your project so far, and it's been open a fair while now. Vexing!

Regards,

Jo
Title: Re: Simple shape
Post by: jo on January 15, 2014, 04:30:37 AM
I should also point out that the simple shape shader preview for the shape (orange dotted line) is not effected by transform shaders. It will always be drawn in the X/Z plane.

Regards,

Jo
Title: Re: Simple shape
Post by: TheBadger on January 15, 2014, 04:32:50 AM
Jo,

Im sorry man. I don't know what the deal is. I have had no problems tonight, none, not one crash, and not one crazy screen thing. Maybe my system was over heating or it was too moist in here. I just don't know. Perhaps one of my components is going bad, and TG just stresses it more than my other soft?
If your having no problems, and its not happening to me tonight, than I think I wasted your time. If so, I would be sorry for that.

Thanks a lot though for the info in your last posts though! You guys are serious people.

" the simple shape shader preview for the shape (orange dotted line) is not effected by transform shaders. It will always be drawn in the X/Z plane."

Yeah, at least I understood that one from the start. Thank goodness ;)
Title: Re: Simple shape
Post by: TheBadger on January 15, 2014, 04:55:04 AM
Quote from: jo on January 15, 2014, 04:24:47 AM
Hi Michael,

I've just tried my suggestion and it seems to work. I put the Transform input shader between the colour adjust shader and the density shader input of the population.

No problems with your project so far, and it's been open a fair while now. Vexing!

Regards,

Jo

Yep! It works perfect. Thank you, thank you.  :)

The bad news is I maybe would have thought of this in a few more days, maybe never. The good news is this thread will serve as a good tut to go along with the ring threads in file sharing for new users in the future. So thats nice too.

Cheers Jo!