project displacement and color from 2 maps.

Started by nomand, May 25, 2010, 01:52:30 AM

Previous topic - Next topic

nomand

Coming from a node based programs like Maya and Nuke, I gota say, this is the worse implimentation of node based features and shader system I've seen.

over with the rant, and onto to the issue -
If someone can help me, maybe I'll love terragen again.

issue 1:
I've got an .SGI displacement map of real life elevation data. I also have a color map of the same terrain. I'm getting displacements successfully, projecting through a camera at the center of the planet facing the surface. I use projection to get rid of the flat plane that peeks through the water if I use a heightfield load.
However - I can't manage to project color through the same camera, or project it anywhere so it actually shows up anyway. Using .png, fairly large resolution.

issue 2: now when and if I get that working, I need to have ocean coverage, lake, or ocean shader or another planet intersecting my displacement - doesn't matter, so long it works. I tried separating the displaced terrain using surface layer's altitude modifiers, but after that, there's nothing I can do to apply shaders separately to them.

If you have an idea how to do this, please help :)

Tangled-Universe

Ranting here is fine :) just keep it constructive ;)

So for issue 1:

I presume you're also trying to project the color-maps through the same camera you're using for the elevation map? If so, then it doesn't work because the planet's surface is one-sided.
A better way of setting up displacement AND color-maps is to use the "plan Y" mode in the image map shader.
You don't have a projection camera then anymore and only have to specify the coordinates and size of your maps, which you logically can make them match exactly.

issue 2: you can create a second planet, put it in the exact same position as your main planet, and give it a slightly bigger radius (as much bigger as how deep you want the water to be). Then apply a watershader to this second planet and you have a whole planet covered with water intersecting with your terrain.
If you want to use surfacelayers for this, then you need to merge the displacements with a merge-shader. Choose the mode "highest" and the merger will merge your displacements by choosing the heighest displacements at every point.

Good luck and let us know how you're doing.

Cheers,
Martin

nomand

Thanks TU,

The displacement and color maps project correctly with the PlanY method.
The shader system doesn't really make sense though, with all the unexplained blending shader nodes etc (what does it blend how and what method? wut?), So for now, I'm able to get the diffuse show by plugging the displacement into input of the distribution shader 401, and plugging color into every other node of it, It seem like it's working though colors aren't true to the file. What's the node to use for the true color of just the projection file? Dont want any other fractal breakups or blendings with procedural maps~
thanks!

Tangled-Universe

It really would help if you could post a screenshot of your node-network and/or .tgd-file.
A .tgd-file always works best, but then I'd also need the texture you're using.
Then I can better explain how and when to use the blendshaders and what they're doing and how.
Generally said the blend-input is a mask-channel. You can use a powerfractal/image-map or almost any-kind of function which generates color as an input for the blendshader to use as a mask.

The reason the colours aren't true to the texture is because the atmosphere (hazes) and lighting of your scene affect these colours.

gregsandor

Why are you messing with blender nodes if all you want is to apply the orthophoto to your terrain?  It is very simple to apply a texture to your elevation model, which a simple search in these forums will show you in thirty seconds.

If Maya and Nuke have superior shaders go use them. 

cyphyr

Quote from: nomand on May 26, 2010, 05:51:36 PM
The shader system doesn't really make sense though, with all the unexplained blending shader nodes etc (what does it blend how and what method? wut?), So for now, I'm able to get the diffuse show by plugging the displacement into input of the distribution shader 401, and plugging color into every other node of it, It seem like it's working though colors aren't true to the file. What's the node to use for the true color of just the projection file? Dont want any other fractal breakups or blendings with procedural maps~
thanks!

Remember you are (unless you disable it) viewing your colour maps through, and augmented by, your atmosphere and lighting (and environment light) so your colours will almost always change from your original file.
:)
Richard

www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

nomand

Quote from: Tangled-Universe on May 26, 2010, 06:03:10 PM
Generally said the blend-input is a mask-channel. You can use a powerfractal/image-map or almost any-kind of function which generates color as an input for the blendshader to use as a mask.
TG2 reference, wiki or tutorials don't really explain those things :(

Quote from: gregsandor on May 26, 2010, 06:10:56 PM
Why are you messing with blender nodes if all you want is to apply the orthophoto to your terrain?  It is very simple to apply a texture to your elevation model, which a simple search in these forums will show you in thirty seconds.

I'm messing with them as trial and error because there's almost no documentation on how these parameters behave, and terragen node reference provides only so much information about it's functions. great not.

thanks for your help pointing me to search, maybe you could save yourself 30 seconds posting.

