Planetside Software Forums

General => Terragen Discussion => Topic started by: PabloMack on February 18, 2013, 12:55:19 PM

Title: Help with a rather modest project.
Post by: PabloMack on February 18, 2013, 12:55:19 PM
Just for the learning purposes, I am trying to do a seemingly simple project to see how it might be done. I have created a new project with the following steps:

1) Delete the Heightfield and shader. (I don't need them)
2) Create a Fractal Terrain and give it more colorful high and low colours. My seed is 36593
3) Add Altocumulus layer to make the sky more interesting (leave at defaults)
4) Create an Image Map Shader and spherically map a 8192 X 4096 image onto it.

Next I want to somehow use this color value to scale the Fractal Terrain's magnitude. I want black to multiply the scale of the terrain by 0 and white to multiply the scale of the terrain by 1. This will make flat plains where the image is black, low mountains where the image is gray and high mountains where the image is white. Next I want to raise the base of this mountain layer with a altitude map using another image map. I already understand how this is done. I just need to know how to use the output of the mountain scaler image map to scale the terrain.

So far, I have tried to use the output of the image map shader in both of the Terrain Node's inputs. Nothing I have done seems to make it do what I have in mind. Just to test the image map shader, I have an image that is all white and another image that is all black. The all black image should scale the terrain to zero and nullify its effect on the surface of the planet. Any help would be appreciated.
Title: Re: Help with a rather modest project.
Post by: cyphyr on February 18, 2013, 02:05:23 PM
Without seeing your tgd it's something of a guess. Your method should work. Check your spherical map centred about the planet centre (default is: 0, -6.378e+006, 0 )
Remember your mountain fractal displaces down as well as up so you need to offset it by half its displacement.
Richard

The file attached shows the method. Just add in your own spherical map. I've exaggerated the terrain displacement values so it's obvious but you can clearly see how mountainous areas are displaced more than the planes.
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 18, 2013, 03:28:17 PM
I am not using a Heightfield. In fact I have deleted the Heightfield Shader and the Height Field Generator to make sure they have no influence on the image. I am trying to vertically scale a global Fractal Terrain by a factor using an image map shader that is spherically mapped with an image. In the diagram the image map shader is relabelled as "Global Terrain Scaler". I have loaded a map into this that is totally black. Because black should generate 0, then the factor multiplied by the global terrain should force it to 0 and the land should be flat around the whole planet. But it is not. It has no effect on the Fractal Terrain. I have avoided using the Heightfield nodes because (I think) they are limited to influencing the effect in the absolute +Y direction instead of a radial direction emanating from the center of the planet. I want this effect to be global, not local.

Update: I duplicated what you did in the node editor. I loaded the image map shader with an image that is totally black and selected Spherical projection type. I have loaded a picture of the image map shader's settings below. The planet is still not flat.
Title: Re: Help with a rather modest project.
Post by: cyphyr on February 18, 2013, 03:39:31 PM
You're plugging your " Global Terrain Shader" into the wrong slot. Try it as a blend shader.
In the sample above I could have deleted the top two nodes, they are not doing anything.
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 18, 2013, 03:55:44 PM
I've tried plugging the output of the "Global Terrain Scaler" into each of the two inputs of the "Fractal terrain" node as well as both inputs simultaneously. No visible difference.
Title: Re: Help with a rather modest project.
Post by: cyphyr on February 18, 2013, 04:06:35 PM
Check your spherical map centred about the planet centre (default is: 0, -6.378e+006, 0 ), yours is centred about 0,0,0.
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 18, 2013, 04:24:12 PM
Okay. Done. Still no change.
Title: Re: Help with a rather modest project.
Post by: cyphyr on February 18, 2013, 04:27:33 PM
Hmm odd, can you upload the tgd and the image you're using as a spherical projection map (at a suitably small res).
This method should be working (unless I'm misunderstanding what your after).
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 18, 2013, 04:41:51 PM
Here they are....
Title: Re: Help with a rather modest project.
Post by: mhaze on February 18, 2013, 05:00:12 PM
You need to tick the blend by shader box
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 18, 2013, 05:55:19 PM
Voila! Mapping in a gray scaler image I get rolling hills!

Thank ya'll for your help.  :)

Next I would like to make sure that the Global Terrain Scaler's output interpolates smoothly between the scaling image's pixels. Looking in the Displacement Tab of the image map shader parameter window, I see that the Apply displacement box is not checked. Should I check it?
Title: Re: Help with a rather modest project.
Post by: Tangled-Universe on February 19, 2013, 03:23:56 AM
Why don't you try it yourself!? ;)

All I can say, without spoonfeeding you, is that the image map shader can indeed apply the displacement for you so that you don't have to connect the image map shader into a displacing shader.
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 19, 2013, 09:56:33 AM
Thank you cyphyr and hmaze for your friendly help.

Quote from: Tangled-Universe on February 19, 2013, 03:23:56 AM
...don't have to connect the image map shader into a displacing shader.

I tried that too.
Title: Re: Help with a rather modest project.
Post by: Tangled-Universe on February 19, 2013, 10:24:03 AM
Quote from: PabloMack on February 19, 2013, 09:56:33 AM
I tried that too.

What is your question? It's not really clear to me what you're trying to achieve or what the problem is you're encountering or both.
The interpolation options are in the image map shader themselves and so is the possibility to have the image map shader apply displacement according to the luminance values of your imported image.

I don't mean to be unfriendly, but as long as its not clear then it's hard to help and questions in the line of "should I or should I not enable that tickbox" are a bit of a waste of time for everyone because you can simply try and see for yourself :)

So again, what would you like to do and what is the problem you can't fix?

Cheers,
Martin
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 20, 2013, 10:34:01 AM
Quote from: Tangled-Universe on February 19, 2013, 10:24:03 AMWhat is your question?...

After my original problem was solved I wanted verification on a question which I will now reword as a proper question: "How do I know that my Global Terrain Scaler's output is interpolated smoothly between the scaling image's pixels?"Ignore the rest of what I wrote in my last post as it just confuses the issue.  Recall that my "Global Terrain Scaler" was implemented using an Image Map Shader.

What I did was to first spend a few minutes rendering with and without the box checked. I couldn't tell a difference. So I unchecked it and I made two special maps with high contrast (black and white). The first map is a checker board and the second map is all black in the southern hemisphere and all white in the northern hemisphere. I probably spent an hour navigating the perspective camera around looking at the surface of the planet trying to see if the edges where the scaler map went from 0 to 1 because of the sudden high contrast of the maps. I decided that the checker board was pretty useless so I concentrated on the map that was upper-white and lower-black. My findings were inconclusive. I didn't find a sharp drop off at the equator where the scaler map suddenly when from 1 to zero. You can't even see the scaler map directly anyway so it is like groping in the dark.

I decided that the image was unaffected by the little check box because that section of the shader's menu panel was not being used for the way I had its node plugged in to the node network and had little understanding for how it worked.

I also did a lot of other stuff that I will not elaborate on here. So, in conclusion, the effects of something as simple sounding as turning a switch on or off is not necessarily as simplistic as seeing that a light is on or off. And the effects of making a change can be so subtle as to be very difficult to even detect. The turn around time to randomly try this and that can be quite time consuming so it is often much faster to just ask an expert how a control in a menu is "supposed" to work. By randomizing controls with add hock exploration I have found that I can totally screw up my settings and never be able to figure out how I destroyed my project and just have to start over from scratch.
Title: Re: Help with a rather modest project.
Post by: cyphyr on February 20, 2013, 10:47:41 AM
A point of note :)

The earth or any other rocky planet we know of is, from a point of view in space flatter than a snooker ball of the same size. The mountains we see towering above us are practically invisible from orbit were it not for their differing surface textures and the angle of the sun hitting them.

I suggest you exaggerate your terrain fractal displacement a LOT so it's at a size you can see easily. Once you are happy with its positioning you can start to dial the displacement back to something more reasonable.

Richard
Title: Re: Help with a rather modest project.
Post by: Tangled-Universe on February 20, 2013, 11:41:09 AM
Quote from: PabloMack on February 20, 2013, 10:34:01 AM
Quote from: Tangled-Universe on February 19, 2013, 10:24:03 AMWhat is your question?...

After my original problem was solved I wanted verification on a question which I will now reword as a proper question: "How do I know that my Global Terrain Scaler's output is interpolated smoothly between the scaling image's pixels?"Ignore the rest of what I wrote in my last post as it just confuses the issue.  Recall that my "Global Terrain Scaler" was implemented using an Image Map Shader.