Quote from: gregsandor on May 26, 2010, 06:10:56 PM
If Maya and Nuke have superior shaders go use them. 
the obvious troll is obvious.

Quote from: cyphyr on May 26, 2010, 06:17:39 PM
Remember you are (unless you disable it) viewing your colour maps through, and augmented by, your atmosphere and lighting (and environment light) so your colours will almost always change from your original file.
:)
Richard

Richard, I can see that the colors aren't showing up right in the OpenGL view with atmosphere and true lighting turned off. I will tweak the color map in my own image editor for desired hues and saturation, though I would like TG to display them as they are (atmosphere is then expected to haze it down naturally).
Thanks!

gregsandor

"TG2 reference, wiki or tutorials don't really explain those things :("
There are plenty of posts in the forum explaining them, and in fact many that have already done the trial and error ahead of you.

"thanks for your help pointing me to search,"
The simple questions you've asked have bgeen answered in depth over and over, from your rant it was evident you hadn't searched.

"the obvious troll is obvious."
Alright, who told the kids on 4chan about TG?

"Richard, I can see that the colors aren't showing up right in the OpenGL view with atmosphere and true lighting turned off. I will tweak the color map in my own image editor for desired hues and saturation, though I would like TG to display them as they are (atmosphere is then expected to haze it down naturally).

First the atmosphere will not only "haze it down" it will alter the color and saturation with distance from camera.  Turn off the atmosphere and shadows in the Render node, then render your terrain.  In the image map shader that holds your orthophoto you can adjust the gamma of the image under Colour.  Test that and see if it renders close to your original.

Tangled-Universe

Quote from: nomand on May 26, 2010, 06:30:36 PM
Quote from: Tangled-Universe on May 26, 2010, 06:03:10 PM
Generally said the blend-input is a mask-channel. You can use a powerfractal/image-map or almost any-kind of function which generates color as an input for the blendshader to use as a mask.
TG2 reference, wiki or tutorials don't really explain those things :(

True. That's why I'm trying to explain it to you :)

Looking at your network you don't need the two connections on the right (breakup and blendshader) to have the diffuse map showed correctly.
You'll only need to use the "child layer" port. The distribution shader v4 acts like a parent shader where the diffuse map can exist on.
If you connect the diffuse map to the child layer input of the distribution shader v4 then it will be parented by it.
This way you can also control height and slope of the diffuse map by using the parameters in the distribution shader.
You could also have used a surface-layer, which offers the same functionality basically, but also with some extra inputs.

There's a chance you indeed need to change the gamma setting of your texture to make it match. If you already applied gamma adjustments in, say Photoshop, then TG2 also applies a gamma operation to the image.
As gregsandor explained you can find these settings in the image-map shader.

A nice way of displacing a surface with an imagemap is by feeding the imagemap-shader to the shader-input of a displacement-shader-node (add shader->displacement shader->displacement shader). Then in between those two nodes you can attach a colour adjust shader (add shader -> add colour shader -> colour adjust shader). With the colour adjust you can change contrast and gamma of the imagemap quite easily by changing the black/white-point of the image and/or gamma.

Hope some of this helps you along.

Cheers,
Martin

nomand

Quote from: gregsandor on May 26, 2010, 06:36:43 PM
There are plenty of posts in the forum explaining them, and in fact many that have already done the trial and error ahead of you.
The simple questions you've asked have bgeen answered in depth over and over, from your rant it was evident you hadn't searched.
So it's the matter of principle for you to not simply help, but make me search through posts and posts of irrelevant content to find that one post on the bottom which unswers my query. Thankyouverymuch.

QuoteAlright, who told the kids on 4chan about TG?
You may be one of them! don't deny it :D. This 'kid from 4chan' is a CG artist, working in a studio having to use TG for a one off task, never to touch it again after. I can't use commonplace net slang?

QuoteFirst the atmosphere will not only "haze it down" it will alter the color and saturation with distance from camera.
which is what fog does sure, I just tried expressing it quicker.

QuoteTurn off the atmosphere and shadows in the Render node, then render your terrain.  In the image map shader that holds your orthophoto you can adjust the gamma of the image under Colour.  Test that and see if it renders close to your original.
surely this was easier than going "look it up"  ;)
thanks.
(no grudge btw, just toooo many people on every any forum would rather go "lmgtfu" than actually respond, I understand that too many noobs do stupid things like "how to make terrain" or something, but sometimes when people understand the issue they're having with the software, it's nicer to just help them  :) )