What I did was to first spend a few minutes rendering with and without the box checked. I couldn't tell a difference. So I unchecked it and I made two special maps with high contrast (black and white). The first map is a checker board and the second map is all black in the southern hemisphere and all white in the northern hemisphere. I probably spent an hour navigating the perspective camera around looking at the surface of the planet trying to see if the edges where the scaler map went from 0 to 1 because of the sudden high contrast of the maps. I decided that the checker board was pretty useless so I concentrated on the map that was upper-white and lower-black. My findings were inconclusive. I didn't find a sharp drop off at the equator where the scaler map suddenly when from 1 to zero. You can't even see the scaler map directly anyway so it is like groping in the dark.

I decided that the image was unaffected by the little check box because that section of the shader's menu panel was not being used for the way I had its node plugged in to the node network and had little understanding for how it worked.

Ok, good, I think I understand now.

Richard replied to this pretty well, especially from an artistic point of view.
I agree with him it's more important to focus on shading of the terrain, rather than the displacement/texture of it.

But, to get back to the displacement issue, since that's your question; What did you try more besides checking/unchecking the "apply displacement" checkbox?
There's a multiplier adjacent to it which tells that a white pixel (colour @ 1) will be displaced by 'x' metres, where 'x' = the multiplier value.
So if you kept it at default then it's no wonder you couldn't see it.
Also don't forget that for spherical projection you need to specify the planet's centre for proper projection of the image on the earth's surface.
Just to make sure/doublecheck  you did that.

Quote from: PabloMack on February 20, 2013, 10:34:01 AM
I also did a lot of other stuff that I will not elaborate on here. So, in conclusion, the effects of something as simple sounding as turning a switch on or off is not necessarily as simplistic as seeing that a light is on or off. And the effects of making a change can be so subtle as to be very difficult to even detect. The turn around time to randomly try this and that can be quite time consuming so it is often much faster to just ask an expert how a control in a menu is "supposed" to work. By randomizing controls with add hock exploration I have found that I can totally screw up my settings and never be able to figure out how I destroyed my project and just have to start over from scratch.

Would you agree with me if I would summarize this part as "I don't want to spend (much) time on exploring options and parameters if I can also ask people how to do it?".
Please forgive me, but this comes accross to me as if you're just being lazy?

You're asking help, because you run into issues, which is fine. But not willing to elaborate on the tons of stuff you also did, which could potentially be part of your issue, makes helping hard and the whole discussion not so transparent.
Do all the stuff you do at one thing at a time. Take it slow and do not try to do tons of stuff of which you can't tell what it does or how they may affect each other.
It's also really impossible for us to help you then.

The randomizing and ad hoc exploration parts translates to me as "I don't know what I'm doing so I just push and pull every setting and if it doesn't work I'm going to say on the forums that it all doesn't make sense".
This is also fine, as long as you push and pull one parameter at a time and not multiple in a random / ad hoc fashion.
No wonder you don't understand what's happening if you don't keep track of your experimentation :)

If you want to learn this, then be systematic and especially dedicated instead of lazy ;)
All the so called experts here, as you name them, are all very keen on helping here, but not on spoonfeeding or feeding someone's lazyness.
I'm at least speaking for myself here, of course.

So start from (semi-)scratch and build up your scene step by step using the pre-defined terrain->shader->planet workflow, post your results here and ask for directions on specific issues in unambiguous specific questions.
This way we can help you best and you'll learn faster and understand better.

Don't get me wrong here, but I'm mostly saying this because I see some history repeat itself here ;)
Title: Re: Help with a rather modest project.
Post by: zaxxon on February 20, 2013, 01:55:09 PM
TU raises an interesting observation about how one goes about learning T2 and what part the community can play in assisting understanding. Not to hijaak this thread, but the issue is how best to learn the program, and how to best utilize the expertise of the Professors and Wizards who are here, willing to assist. About a year ago there was a thread that explored some ideas (methodologies) of how to approach the challenge:

http://www.planetside.co.uk/forums/index.php/topic,13776.msg135640.html#msg135640

We all learn differently, looking forward to seeing how your work turns out.
Title: Re: Help with a rather modest project.
Post by: PabloMack on February 22, 2013, 12:18:02 AM

I created an animation of a scene that is the result of the modest project for which I started this thread (if anyone is interested). Of course there are no shadows to speak of but it seems to be smooth as silk. The scale of the mountains are controlled with a global map as are the densities of the clouds.

http://youtu.be/6vrCtVZM6gg