Quote from: Tangled-Universe on May 26, 2010, 06:48:18 PM
Looking at your network you don't need the two connections on the right (breakup and blendshader) to have the diffuse map showed correctly.
You'll only need to use the "child layer" port. The distribution shader v4 acts like a parent shader where the diffuse map can exist on.
If you connect the diffuse map to the child layer input of the distribution shader v4 then it will be parented by it.
This way you can also control height and slope of the diffuse map by using the parameters in the distribution shader.
You could also have used a surface-layer, which offers the same functionality basically, but also with some extra inputs.

There's a chance you indeed need to change the gamma setting of your texture to make it match. If you already applied gamma adjustments in, say Photoshop, then TG2 also applies a gamma operation to the image.
As gregsandor explained you can find these settings in the image-map shader.

A nice way of displacing a surface with an imagemap is by feeding the imagemap-shader to the shader-input of a displacement-shader-node (add shader->displacement shader->displacement shader). Then in between those two nodes you can attach a colour adjust shader (add shader -> add colour shader -> colour adjust shader). With the colour adjust you can change contrast and gamma of the imagemap quite easily by changing the black/white-point of the image and/or gamma.

Hope some of this helps you along.

Cheers,
Martin

Thanks Martin!
I got the displacements from image map straight through the comupte terrain, so that all works, but the color adjust does the trick when plugged into child layers of the distribution layer. I know, as usual there's no complete right way of doing something, just tricky when there's no proper reference, having to rely on community support.
Thanks!

Quote from: gregsandor on May 26, 2010, 06:10:56 PM
If Maya and Nuke have superior shaders go use them. 
This is how a real node reference looks like where every possible parameter and functionality is described. For the scope and power of TG2 and what it's capable of, help files and reference it has are a joke, don't you think?


neuspadrin

Quote from: nomand on May 26, 2010, 07:37:30 PM
QuoteAlright, who told the kids on 4chan about TG?
You may be one of them! don't deny it :D. This 'kid from 4chan' is a CG artist, working in a studio having to use TG for a one off task, never to touch it again after. I can't use commonplace net slang?
It mainly just isn't good to come into a forum that has dedicated members more then willing to help you out, as long as it stays civil.  Calling members of many years with many posts a troll generally doesn't help improve your image to get said help.

Quote from: nomand on May 26, 2010, 07:37:30 PM
Quote from: gregsandor on May 26, 2010, 06:10:56 PM
If Maya and Nuke have superior shaders go use them. 
This is how a real node reference looks like where every possible parameter and functionality is described. For the scope and power of TG2 and what it's capable of, help files and reference it has are a joke, don't you think?
It's known the reference work isn't perfect, and it is something they are working on.
But also, how many thousands of dollars is maya? With huge number of clients, and supported by a huge company.  Then theres Terragen, with all of 4 employees.  Give a little slack, yes its not perfect but it beats nothing. Of course maya will have some amazing documentation.

And as mentioned, it is a known to be a big issue with Terragen 2, especially now that its finally released and seems to be getting used more.  Previously almost all of us users were hobbyist doing this for fun, not as many for work.  But now thats changing with newer users, and documentation has increased in priority.  First priority was getting a program that works well with the features everyone wants.

nomand

Quote from: neuspadrin on May 26, 2010, 08:24:28 PM
It mainly just isn't good to come into a forum that has dedicated members more then willing to help you out, as long as it stays civil.  Calling members of many years with many posts a troll generally doesn't help improve your image to get said help.

I realise that, I see the number of posts people have, that usually means something regarding their activity on the forums, I have all the respect, except for when people throw you off in a cynical tone, so things like "this been answered before, go search" pretty much equals "see that button on the top says logout? use it".

I loved Terragen 1, and love the artwork people come up with TG2, and no doubt Maya's too huge to compare to, but not about the software, as much as the "more than willing to help you" part of the forum culture you mentioned. Some like Tangled-Univers is more than happy to help and great thanks for giving me the hints I was looking for, unlike gregsandor's first post that came off as a too long of a way to say "gtfo".

all good though, I got my questions answered, thanks for the help to those who helped.  :)

Zylot

Some folks get jumpy at new members joining and immediately jumping into rants about the software and related subjects before even addressing their concerns first.. it happens.

Catch more flies with honey than vinegar they say, but that goes both ways. 

Welcome to the forums, I see Martin is addressing your concerns, and he's a TG2 ninja (the bluish green image under his name is the "TG2 Ninja STAMP of approval") so you're in good hands.

FrankB

Quote from: Zylot on May 28, 2010, 04:03:00 PM
... he's a TG2 ninja (the bluish green image under his name is the "TG2 Ninja STAMP of approval") so you're in good hands.

hahaha, I gotta remember that term!  ;D :D ;D